• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[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,651
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