HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Please Help

05-21-2007, 06:58 PM#1
Pinzu
Quote:
This trigger is perfectly clear, there seem to be no problem.

There is no problem, when i run it the first time. But when i run the trigger again it dosnt work! i tested it some times, and I still don't know whats wrong with it, so please help!

Trigger:
Send Creep
Collapse Events
Unit - A unit Sells a unit
Conditions
Collapse Actions
Custom script: local location SpawnP
Custom script: local unit UnitS
Collapse For each (Integer A) from 1 to 10, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Triggering unit)) Equal to (Player((Integer A)))
Collapse Then - Actions
Custom script: set UnitS = GetSoldUnit()
Custom script: set SpawnP = udg_Spawn[GetForLoopIndexA()]
Custom script: call AddSpecialEffectLocBJ(SpawnP, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
Custom script: call DestroyEffectBJ( GetLastCreatedEffectBJ() )
Custom script: call SetUnitPositionLoc( UnitS, SpawnP )
Custom script: call RemoveLocation(SpawnP)
Custom script: set UnitS = null
Collapse Else - Actions
Do nothing
[



05-21-2007, 07:04 PM#2
blu_da_noob
In future you can use [ trigger ] tags to make it easier to read.

Remove this line:
Custom script: call RemoveLocation(SpawnP)
05-21-2007, 07:06 PM#3
Pinzu
Won't it leak then?
05-21-2007, 07:13 PM#4
Fireeye
no it won't because you set the local location equal to an existing, so there won't be created a new location, which would leak.
05-21-2007, 07:15 PM#5
Pinzu
Thx Fireeye and Blu da noob, it works perfect now,

Do i have to null the unit?

Quote:
In future you can just edit your posts instead of double posting.

Sorry for being a nub.. I've read that peace of information now...
05-21-2007, 07:39 PM#6
Thunder_Eye
Nulling is fine, just dont destroy/remove/kill it when it's pointing to a global.
You should move it to the bottom of the trigger though (after the loop).
05-21-2007, 07:41 PM#7
blu_da_noob
In future you can just edit your posts instead of double posting.

And you do need to null the unit variable. And the location too at that.