• 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.

Call RemoveLocation (blah_X[Array])

Status
Not open for further replies.
Level 7
Joined
Dec 28, 2009
Messages
257
Heya folks, basic question.. :D

When ive got Point Array with like 10 points (created by loop), can i somehow delete them all with one simple command?
Cause when i tried something like
  • For each (Integer Number) from 1 to 10, do (Actions)
    • Loop - Actions
      • Custom script: call RemoveLocation (udg_Point[Number])
it doesnt work, that kind of script doesnt like that [Number] there :D

So, is there any way how remove those points without having 10 lines for each integer array? :D

thanks :D
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
You should use udg_ prefix for variables when you use custom script.

call RemoveLocation(udg_Point[udg_NumberVariableName])

and these are for integer A and B

call RemoveLocation(udg_Point[bj_forLoopAIndex])
call RemoveLocation(udg_Point[bj_forLoopBIndex])
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
^ This will do.

This is better: call RemoveLocation(udg_Point[GetForLoopAIndex()])

This is NOT better. GetforLoopAIndex() returns integer bj_forLoopAIndex, which can be called directly to avoid resource waste.
 
udg stands for user defined global. That's why u need udg_ on your variables



This is better: call RemoveLocation(udg_Point[GetForLoopAIndex()])

LOL
JASS:
function GetForLoopIndexA takes nothing returns integer

    return bj_forLoopAIndex

endfunction

Read more in blizzard.j :D

Also, that function you suggested the_blood doesn't exist, you put "A" before "Index"
 
Status
Not open for further replies.
Top