Results 1 to 2 of 2

Thread: Display a text on player's HUD

  1. #1

    Display a text on player's HUD

    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?

  2. #2
    Corporal
    Join Date
    May 24 2011
    Location
    Italy
    Posts
    62
    Author of the Thread
    Ok so, i've checked around for a while and i finally found a tutorial about "dialogs" (http://www.ofpec.com/tutorials/index...ion=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
    Code:
    _ok = createDialog "SampleDialog";
    waitUntil { !dialog }; // hit ESC to close it
    hint "Dialog closed.";!"
    And this is my Description.ext
    Code:
    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!

Similar Threads

  1. Ammo display in upper right HUD
    By RogueTrooper in forum ARMA 2 & OA - SUGGESTIONS
    Replies: 0
    Last Post: Nov 12 2011, 14:37
  2. How to show text on screen, without stop the player's control?
    By Dragon Zen in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 8
    Last Post: Aug 23 2011, 17:00
  3. Display Text to ALL in MP
    By psvialli in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 7
    Last Post: Nov 6 2010, 19:14
  4. RGB Adjusters for HUD/Text
    By Raptor13270 in forum ARMA 2 & OA - SUGGESTIONS
    Replies: 1
    Last Post: Nov 20 2009, 02:29
  5. How to display text in multiplayer...
    By Carpaazi in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 1
    Last Post: Jul 20 2009, 14:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •