HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

make the spell only damage enemies

08-11-2008, 11:27 PM#1
Sabertooth_X
Mine is extremely simple (or it should be) but I'm running into a problem. I want the spell to only damage units owned by players that are not allied with the owner of the triggering unit. I apologize for defiling this thread with GUI shit, but I don't know how to make a trigger like that in jASS.

I tried this in GUI using:
Trigger:
Unit Group - Pick every unit in (Units in Region (target point of ability being cast) with size (300, 300))) matching (((Owner of Matching Unit)) is an enemy of (Owner of Triggering Unit))) equal to True)) and do ((Unit - Cause (Triggering Unit) to damage (picked unit) for (500) damage type (spells) type (normal)

The problem is, well, it's not doing the damage. And at the moment I can't see any obvious mistakes...can anyone who knows GUI help here?
08-11-2008, 11:43 PM#2
Anitarf
I moved the post to a new thread where it belongs.
08-12-2008, 12:15 AM#3
Sabertooth_X
Ahh, thanks Ani.
08-12-2008, 08:32 AM#4
Pyrogasm
Yeah, just don't use regions, it really makes no sense to use them anyway:
Trigger:
Set TempPoint = Target point of ability being cast
Custom script: set bj_wantDestroyGroup = true
Collapse Unit Group - Pick every unit in (Units within 300.00 of TempPoint matching (((Owner of Matching Unit)) is an enemy of (Owner of Triggering Unit))) equal to True)) and do (Actions)
Collapse Loop - Actions
Unit - Cause (Triggering Unit) to damage (picked unit) for (500) damage type (spells) type (normal)
Custom script: call RemoveLocation(udg_TempPoint)
08-12-2008, 03:24 PM#5
Sabertooth_X
What's "set bj_wantDestroyGroup = true" for?

EDIT: It seems to work without that line, but still, what does it do? It gave me an error when I tested the map.
08-12-2008, 04:25 PM#6
Anitarf
bj_wantDestroyGroup is a global boolean that the function ForGroupBJ uses to determine if it should clean up the group after it loops through it. Basically, setting this boolean to true before doing a pick-every-unit loop will cause the group used to be automatically cleaned up, thus preventing a memory leak.
08-13-2008, 06:20 AM#7
Pyrogasm
...and preventing you from having to save the group in a variable and then destroy it with another Custom Script.