HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Expirated Unit Still Exists ??

10-04-2006, 09:34 PM#1
[VDM]Amn
Easy:
The spell uses the default ability Inferno to create a portal.

The following trigger replaces the summoned portal with a real one. (i need it not to have the summoned classification)
And creates another portal (portal destination) near the caster.

But somehow the old portals are still there and they are picked by the trigger every time it runs.

(I know some actions leaks, but first it has to work)

Trigger:
Portal
Collapse Events
Unit - A unit Finishes casting an ability
Collapse Conditions
(Ability being cast) Equal to Portal [O'nan]
Collapse Actions
Unit - Create 1 Way Gate for (Triggering player) at ((Position of (Triggering unit)) offset by 450.00 towards (Facing of (Triggering unit)) degrees) facing (Facing of (Triggering unit)) degrees
Set TempUnit01[(Player number of (Triggering player))] = (Last created unit)
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Collapse Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Unit-type of (Matching unit)) Equal to Way Gate) and ((Matching unit) Not equal to (Last created unit)))) and do (Actions)
Collapse Loop - Actions
Unit - Replace (Picked unit) with a Way Gate using The new unit's default life and mana
Set TempUnit02[(Player number of (Triggering player))] = (Last replaced unit)
Unit - Add a 5.00 second Generic expiration timer to (Last replaced unit)
Neutral Building - Set TempUnit01[(Player number of (Triggering player))] destination to (Position of TempUnit02[(Player number of (Triggering player))])
Neutral Building - Set TempUnit02[(Player number of (Triggering player))] destination to (Position of TempUnit01[(Player number of (Triggering player))])
Neutral Building - Enable TempUnit01[(Player number of (Triggering player))]
Neutral Building - Enable TempUnit02[(Player number of (Triggering player))]

any idea how to make it work?

Edited by Blade.dk. Reason: Replaced code tags with trigger tags.
10-04-2006, 09:58 PM#2
Blade.dk
Please use trigger tags for trigger code, makes it a lot easier to look at the code ;).
10-04-2006, 10:39 PM#3
Vexorian
check if picked unit is not dead before doing anything else?
10-04-2006, 11:59 PM#4
The_AwaKening
This line is a problem
Trigger:
Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Unit-type of (Matching unit)) Equal to Way Gate) and ((Matching unit) Not equal to (Last created unit)))) and do (Actions)

should be

Trigger:
Unit Group - Pick every unit in (Units owned by (Owning player(Triggering unit)) matching (((Unit-type of (Matching unit)) Equal to Way Gate) and ((Matching unit) Not equal to (Last created unit)))) and do (Actions)

See the difference? Owning player(trigger unit) rather than trigger player. In fact, you have this problem in the whole trigger. Replace all the Trigger Player code.
10-05-2006, 12:39 AM#5
[VDM]Amn
Quote:
Originally Posted by The_AwaKening
See the difference? Owning player(trigger unit) rather than trigger player. In fact, you have this problem in the whole trigger. Replace all the Trigger Player code.
Nope. it works.
btw thank you Blade.Dk

As Vexorian said should work, but those portals must be removed. That's what i need; a jass custom script to remove those units. They may leak later.