HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Cleaning Point-Arrays

04-16-2007, 09:39 PM#1
Dil999
How do I run this:
Collapse JASS:
call RemoveLocation( udg_TempPoint )
But so it deletes an array of a bunch of points? So, for example, it will delete TempPoint[1] to TempPoint[20]?
04-16-2007, 09:47 PM#2
Captain Griffen
No.
04-16-2007, 10:03 PM#3
Vexorian
you need a loop and remove each index
04-16-2007, 10:14 PM#4
Dil999
Im making this with gui, and as far as i know you cant concoct custom scripts.
If i just did that script I put above, would it delete every index?
Edit: Or else, could i just put call RemoveLocation( udg_TempPoint[1] )
04-16-2007, 10:19 PM#5
darkwulfv
easiest way is through JASS:

Collapse JASS:
loop
exitwhen i > 20
call RemoveLocation(udg_TempPoint[i])
set i = i + 1
endloop

If you can do it in GUI, it's bound to be a pain. Best to do it like this. All you need to do is a few lines of Custom Script actions, each action having one line of that. In fact, I'll do it for you. Gimme a minute.

Trigger:
Remove Locations
Events
Conditions
Collapse Actions
Custom script: local integer i = 0
-------- YOUR OTHER ACTIONS --------
Custom script: loop
Custom script: exitwhen i > 20 (or whatever the highest number is)
Custom script: call RemoveLocation(udg_TempPoint[i])
Custom script: set i = i + 1
Custom script: endloop

although, you may was well do the entire trigger in JASS, seeing as how theres a ton of custom script.
04-17-2007, 01:33 AM#6
Pyrogasm
Do this, Dil999:
Trigger:
For each (Integer A) from 1 to 20 do (Actions)
Collapse Loop - Actions
Custom script: call RemoveLocation(udg_TempPoint[GetForLoopIndexA()])
For things like that which you need to find out how to write in a custom script, just do the following:

Make an action that contains the thing you want ("Index A", "Attacking Unit", etc.), go to Edit and click on "Convert to Custom Text". You should see a line that says "function Trig_Your_Trigger_Name_Actions" at the beginning. The line below that is where your action is; just search through it until you find what you're looking for. You can Ctrl+Z to undo the custom script conversion.
04-17-2007, 02:29 AM#7
Dil999
Thanks. +Rep to wulfv for helping me learn to code jass without knowing it, and to pyro for the simple response.