HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Bah! Stupid worldedit! I need a work-around for this problem!

01-13-2003, 10:13 PM#1
Guest
Grrrr... stupid world edit, Im making a dodge ball map where the "balls" are computer controlled wisps. Im all but done with the exception of the tagging trigger. I need to write a trigger that will "tag" a unit if a ball comes close enough, the problem is that the Unit comes withing range event doesnt allow variables! grrr... can some one help me? perhaps some jass might do the trick, i dunno. Ill give due credit on my map for any good help.
01-13-2003, 10:56 PM#2
Guest
Instead of range, make regions as big as the range you need. Then use a periodic event trigger, and use region-move to center it on the unit. Then use a unit enters region event to detect if the wisp is in range.
01-13-2003, 11:22 PM#3
dataangel
That won't work, if the region moves the unit has to leave it and then come back in before it'll set off a unit enters region event. Use a periodic event, every .5 seconds or so, and unit group all units within range of the ball.
01-14-2003, 12:20 AM#4
Guest
oh, i forgot to mention that there are 3 balls, and they can be killed and replaced.... thats whats making it difficult for me...
01-14-2003, 12:33 AM#5
ph33rb0
Thats probably why the unit comes within range doesn't work. Here's what I'd try:

Have a trigger to detect when the wisp is killed, and have the respawning one be stored in a variable (say an array named Balls)

Then, when you test to see when a unit comes within range of the wisp use Balls[0], Balls[1] and Balls[2]
01-14-2003, 12:53 AM#6
Guest
Fear: I was gonna try something exactly like you said, the problem is, like i said above, the "Unit within range" event wont accept unit variables. Itll only allow u to pick a unit that is already placed on the map, which wont work cause the balls are created after the map starts. If i could just get some way to get the event to take a unit variable i could get it to work no problem.

I guess i could prolly do it with a periodic event, but thatd be a lot more work....
01-14-2003, 01:27 AM#7
ph33rb0
Interesting... You could make a permenantly invisible unit over the ball and have the trigger be based off that.
01-14-2003, 02:06 AM#8
Dr_Hack
Haven't tried it but sounds like you need some unit variables. Make as many Named Unit variables as you need. Set the unit variable to "last created unit" to identify those units not allready on the map. Set your range to find the unit variable instead of the actual unit. Should work.
01-14-2003, 02:15 AM#9
MicrosoftXP
use fears solution, only u need 3 balls i guess and if it is 'killed' move it to the corner of the map, or turn off the trigger and if it is 'replaced' move it back on the field.

very nice idea fear =)
01-14-2003, 11:00 AM#10
Guest
aw crap... so theres no way to get the stupid event to accept a unit variable then? I was hoping there would be, no i have to rewrite most of my triggers...:(