HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need an event

03-22-2007, 03:21 AM#1
The_AwaKening
I have a trigger which uses "TriggerRegisterEnterRect" to make the unit invulnerable. My problem is that if a unit is already there and morph's, robo's, etc.; the new unit is not detected as entering the rect and is therefore not set invulnerable. I'm just wondering what the best soluting to this would be.

I could register the spell effects, but I'm hoping for something easier than checking all of my units which could morph.

Edit: I just ended up enabling a periodic to group units in that region and do my actions. Trigger is disabled again when the group is empty, meaning they left the region. Should work ok, so nvmnd.
03-22-2007, 10:53 AM#2
StockBreak
This happens because a morphing unit is not a "new" unit, but has only different stats. Your periodic event could be a nice workaround.
Are your units supposed to turn vulnerable again when they exit the region?
If so you could make something like this:

Trigger:
Entering Region
Collapse Events
Unit - A unit enters YourRegion <gen>
Conditions
Collapse Actions
Unit - Make (Triggering unit) Invulnerable
Unit Group - Add (Triggering unit) to InvulnerableGroup

Trigger:
Leaving Region
Collapse Events
Unit - A unit leaves YourRegion <gen>
Conditions
Collapse Actions
Unit - Make (Triggering unit) Vulnerable
Unit Group - Remove (Triggering unit) from InvulnerableGroup

Trigger:
Still Invulnerable
Collapse Events
Time - Every 1.00 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in InvulnerableGroup and do (Actions)
Collapse Loop - Actions
Unit - Make (Picked unit) Invulnerable

I hope it helps. Cheers.