HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger problem

07-24-2004, 08:46 PM#1
Nabren
I am working on an RPG, and each location has it's own region. I am trying to make a trigger that when a person leaves, and there is noone else in the region, it kills all the units to save memory. The trigger in itself works fine! The problem is, after it kills all the units, it KEEPS doing it. It goes into an infinite loop, and the next time a unit spawns, it kills it instantly.

Any ideas why it's going this and how to fix it?
07-24-2004, 09:21 PM#2
Rafael Br
Show the trigger, or it will be hard to know.
07-24-2004, 09:34 PM#3
CryoniC
Use Unit - Remove instead of killing the unit. It's better at cleaning the memory.
07-25-2004, 12:45 AM#4
Nabren
Quote:
Originally Posted by Rafael Br
Show the trigger, or it will be hard to know.

Okay here's what I got:

Event - A Unit Leaves Region

Condition - ((Owner of (Leaving Unit)) Controller) Equal to User

Actions -
Unit Group - Pick every unit in (Region) and do (If (((Owner of (Picked Unit)) controller) Not equal to User) then do (Unit - Kill Picked Unit)) else do (Do Nothing))
07-25-2004, 02:08 AM#5
Rafael Br
I have seen a lot of trigger problems, but this is really weird!The trigger has nothing wrong!It is probably a problem on another trigger, the one that spawns the units.And change "kill unit" to remove unit, it is better to clean the memory, like has been said.
07-25-2004, 02:34 AM#6
horusrogue
Quote:
and the next time a unit spawns, it kills it instantly.


Do you mean spawns in that region?
If so, all my unsure mind can think of is turn the trigger off after it kills the units.