Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Hey i'm making a map where there's a lot of portals, and i like to make it more user friendly by every time you enter a portal the camera follows who ever enter the portal. thanks in advance
first set a camera in the location you want, you can put them in world map the same way you put regions, then in triggers, in actions go to camera options, the first one should be apply camera object, choose the camera you want and maybe change player 1 to owner of unit when they trigger the entering portal.
Sadly I'm not aware of there are native events to catch waygate teleporting. If you want a very proper method, one would need to code the waygates mechanics from scratch.
But we can make an attempt to cover most common cases for default waygates, with some naive checks. We can catch when a unit enters the goal_region, and then we can make some checks if the unit has same coordinates it would have had after it used the waygate, or not. If it has wanted coordinates we just expect that the entered unit really used the waygate, else not.
Have a look:
Demo:
Enter Copy
Events
Unit - A unit enters Region 000 <gen>
Conditions
Actions
-------- Define the Rect --------
Set WGC_Rect = Region 000 <gen>
-------- ----------------- --------
-------- Run the WayGateCheck --------
Trigger - Run WayGateCheck <gen> (ignoring conditions)
-------- ----------------- --------
-------- Check the UsedWayGate boolean --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WGC_UsedWayGate Equal to True
Then - Actions
Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.00 seconds
Else - Actions
Check:
JASS:
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
Why not make a unit leave region event
Check if unit is in your waygateGoalRegion if true get owning player and move its camera to position of triggering unit?
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 this
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)
The 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.
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 this
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)
The 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.
Thanks for the answers, yeah i use alot of waygates so im not sure if i should set my mind into your idea or IcemanBo. Im dont really understand how to set up scripts. But i think i try, i let you guys know if it worked. ^^ Thanks again!
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.