Jump to content
Sign in to follow this  
speedshooter

Arma 2 OA Constant Hint

Recommended Posts

Hi,

I have seen this done before so i know its possible.

Does anyone know how to make a "custom" hint so where the hint box does not reset. So for instance one hint can say "Welcome" then when you get anyother hint it shows up in the same hint box but below it. So it would be "Welcome" - New line "New Hint".

If you dont understand what i am saying please say so.

An Example of how to call it would be

[format["Welcome To The Server", name player],"#FFFFFF"] call ultrp_hint;

- Any help is great

-SpeedShooter

Share this post


Link to post
Share on other sites

This effect is achieved using a silenthint and an infinite loop.

// Example
outputHints = true;
outputText = "Welcome!";

while {outputHints} do {

   hintsilent outputText;
   sleep 1;

};

Now you could easily alter the outputted text by altering the correspondent public variable. For newlines you'd use "\n".

outputText = "Welcome!\n\nThis is an simple example.";

After you execute the code above you'd get your text altered after a seconds wait. If you want the change to occur immediatly, you should consider to lower the sleep time (like 0.5, but every value under that is unnecessary).

Now you know the trick and could do a lot more to get a more programmatic solution, like a format[] or calling a function or whatever, its up to you...

Share this post


Link to post
Share on other sites

Thanks A Bunch!

Ill try this out and let you know!

---------- Post added at 15:55 ---------- Previous post was at 15:30 ----------

Could you show me how i would get it as a fnc with a parseText format?

Edited by speedshooter

Share this post


Link to post
Share on other sites

Put into your init.sqf or anywhere and execute it once before using the commands:

hintOutputText = "";
hintOutputEnabled = false;
hintOutputRefreshSpeed = 1;  // in seconds

hintOutputEnable = {
   if (!hintOutputEnabled) then
   {
       hintOutputEnabled = true;
       [] spawn {
           while {hintOutputEnabled} do {
               hintsilent hintOutputText;
               sleep hintOutputRefreshSpeed;
           };  
       };
   };
};

hintOutputDisable = {
   hintOutputEnabled = false;
   hintsilent "";
};

changeHintOutputText = {
   hintOutputText = parseText _this;
};

addHintOutputText = {
   hintOutputText = format["%1\n%2", hintOutputText, parseText _this ];
};

Now you can activate and deactivate the hints using:

// To Activate, insert this anywhere in your scripts
call hintOutputEnable;

// To Disable
call hintOutputDisable;

And if you want to change the text:

"<t size='1.25'>Welcome!</t>" call changeHintOutputText;

// Or if you want to have some multiline text:
"<t size='1.25'>Welcome!</t>\n\nAdded two newlines." call changeHintOutputText;

If you want to add a new line of text, use this instead (has the same effect like the second example in "changeHintOutputText":

"<t size='1.25'>Welcome!</t>" call changeHintOutputText;

"Added a new line of Text" call addHintOutputText;

I didn't test all of these commands as I typed it in here, so you have to look for errors and debug a bit if there are some :D

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  

×