Tip of the week archive

By hoz

Tip #1

Adding a percentile(%) to the format command may seem like an impossible task. This little trick of appending a string of "%" to the format command makes it possible!

This will not display the percentile.

format["You have %1% ammo remaining", _mypercentage];

This will display the percentile.

format["You have %1%2 ammo remaining", _mypercentage, "%"];

As you can see here, the % within the quotes is an actual string, and the %2 sucks in the string and appends it.

 

Tip #2

Make all the units of a group sit down.

{
  doStop _x;          
  sleep 0.5;           
  _x action ["SitDown", _x];
} forEach units MyGroupName;

Tip #3

If you want turn off the default conversation with NPCs...

unit setVariable ["BIS_noCoreConversations", true]


The unit could be the player in most cases.

Advertisement