Arrays in Custom Scripts

Chao

Setting sail for fail in the sea of lame.
Reaction score
63
Hey y'all!

I was wondering about the correct way to mark the removal of a point in an array:

Custom script: call RemoveLocation(udg_ResPoint[1]) doesn't work so well.:S
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
call RemoveLocation(udg_ResPoint[1]) is correct

Sure the "ResPoint" is a variable of type point with array checked?
How do you know it doesnt work so well, any error?
or are you asking for "GetForLoopIndexA" (Integer A in GUI) instead of the index number 1?
Show us the trigger?
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
If you array is an integer variable you still need to put udg.
(e.g.)
Trigger:
  • Actions
    • Set Integer = 1
    • Set Point[Integer] = Position of (Triggering unit)
    • custom script: call RemoveLocation( udg_Point[ udg_Integer])
 

Chao

Setting sail for fail in the sea of lame.
Reaction score
63
Oh, thank you very much, gents!

I used that style, and for some reason it failed me miserably.... I just made a small dummy map and found that

call RemoveLocation(udg_ResPoint [1] ) works...... so to speak....
I'll try that style on my map. Thanks for the help, guys.

EDIT: Yes, it did work. I must have done it wrong the first time!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top