Jump to content
Sign in to follow this  
magicpanda

What are the options for displaying Variables on screen other than via Hint

Recommended Posts

As in the title really. Been digging around for the last hour but nothing. Maybe im using the wrong search terms.

I've got a timer that displays on screen via hint but I would like to show the finished times at the end of a mission really.

What are the options? The ideal one would be via the task description once it's completed.

Share this post


Link to post
Share on other sites
cutRsc is one method for it to be constantly displayed without freezing user interaction. Or titleRsc for an easier method of simply displaying text.

Share this post


Link to post
Share on other sites

Nice, cheers.

player sidechat format ["%1",_variable];

Any others?

---------- Post added at 09:26 PM ---------- Previous post was at 09:17 PM ----------

Thanks LordHeart, ctRsc looks like a deep rabbit hole so to speak. GUI generation is a bit out of my ballpark at the moment.

Share this post


Link to post
Share on other sites

There are a few at bottom of the page , maybe vehiclechat for during race and global for final times ?

Share this post


Link to post
Share on other sites

Once you play with it for a while you realise, yeah it's still really seriously confusing.

Share this post


Link to post
Share on other sites

Bit harsh as it pauses the game. Cheers though, will come in useful :)

Edited by Magicpanda

Share this post


Link to post
Share on other sites

1) HINTS

hint "my message here";

Hint

HintC

HintSilent

2) CHAT commands

globalChat

groupChat

sideChat

systemChat

vehicleChat

3) cutRsc ot titleRsc

This is by far the most flexible option but does involve you creating your own UI elements to display something.

Further reading: Dialogs

4) cutText or titleText

cutText ["Hello World", "PLAIN"];
titleText ["Hello World", "PLAIN"];

Displays the text in the center of the screen "PLAIN" can be replaced with other options to black out the screen etc.

The above examples look like this in game

cutText.jpg

5) BIS_fnc_guiMessage

["hello world", "header", false, nil, nil, nil,false] call bis_fnc_guiMessage

This one is like the error boxes or the box you get after you have changed video settings that tells you you need to restart your machine. Gives you the options for an OK and CANCEL button. Maybe not very useful for what you want but looks like this in game.

guiMessage.jpg

6) BIS_fnc_showNotification

["template" , [args] ] call BIS_fnc_showNotification;

This uses the notification system like when a task changes or your have captured a sector or a new respawn point has spawned etc.

To use it you need to set up a template in your descriptiton.ext e.g

class CfgNotifications
{
class myTemplate
{
	title = "%1";
	iconPicture = "a3\ui_f\data\map\Markers\Military\warning_ca.paa";
	iconText = "";
	description = "%2";
	duration = 5;
	priority = 0;
	difficulty[] = {};
	sound = "defaultNotification";
	soundClose = "defaultNotificationClose";
	soundRadio = "";
};
};

You could now use

["myTemplate",["MyTitle","MyDescription"]] call BIS_fnc_showNotification;

%1 and %2 in the template will now be replaced with MyTitle and MyDescription and would look like this in game

notification.jpg

Further Template info can be found here.

I have used an icon from the map icons the ! more icons can be found by checking out CFGMarkers in the config brower, there are also other icons with in the game files that you can use.

Share this post


Link to post
Share on other sites

with titletext \n will help to display the text at the bottom of the screen:

titleText [ ("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nhello screenbottom","PLAIN"];

pic

Edited by CJoke

Share this post


Link to post
Share on other sites

I wonder, is there a way to get a variable into the on screen Ticker Tape text in the recent showcases?

Here's the code.

Bis_printText =
{
   private["_blocks","_block","_blockCount","_blockNr","_blockArray","_blockText","_blockTextF","_blockTextF_","_blockFormat","_formats","_inputData","_processedTextF","_char","_cursorBlinks","_cursorInvis"];

   _blockCount = count _this;

   _invisCursor = "<t color ='#00000000' shadow = '0'>_</t>";

   //process the input data
   _blocks = [];
   _formats = [];

   {
       _inputData = _x;

       _block     = [_inputData, 0, "", [""]] call BIS_fnc_param;
       _format = [_inputData, 1, "<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>", [""]] call BIS_fnc_param;

       //convert strings into array of chars
       _blockArray = toArray _block;
       {_blockArray set [_forEachIndex, toString [_x]]} forEach _blockArray;

       _blocks  = _blocks + [_blockArray];
       _formats = _formats + [_format];
   }
   forEach _this;

   //do the printing
   _processedTextF  = "";

   {
       _blockArray  = _x;
       _blockNr      = _forEachIndex;
       _blockFormat = _formats select _blockNr;
       _blockText   = "";
       _blockTextF  = "";
       _blockTextF_ = "";

       {
           _char = _x;

           _blockText = _blockText + _char;

           _blockTextF  = format[_blockFormat, _blockText + _invisCursor];
           _blockTextF_ = format[_blockFormat, _blockText + "_"];

           //print the output
           [(_processedTextF + _blockTextF_), 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText;
           playSound "click";
           sleep 0.08;
           [(_processedTextF + _blockTextF), 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText;
           sleep 0.02;
       }
       forEach _blockArray;

       if (_blockNr + 1 < _blockCount) then
       {
           _cursorBlinks = 5;
       }
       else
       {
           _cursorBlinks = 15;
       };

       for "_i" from 1 to _cursorBlinks do
       {
           [_processedTextF + _blockTextF_, 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText;
           sleep 0.08;
           [_processedTextF + _blockTextF, 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText;
           sleep 0.02;
       };

       //store finished block
       _processedTextF  = _processedTextF + _blockTextF;
   }
   forEach _blocks;

   //clean the screen
   ["", 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText;
};  

Bis_printSampleText =
{
   [
       ["TACTICAL BACON HQ","<t align = 'center' shadow = '1' size = '1.0'>%1</t><br/>"],
	["0500, ALTIS","<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>"]


   ] spawn Bis_printText;

};

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  

×