Sign in to follow this  
Followers 0
Enricksolt

Display a text on player's HUD

2 posts in this topic

For almost 2 days i searched around for find something about what i need, but i've not found anything, so i have to ask it here. What i need is to show a text in the bottom-right coner of the screen, with two strings: the name of the town\village where the player is and the "side" of the village. Like this.

Now, i don't have problems about how to get the town's name string or the side string, my main problem is that i have no clue about how to build it. I've already try to understand how to do it by looks in other mission (AAS, Domination type) scripts, but without success. Can someone help me out?

Share this post


Link to post
Share on other sites

Ok so, i've checked around for a while and i finally found a tutorial about "dialogs" (http://www.ofpec.com/tutorials/index.php?action=show&id=82). I've play and tested around with it, but now there's a big problem: the dialog just won't show up.

This is the init.sqf

_ok = createDialog "SampleDialog";
waitUntil { !dialog }; // hit ESC to close it
hint "Dialog closed.";!"

And this is my Description.ext

class SampleDialog {
idd = -1;
movingEnable = false;
controlsBackground[] = {};
controls[] = {
  ButtonControl,
  HintButton
};
objects[] = {};

class ButtonControl {
idc = -1;
type = 1;
style = 2;
moving = false;
x = 0.45;
y = 0.9;
h = 0.05;
w = 0.1;
font = "Zeppelin32";
sizeEx = 0.025;
action = "player setDamage 1;";
text = "Close";
default = false;
colorText[] = {1,0,0,1};
colorFocused[] = {0,1,0,1};
colorShadow[] = {0.8,0.8,0.8,1}; 
colorBorder[] = {0.5,0.5,0.5,1}; 
	colorBackground[] = {0,1,1,1};
   colorBackgroundActive[] = {0,1,0,1}; 
  	colorDisabled[] = {1,0,0,1};
  	colorBackgroundDisabled[] = {0.5,0.5,0.5,1};
borderSize = 0.015;
   offsetX = 0.005;
offsetY = 0.005;
offsetPressedX = 0.002;
offsetPressedY = 0.002;
soundEnter[] = {"",0,1}; // NoSound
soundPush[] = {"",0,1}; // NoSound
soundClick[] = {"",0,1}; // NoSound
soundEscape[] = {"",0,1}; // NoSound
};

class HintButton : ButtonControl {
x = 0.6;
text = "Hint";
action = "hint 'Hint from second button!';";
};
};

But soon as i start the game, the "Dialog Closed" popup shows out. I read about that sometime the dialog close itself if there is a "closeDialog" function in the action field, but this is not the case. I don't really know what i'm doing wrong, please help!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0