Doom-Angel
Jass User (Just started using NewGen)
- Reaction score
- 167
is there anyway to transfer locals beetwen functions without using global variables?
function ForceActions takes location point2 returns nothing
call CreateFogModifierRadiusLocBJ(true,GetEnumPlayer(),ConvertFogState(4),point2,500)
call PanCameraToTimedLocForPlayer(GetEnumPlayer(),point2,0.80)
endfunction
call ForForce(GetPlayersAll(),function ForceActions(point2[A])
that should explain:What are you trying to do?
but i relized i only need the point itself in the end so i just need a way to transfer it throught this ForForcelook i simply use a ForForce inside a loop now i need to enter to the function which contain the player's actions to simply take the loop integer and a point with array (the array is uses the integer i need)
isn't there anyway to take them and return an action?
function Bla_ForceActions takes nothing returns nothing
local location loc = udg_TempLoc
...
call RemoveLocation(loc)
set loc = null
endfunction
function Bla takes nothing returns nothing
local force f = CreateForce()
set udg_TempLoc = *SomeLoc*
call ForForce(f,function Bla_ForceActions)
call ForceClear(f)
call DestroyForce(f)
set f = null
endfunction
loop
exitwhen (A > End)
call CreateDestructableLoc('OTsp',point2[A],facing[A],0.80,0)
set d = GetLastCreatedDestructable()
call CreateUnitAtLoc(Player(14),'nstw',point2[A],facing[A])
set udg_Dinosaur[A] = GetLastCreatedUnit()
call SetUnitPathing(udg_Dinosaur[A],false)
call SetUnitAcquireRange( udg_Dinosaur[A],0)
set point3[A] = PolarProjectionBJ(point2[A],250,AngleBetweenPoints(point2[A],point))
set udg_Temp_Point = point2[A]
call ForForce(GetPlayersAll(),function ForceActions)
// Being skipped for some reason from this point....
call IssuePointOrderLoc( udg_Dinosaur[A], "move", point3[A] )
call TriggerSleepAction(0.8)
call KillDestructable(d)
call SetUnitTimeScale(udg_Dinosaur[A],0)
call PauseUnit(udg_Dinosaur[A],true)
call DestroyFogModifier(GetLastCreatedFogModifier())
set A = A+1
endloop
function ForceActions takes nothing returns nothing
local location point2 = udg_Temp_Point
call CreateFogModifierRadiusLocBJ(true,GetEnumPlayer(),ConvertFogState(4),point2,500)
call PanCameraToTimedLocForPlayer(GetEnumPlayer(),point2,0.80)
call RemoveLocation(udg_Temp_Point)
call RemoveLocation(point2)
set point2 = null
endfunction