Jump to content
Alert23

BIS_fnc_dynamicText (Script-help)

Recommended Posts

hi everyone, hope your fine.

 

i have a script which shows me how much Hostiles Remaining:

shown on screen with HintSilent

[] spawn { while {alive player} do {  
  	_totalEnemy = {alive _x && side _x == resistance} count allUnits;   
    
 	if (_totalEnemy > 1) then {   
  	Hintsilent format ["Hostiles Remaining: %1", _totalEnemy ]; 
  		};  
 	};   
};

however my question is, is it possible using BIS_fnc_dynamicText in the script above instead HintSilent ?

i find BIS_fnc_dynamicText looks way better.

Share this post


Link to post
Share on other sites

Sure, follow the parameters described in your first link but don't spawn the code on each loop, and choose carefully the duration...

So ease your loop! I mean there is no need to "refresh" such info on each frame (especially spawning this function with its duration).

So, add something "waiting" for any different count, like:
 

[] spawn { while {alive player} do {
  _totalEnemy = {alive _x && side _x == resistance} count allUnits;
   waitUntil {uiSleep 1; ({alive _x && side _x == resistance} count allUnits) != _totalEnemy};
  [format ["Hostiles Remaining: %1", _totalEnemy ],-1,-1,3,1,0,789] spawn BIS_fnc_dynamicText;
  uiSleep 1;
}};

 

Now if you need a permanent display, like in wasteland, alive or else, you need to write a display. More difficult.

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
5 hours ago, pierremgi said:

Sure, follow the parameters described in your first link but don't spawn the code on each loop, and choose carefully the duration...

So ease your loop! I mean there is no need to "refresh" such info on each frame (especially spawning this function with its duration).

So, add something "waiting" for any different count, like:
 


[] spawn { while {alive player} do {
  _totalEnemy = {alive _x && side _x == resistance} count allUnits;
   waitUntil {uiSleep 1; ({alive _x && side _x == resistance} count allUnits) != _totalEnemy};
  [format ["Hostiles Remaining: %1", _totalEnemy ],-1,-1,3,1,0,789] spawn BIS_fnc_dynamicText;
  uiSleep 1;
}};

 

Now if you need a permanent display, like in wasteland, alive or else, you need to write a display. More difficult.

 

WoW ! Amazing that this is even possible, THANKS.

Edit:

so the code will only update/shown if the totalEnemy number decreases?

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

×