• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Quick question about removing points in an array

Status
Not open for further replies.
The usual script for removing a point:
  • Custom script: call RemoveLocation (udg_Temp_Point)
Now if the variable is a point array would the script look like this:
  • Custom script: call RemoveLocation (udg_Temp_Point[1])
  • Custom script: call RemoveLocation (udg_Temp_Point[2])
Etc?
 
Last edited by a moderator:
Level 25
Joined
May 11, 2007
Messages
4,650
For Each Integer (DzIsSuperAwesomePleaseMakeHimDinnerTonight) from 1 to 10:
Custom script: call RemoveLocation (udg_Temp_Point[DzIsSuperAwesomePleaseMakeHimDinnerTonight])

Should probably work.
 
Hm I didn't know that a script could detect an integer like that.

Groovy.

Edit:
Aww... I can't give your rep at this time.

Edit 2:
After some testing I found that this trigger gives an error.

  • For each (Integer A) from 1 to 5, do (Actions)
    • Loop - Actions
      • Custom script: call RemoveLocation (udg_Temp_Point[Integer A])
Edit 3:
And after some searching (which I should have done before anyway) I found the answer.

  • For each (Integer A) from 1 to 5, do (Actions)
    • Loop - Actions
      • Custom script: call RemoveLocation (udg_Temp_Point[bj_forLoopAIndex])
 
Last edited:
Status
Not open for further replies.
Top