Variable question. +rep;)

Zhirgoyt

New Member
Reaction score
9
Let's say I have 4 variables named Variable_1, Variable_2 and so on.
Then I have a trigger like this:
Events: Unit enters region Start
Conditions:
Actions:
Here I would like the action to do something like this; random a number between 1 and 4. If the number is one I would like it to use the Variable_1 and so on.... ok this is very confusing, I wil try agan.

Is there an action where it can take the last part of a variable and replace it, like Variable_ and then change the last number? Is it a special variable or what?:p This is very confusing I know but write back if you don't understand.
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
You can make it an array variable and make it like this:

Code:
Events
Map Initialization

conditions

Actions
Set Variable[1] = something
Set Variable[2] = something
Set Variable[3] = something
Set Variable[4] = something

Code:
Events
Unit enters Start <gen>

Conditions

Actions
Set RandomInt = Random integer between 1 and 4    //This variable isn't neccessary
Do something with Variable[RandomInt]
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top