function WGC_Check takes real val returns boolean
return val == 0. or val == 16. or val == 32.
endfunction
function Trig_WayGateCheck_Actions takes nothing returns nothing
set udg_WGC_UsedWayGate = WGC_Check(RAbsBJ(GetRectCenterX(udg_WGC_Rect) - GetUnitX(GetTriggerUnit()))) and /*
*/ WGC_Check(RAbsBJ(GetRectCenterY(udg_WGC_Rect) - GetUnitY(GetTriggerUnit())))
endfunction
//===========================================================================
function InitTrig_WayGateCheck takes nothing returns nothing
set gg_trg_WayGateCheck = CreateTrigger( )
call TriggerAddAction( gg_trg_WayGateCheck, function Trig_WayGateCheck_Actions )
endfunction
Each waygate has a region around it, what is normally the case because you want to move in both directions.
Then you check if the unit left the region the gate is standing in and check if the unit is in the region the waygate teleports to if so you move the camera. if the unit is not in the other region then it just moved out by walking and don't has to be tracked.
like thisThe issue with my way is that you have to create for each direction one trigger, by a map with may waygates that could be a bit cluttered.
WaygateCamera01
Events
Unit - A unit leaves Waygate 01 <gen>
Conditions
(Waygate 02 <gen> contains (Triggering unit)) Equal to True
Actions
Set TempPoint = (Position of (Triggering unit))
Camera - Pan camera for (Owner of (Triggering unit)) to TempPoint over 2.00 seconds
Custom script: call RemoveLocation(udg_TempPoint)
No it can leave with a portal too, although it would be better if i could make a trigger that made the character return to base after every enemy / player 12 units had died in a specific region. and then the camera would change over to your character again.When leave what region? Is it considered the unit can leave the waygate region also normally, without using the teleport?