HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

I think it's a memory leak problem... :[

06-28-2009, 11:46 PM#1
Mendel
Hi... so... i did this script wich is a simple respawn system with loot
Trigger:
Undead
Collapse Events
Unit - A unit owned by Neutral Hostile Dies
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to Giant Skeleton Warrior
(Unit-type of (Triggering unit)) Equal to Ice Revenant
Collapse Actions
Set Random = (Random integer number between 1 and 6)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Random Less than 3
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Random Equal to 1
Collapse Then - Actions
Item - Create (Random level ((Level of (Triggering unit)) + 1) Permanent item-type) at (Position of (Triggering unit))
Collapse Else - Actions
Item - Create (Random level (Level of (Triggering unit)) Permanent item-type) at (Position of (Triggering unit))
Else - Actions
Wait 20.00 seconds
Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at (Random point in Undead <gen>) facing Default building facing degrees
Special Effect - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\ReplenishMana\SpiritTouchTarget.mdl


So the problem is that they don't respawn back as i want them....
If it take away the Wait command so they do respawn.. but with it.. they don't...-.-"
and the special effect doesn't show up at the end with the wait and with out it..
what should i do?

I'll take any suggestion :]
Thanks in advance
06-29-2009, 12:12 AM#2
Anitarf
Well, if the corpses of the dying units decay in those 20 seconds or are used up for raise/animate dead then the "triggering unit" no longer exists and that is your problem, you can't get it's unit type.
06-29-2009, 09:57 AM#3
Mendel
Ok so i figured it out.. the problem was that the creep didn't decay... i compared them to another type of creeps in another area wich had the same trigger and worked perfectly...
so the undead creeps didn't decay and the other ones did.. so i changed it to Does decay and it works :]
Any way what does decay mean?
06-29-2009, 03:19 PM#4
Anitarf
It means that the unit leaves a corpse behind, which then decays (disappears over time). If a unit doesn't leave a corpse behind, then it is removed from memory the moment it dies (it is also removed if it is killed by an artillery attack, which is hardcoded to explode the unit, thus leaving no corpse behind), otherwise it is removed when the corpse finishes decaying.