HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Transferring handles between functions

03-14-2007, 08:35 PM#1
substance
So I'm trying to get a triggering unit from one function and use it in another. Now doing this using a timer is easy, but what if there is no timer? I am using infrane's particle system and vex's handle vars. Here's what I got :

Collapse JASS:
function Trig_EMP_Actions takes nothing returns nothing
local location casterpos = GetUnitLoc(GetTriggerUnit())
local location topos = GetSpellTargetLoc()
local unit caster = GetTriggerUnit() 
CreateParticle(GetOwningPlayer(GetSpellAbilityUnit()),'e00I',GetLocationX(casterpos),GetLocationY(casterpos),GetUnitFacing(GetSpellAbilityUnit()))

call ParticleSetSpeed(u,GetLocationX(topos)-GetLocationX(casterpos),GetLocationY(topos)-GetLocationY(casterpos),1200)
call ParticleLinkConditionTrigger2Func(u, ParticleGroundHit(), "GroundHit_Bounce")
call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "[u]Death_RemoveEMPBoom[/u]")
call ParticleAddForce(u, G())

call RemoveLocation(casterpos)
call RemoveLocation(topos)
set casterpos=null
set topos=null
set u = null
endfunction

Now I need to take 'caster' and use it in the 'Death_RemoveEMPBoom' function.
(yes, i know you can use globals, but im trying to stay away from'em)
03-15-2007, 04:26 PM#2
The)TideHunter(
Well, does the partical function return anything? a effect? a unit? a integer?
If it does, use that as your index for saving values with gamecache.
03-15-2007, 05:24 PM#3
Vexorian
Pass it as an argument?