Random integer

From HIVE
Revision as of 05:37, 24 November 2010 by DevliN (talk | contribs) (Testing Template:Trigger)
Jump to navigation Jump to search

The random integers have a lot of applications. This wiki will try to give trigger references for the most common on them.

Pick + Withdraw

If you want the editor to pick number 1-3, assign it to a random player, and then force it to pick a new value from the remaining values between 1-3, and assign it to a player that has been assigned no units: http://vgshorts.com/BBCode/BBCode3.php?ID=17

StarCraft 2 Trigger [template]
Events:

None.

Variables:

None.

Conditions:

None.

Actions:

None.

Limitations

While short and sweet, this trigger segment can be subject to long running times if a number is repeatedly picked by the random integer function (as it will pick it, realize it has been picked, and then re-pick over and over again). While it will generally not be noticeable, as the triggers run quite fast, bear in mind that using large choice or player integer values can cause this script to lag. It is better suited to values of about 15 or below.