variable questions

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
if i use a variable with an index of array of 1, and triggers use that variable to higher arrays will they work correctly?
 

Napenthe

New Member
Reaction score
2
Seems to me that I've seen people post triggers with custom scripts that do that. I think the gui requires you refer to a specific variable index any time you reference an array variable.

Here's an example from Tinki3's "creep revival system". It starts with Creep_X[1] and Creep_Y[1]
:
Trigger:
  • Creep Revival System Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Set Integer = (Integer + 1)
          • Unit - Set the custom value of (Picked unit) to Integer
          • Custom script: set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
          • Custom script: set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())

This creates an index of Creep_X and Creep_y for each creep on the map and set's it to their x and y offsets (and sets the unit's custom value to the integer variable for later reference).
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
that isnt what i meant... if you create a variable and mark array and leave it as 1... can you use more than just index 1?
 

Napenthe

New Member
Reaction score
2
that's what it does. It starts with Array[1] and adds index's as new ones are needed. Guess i don't understand the question. Maybe give an example of where you would use the variable.
 

tommerbob

Minecraft. :D
Reaction score
110
He's just asking if arrays need to be set higher than 1 for higher index integers to work.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top