• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Third Person Movement + Camera 1.03

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
A simple system I made that puts you deep into the action of WC3.
Control the movement of a unit with the arrow keys and enjoy the third-person camera.

Changelog:
1.01:
Fixed the problem with MPI.
Improved Camera. Height now changes with terrain, and turning is smoother.
Changed Down arrow to be backwards movement instead of 180 degree turn.

1.02:
Improved camera further. Now height is only messy at extreme altitudes.
Camera now adjusts Angle of Attack to match terrain.
Some support for walk animations with different Animation Integers.

1.03:
Improved movement triggers. Added pathing check to remove buggy movement.
Improved Camera height adjustment.
Added customizability to speeds (movement forward and backward, turning rate).
Improved user-friendliness and made it easier to import.

Keywords:
camera, movement, arrow keys, third person,
Contents

Third Person Test (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 23:25, 24th Nov 2013 Maker: You have improved the system but it still has flaws. I can get the unit to move forward and backwards without the walk animation playing. Running on...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

23:25, 24th Nov 2013
Maker: You have improved the system but it still has flaws.
I can get the unit to move forward and backwards without the walk
animation playing. Running on destructables and cliffs causes the unit
to bounce here and there.
The unit disappears from the camera on lowered ground
 
Level 7
Joined
May 11, 2010
Messages
278
Additional in-game screenshots.

Triggers:
  • Actions to Apply
    • Events
    • Conditions
    • Actions
      • Set MovUnitOfPlayer[1] = No unit
      • -------- Set the unit each player will control. --------
      • Set MovAnimationOfPlayer[1] = 0
      • -------- Set the integer at which the units Walk animation is. --------
      • -------- Footman's walk animation is at 6 for example. --------
  • MovSettings
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- --------
      • Set MovUniqueSpeeds = False
      • -------- Set this to true if you want each player to have different movement speeds. --------
      • -------- If this is set to true, you will have to set MovForwardSpeed, MovBackSpeed and MovTurnSpeed for all individual players in this trigger. --------
      • -------- --------
      • Set MovForwardSpeed[1] = 3.00
      • -------- Speed moving forward --------
      • -------- --------
      • Set MovBackSpeed[1] = 1.50
      • -------- Speed moving back --------
      • -------- --------
      • Set MovTurnSpeed[1] = 5.00
      • -------- Rate of turning left/right --------
      • -------- --------
      • Trigger - Run MovInitialization <gen> (ignoring conditions)
      • -------- Don't change this! --------
  • MovInitialization
    • Events
    • Conditions
    • Actions
      • Set MovActivePlayers = (All players matching (((Matching player) slot status) Equal to Is playing))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MovUniqueSpeeds Equal to False
        • Then - Actions
          • Player Group - Pick every player in MovActivePlayers and do (Actions)
            • Loop - Actions
              • Set MovInt = (Player number of (Picked player))
              • Set MovForwardSpeed[MovInt] = MovForwardSpeed[1]
              • Set MovBackSpeed[MovInt] = MovBackSpeed[1]
              • Set MovTurnSpeed[MovInt] = MovTurnSpeed[1]
        • Else - Actions
      • Player Group - Pick every player in MovActivePlayers and do (Actions)
        • Loop - Actions
          • Trigger - Add to MovForward <gen> the event (Player - (Picked player) Presses the Up Arrow key)
          • Trigger - Add to MovForward Stop <gen> the event (Player - (Picked player) Releases the Up Arrow key)
          • Trigger - Add to MovBack <gen> the event (Player - (Picked player) Presses the Down Arrow key)
          • Trigger - Add to MovBack Stop <gen> the event (Player - (Picked player) Releases the Down Arrow key)
          • Trigger - Add to MovLeft <gen> the event (Player - (Picked player) Presses the Left Arrow key)
          • Trigger - Add to MovLeft Stop <gen> the event (Player - (Picked player) Releases the Left Arrow key)
          • Trigger - Add to MovRight <gen> the event (Player - (Picked player) Presses the Right Arrow key)
          • Trigger - Add to MovRight Stop <gen> the event (Player - (Picked player) Releases the Right Arrow key)
  • MovForward
    • Events
    • Conditions
      • MovBack[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set MovInt = (Player number of (Triggering player))
      • Set MovInt2 = MovAnimationOfPlayer[MovInt]
      • Set MovUnit = MovUnitOfPlayer[MovInt]
      • Set MovForward[MovInt] = True
      • Custom script: call SetUnitAnimationByIndex(udg_MovUnit, udg_MovInt2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (MovUnit is in MovGroup) Equal to False
        • Then - Actions
          • Unit Group - Add MovUnit to MovGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MovLoop <gen> is on) Equal to False
            • Then - Actions
              • Trigger - Turn on MovLoop <gen>
            • Else - Actions
        • Else - Actions
  • MovForward Stop
    • Events
    • Conditions
      • MovBack[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set MovInt = (Player number of (Triggering player))
      • Set MovUnit = MovUnitOfPlayer[MovInt]
      • Set MovForward[MovInt] = False
      • Unit - Order MovUnit to Stop
      • Animation - Reset MovUnit's animation
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MovForward[MovInt] Equal to False
          • MovLeft[MovInt] Equal to False
          • MovRight[MovInt] Equal to False
          • MovBack[MovInt] Equal to False
        • Then - Actions
          • Unit Group - Remove MovUnit from MovGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in MovGroup) Equal to 0
            • Then - Actions
              • Trigger - Turn off MovLoop <gen>
            • Else - Actions
        • Else - Actions
  • MovLeft
    • Events
    • Conditions
      • MovRight[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set MovInt = (Player number of (Triggering player))
      • Set MovUnit = MovUnitOfPlayer[MovInt]
      • Set MovLeft[MovInt] = True
      • Unit - Make MovUnit face ((Facing of MovUnit) + 5.00) over 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (MovUnit is in MovGroup) Equal to False
        • Then - Actions
          • Unit Group - Add MovUnit to MovGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MovLoop <gen> is on) Equal to False
            • Then - Actions
              • Trigger - Turn on MovLoop <gen>
            • Else - Actions
        • Else - Actions
  • MovLeft Stop
    • Events
    • Conditions
      • MovRight[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set MovInt = (Player number of (Triggering player))
      • Set MovUnit = MovUnitOfPlayer[MovInt]
      • Set MovLeft[MovInt] = False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MovForward[MovInt] Equal to False
          • MovLeft[MovInt] Equal to False
          • MovRight[MovInt] Equal to False
          • MovBack[MovInt] Equal to False
        • Then - Actions
          • Unit Group - Remove MovUnit from MovGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in MovGroup) Equal to 0
            • Then - Actions
              • Trigger - Turn off MovLoop <gen>
            • Else - Actions
        • Else - Actions
  • MovRight
    • Events
    • Conditions
      • MovLeft[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set MovInt = (Player number of (Triggering player))
      • Set MovUnit = MovUnitOfPlayer[MovInt]
      • Set MovRight[MovInt] = True
      • Unit - Make MovUnit face ((Facing of MovUnit) - 5.00) over 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (MovUnit is in MovGroup) Equal to False
        • Then - Actions
          • Unit Group - Add MovUnit to MovGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MovLoop <gen> is on) Equal to False
            • Then - Actions
              • Trigger - Turn on MovLoop <gen>
            • Else - Actions
        • Else - Actions
  • MovRight Stop
    • Events
    • Conditions
      • MovLeft[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set MovInt = (Player number of (Triggering player))
      • Set MovUnit = MovUnitOfPlayer[MovInt]
      • Set MovRight[MovInt] = False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MovForward[MovInt] Equal to False
          • MovLeft[MovInt] Equal to False
          • MovRight[MovInt] Equal to False
          • MovBack[MovInt] Equal to False
        • Then - Actions
          • Unit Group - Remove MovUnit from MovGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in MovGroup) Equal to 0
            • Then - Actions
              • Trigger - Turn off MovLoop <gen>
            • Else - Actions
        • Else - Actions
  • MovBack
    • Events
    • Conditions
      • MovForward[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set MovInt = (Player number of (Triggering player))
      • Set MovInt2 = MovAnimationOfPlayer[MovInt]
      • Set MovUnit = MovUnitOfPlayer[MovInt]
      • Set MovBack[MovInt] = True
      • Custom script: call SetUnitTimeScale(udg_MovUnit, -1.00)
      • Custom script: call SetUnitAnimationByIndex(udg_MovUnit, udg_MovInt2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (MovUnit is in MovGroup) Equal to False
        • Then - Actions
          • Unit Group - Add MovUnit to MovGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MovLoop <gen> is on) Equal to False
            • Then - Actions
              • Trigger - Turn on MovLoop <gen>
            • Else - Actions
        • Else - Actions
  • MovBack Stop
    • Events
    • Conditions
      • MovForward[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set MovInt = (Player number of (Triggering player))
      • Set MovUnit = MovUnitOfPlayer[MovInt]
      • Set MovBack[MovInt] = False
      • Custom script: call SetUnitTimeScale(udg_MovUnit, 1.00)
      • Unit - Order MovUnit to Stop
      • Animation - Reset MovUnit's animation
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MovForward[MovInt] Equal to False
          • MovLeft[MovInt] Equal to False
          • MovRight[MovInt] Equal to False
          • MovBack[MovInt] Equal to False
        • Then - Actions
          • Unit Group - Remove MovUnit from MovGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in MovGroup) Equal to 0
            • Then - Actions
              • Trigger - Turn off MovLoop <gen>
            • Else - Actions
        • Else - Actions
  • MovLoop
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in MovGroup and do (Actions)
        • Loop - Actions
          • Set MovInt = (Player number of (Owner of (Picked unit)))
          • Set MovUnit = (Picked unit)
          • Set MovPoint = (Position of MovUnit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MovForward[MovInt] Equal to True
            • Then - Actions
              • Set MovPoint2 = (MovPoint offset by MovForwardSpeed[MovInt] towards (Facing of MovUnit) degrees)
              • Set CP_Point = (MovPoint offset by 50.00 towards (Facing of MovUnit) degrees)
              • Trigger - Run Check Walkability <gen> (ignoring conditions)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CP_PointIsWalkable Equal to True
                • Then - Actions
                  • Unit - Move MovUnit instantly to MovPoint2
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MovBack[MovInt] Equal to True
            • Then - Actions
              • Set MovPoint2 = (MovPoint offset by MovBackSpeed[MovInt] towards ((Facing of MovUnit) + 180.00) degrees)
              • Set CP_Point = (MovPoint offset by 50.00 towards ((Facing of MovUnit) + 180.00) degrees)
              • Trigger - Run Check Walkability <gen> (ignoring conditions)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CP_PointIsWalkable Equal to True
                • Then - Actions
                  • Unit - Move MovUnit instantly to MovPoint2
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MovLeft[MovInt] Equal to True
            • Then - Actions
              • Unit - Make MovUnit face ((Facing of MovUnit) + MovTurnSpeed[MovInt]) over 0.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MovRight[MovInt] Equal to True
            • Then - Actions
              • Unit - Make MovUnit face ((Facing of MovUnit) - MovTurnSpeed[MovInt]) over 0.00 seconds
            • Else - Actions
          • Custom script: call RemoveLocation(udg_MovPoint)
          • Custom script: call RemoveLocation(udg_MovPoint2)
  • MovCamera
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in MovActivePlayers and do (Actions)
        • Loop - Actions
          • Set MovInt = (Player number of (Picked player))
          • Set MovUnit = MovUnitOfPlayer[MovInt]
          • Set MovPoint = (Position of MovUnit)
          • Custom script: set udg_MovReal=GetLocationZ(udg_MovPoint)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MovReal Less than 0.00
            • Then - Actions
              • Camera - Set (Picked player)'s camera Height Offset to ((MovReal x 0.15) + 100.00) over 0.10 seconds
            • Else - Actions
              • Camera - Set (Picked player)'s camera Height Offset to ((MovReal x 0.55) + 100.00) over 0.10 seconds
          • Camera - Lock camera target for (Picked player) to MovUnit, offset by (0.00, 0.00) using Default rotation
          • Camera - Set (Picked player)'s camera Distance to target to 600.00 over 0.10 seconds
          • Camera - Set (Picked player)'s camera Rotation to (Facing of MovUnit) over 0.10 seconds
          • Custom script: call RemoveLocation(udg_MovPoint)
  • MovCamAngle
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in MovActivePlayers and do (Actions)
        • Loop - Actions
          • Set MovUnit = MovUnitOfPlayer[(Player number of (Picked player))]
          • Set MovPoint = (Position of MovUnit)
          • Set MovPoint2 = (MovPoint offset by 100.00 towards (Facing of MovUnit) degrees)
          • Set MovAngle[1] = (Distance between MovPoint and MovPoint2)
          • Custom script: set udg_MovReal=GetLocationZ(udg_MovPoint)
          • Set MovAngle[2] = MovReal
          • Custom script: set udg_MovReal=GetLocationZ(udg_MovPoint2)
          • Set MovAngle[3] = MovReal
          • Set MovAngle[4] = (Atan(((MovAngle[3] - MovAngle[2]) / MovAngle[1])))
          • Camera - Set (Picked player)'s camera Angle of attack to (340.00 + (MovAngle[4] x 0.50)) over 0.10 seconds
          • Custom script: call RemoveLocation(udg_MovPoint)
          • Custom script: call RemoveLocation(udg_MovPoint2)
I use Check Walkability by PurgeandFire

  • Check Walkability Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set CP_Rect = (Region(0.00, 0.00, 128.00, 128.00))
      • Custom script: set udg_CP_Item = CreateItem('wtlg', 0, 0)
      • Item - Hide CP_Item
      • -------- Variables For Copy and Paste --------
      • Set CP_HiddenItemsIndex = 0
      • Set CP_HiddenItems[0] = No item
      • Set CP_Point = (Target point of ability being cast)
      • Set CP_PointIsWalkable = False
  • Check Walkability
    • Events
    • Conditions
    • Actions
      • Custom script: local real x = GetLocationX(udg_CP_Point)
      • Custom script: local real y = GetLocationY(udg_CP_Point)
      • Custom script: local real x2 = 0
      • Custom script: local real y2 = 0
      • Custom script: call MoveRectTo(udg_CP_Rect, x, y)
      • Item - Pick every item in CP_Rect and do (Actions)
        • Loop - Actions
          • Custom script: if IsItemVisible(GetEnumItem()) then
          • Set CP_HiddenItems[CP_HiddenItemsIndex] = (Picked item)
          • Custom script: call SetItemVisible(udg_CP_HiddenItems[udg_CP_HiddenItemsIndex], false)
          • Set CP_HiddenItemsIndex = (CP_HiddenItemsIndex + 1)
          • Custom script: endif
      • Custom script: call SetItemPosition(udg_CP_Item, x, y)
      • Custom script: set x2 = GetItemX(udg_CP_Item)
      • Custom script: set y2 = GetItemY(udg_CP_Item)
      • Custom script: call SetItemVisible(udg_CP_Item, false)
      • Custom script: loop
      • Custom script: exitwhen udg_CP_HiddenItemsIndex <= 0
      • Custom script: set udg_CP_HiddenItemsIndex = udg_CP_HiddenItemsIndex - 1
      • Custom script: call SetItemVisible(udg_CP_HiddenItems[udg_CP_HiddenItemsIndex], true)
      • Custom script: set udg_CP_HiddenItems[udg_CP_HiddenItemsIndex] = null
      • Custom script: endloop
      • Custom script: set udg_CP_PointIsWalkable = ((x2-x)*(x2-x) + (y2-y)*(y2-y) <= 100) and (not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY))
 

Attachments

  • WC3 Third Person Mod 1.jpg
    WC3 Third Person Mod 1.jpg
    1.1 MB · Views: 360
  • WC3 Third Person Mod 2.jpg
    WC3 Third Person Mod 2.jpg
    1.1 MB · Views: 282
  • WC3 Third Person Mod 3.jpg
    WC3 Third Person Mod 3.jpg
    651.4 KB · Views: 206
Last edited:
You use 'TmpInt' in loops for max player number, but if one slot is unused, last player would not get looped. So better loop from 1-12 and then you can make a check.

You forgot about Z-coordinate when you set your cam-height. At the moment you set it to a constant value. If you would like to pass a hilly area for example the cam would stay at it's height.
Also you should add a periodic event at your camera trigger, because otherwise players are able to change the view.

When you often use 'picked unit' it's better to use tmpunit variable as refrerence.
_____________

@SecondHand, your link shows a good system.. but this one is GUI - but atm need some improvements for me. But gl :thumbs_up:
 
Level 7
Joined
May 11, 2010
Messages
278
Updates galore!
Fixed the problem with MPI.
Improved Camera. Height now changes with terrain, and turning is smoother.
Changed Down arrow to be backwards movement instead of 180 degree turn.

The height now changes with terrain, but it is still problematic. At high altitudes it changes too much, causing the unit to dissapear from the field of view.
How to fix?

Triggers, ho!:

  • Initialization
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set ActivePlayers = (All players matching (((Matching player) slot status) Equal to Is playing))
      • Set TempPoint = (Random point in Region 000 <gen>)
      • Player Group - Pick every player in ActivePlayers and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for (Picked player) at TempPoint facing Default building facing degrees
          • Set UnitOfPlayer[(Player number of (Picked player))] = (Last created unit)
  • Camera Update
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in ActivePlayers and do (Actions)
        • Loop - Actions
          • Set TempInt = (Player number of (Picked player))
          • Set TempUnit = UnitOfPlayer[TempInt]
          • Set TempPoint = (Position of TempUnit)
          • Custom script: set udg_TempReal=GetLocationZ(udg_TempPoint)
          • Camera - Lock camera target for (Picked player) to TempUnit, offset by (0.00, 0.00) using Default rotation
          • Camera - Set (Picked player)'s camera Angle of attack to 345.00 over 0.10 seconds
          • Camera - Set (Picked player)'s camera Distance to target to 600.00 over 0.10 seconds
          • Camera - Set (Picked player)'s camera Height Offset to (TempReal + 100.00) over 0.10 seconds
          • Camera - Set (Picked player)'s camera Rotation to (Facing of TempUnit) over 0.10 seconds
          • Custom script: call RemoveLocation(udg_TempPoint)
That's it. That's the entire camera.




There are so many triggers.
  • Forward
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
      • Player - Player 2 (Blue) Presses the Up Arrow key
      • Player - Player 3 (Teal) Presses the Up Arrow key
      • Player - Player 4 (Purple) Presses the Up Arrow key
      • Player - Player 5 (Yellow) Presses the Up Arrow key
      • Player - Player 6 (Orange) Presses the Up Arrow key
      • Player - Player 7 (Green) Presses the Up Arrow key
      • Player - Player 8 (Pink) Presses the Up Arrow key
      • Player - Player 9 (Gray) Presses the Up Arrow key
      • Player - Player 10 (Light Blue) Presses the Up Arrow key
      • Player - Player 11 (Dark Green) Presses the Up Arrow key
      • Player - Player 12 (Brown) Presses the Up Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Custom script: call SetUnitAnimationByIndex(udg_TempUnit, 6)
      • Unit Group - Add TempUnit to GroupForward
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Forward Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Forward Loop <gen>
        • Else - Actions
  • Forward Loop
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GroupForward and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Set TempPoint = (Position of TempUnit)
          • Set TempPoint2 = (TempPoint offset by 3.00 towards (Facing of TempUnit) degrees)
          • Unit - Move TempUnit instantly to TempPoint2
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)
  • Forward Stop
    • Events
      • Player - Player 1 (Red) Releases the Up Arrow key
      • Player - Player 2 (Blue) Releases the Up Arrow key
      • Player - Player 3 (Teal) Releases the Up Arrow key
      • Player - Player 4 (Purple) Releases the Up Arrow key
      • Player - Player 5 (Yellow) Releases the Up Arrow key
      • Player - Player 6 (Orange) Releases the Up Arrow key
      • Player - Player 7 (Green) Releases the Up Arrow key
      • Player - Player 8 (Pink) Releases the Up Arrow key
      • Player - Player 9 (Gray) Releases the Up Arrow key
      • Player - Player 10 (Light Blue) Releases the Up Arrow key
      • Player - Player 11 (Dark Green) Releases the Up Arrow key
      • Player - Player 12 (Brown) Releases the Up Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Unit Group - Remove TempUnit from GroupForward
      • Unit - Order TempUnit to Stop
      • Animation - Reset TempUnit's animation
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in GroupForward) Equal to 0
        • Then - Actions
          • Trigger - Turn off Forward Loop <gen>
        • Else - Actions
  • Left
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
      • Player - Player 2 (Blue) Presses the Left Arrow key
      • Player - Player 3 (Teal) Presses the Left Arrow key
      • Player - Player 4 (Purple) Presses the Left Arrow key
      • Player - Player 5 (Yellow) Presses the Left Arrow key
      • Player - Player 6 (Orange) Presses the Left Arrow key
      • Player - Player 7 (Green) Presses the Left Arrow key
      • Player - Player 8 (Pink) Presses the Left Arrow key
      • Player - Player 9 (Gray) Presses the Left Arrow key
      • Player - Player 10 (Light Blue) Presses the Left Arrow key
      • Player - Player 11 (Dark Green) Presses the Left Arrow key
      • Player - Player 12 (Brown) Presses the Left Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Unit - Make TempUnit face ((Facing of TempUnit) + 5.00) over 0.00 seconds
      • Unit Group - Add TempUnit to GroupLeft
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Left Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Left Loop <gen>
        • Else - Actions
  • Left Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GroupLeft and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Unit - Make TempUnit face ((Facing of TempUnit) + 5.00) over 0.00 seconds
  • Left Stop
    • Events
      • Player - Player 1 (Red) Releases the Left Arrow key
      • Player - Player 2 (Blue) Releases the Left Arrow key
      • Player - Player 3 (Teal) Releases the Left Arrow key
      • Player - Player 4 (Purple) Releases the Left Arrow key
      • Player - Player 5 (Yellow) Releases the Left Arrow key
      • Player - Player 6 (Orange) Releases the Left Arrow key
      • Player - Player 7 (Green) Releases the Left Arrow key
      • Player - Player 8 (Pink) Releases the Left Arrow key
      • Player - Player 9 (Gray) Releases the Left Arrow key
      • Player - Player 10 (Light Blue) Releases the Left Arrow key
      • Player - Player 11 (Dark Green) Releases the Left Arrow key
      • Player - Player 12 (Brown) Releases the Left Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Unit Group - Remove TempUnit from GroupLeft
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in GroupLeft) Equal to 0
        • Then - Actions
          • Trigger - Turn off Left Loop <gen>
        • Else - Actions
  • Right
    • Events
      • Player - Player 1 (Red) Presses the Right Arrow key
      • Player - Player 2 (Blue) Presses the Right Arrow key
      • Player - Player 3 (Teal) Presses the Right Arrow key
      • Player - Player 4 (Purple) Presses the Right Arrow key
      • Player - Player 5 (Yellow) Presses the Right Arrow key
      • Player - Player 6 (Orange) Presses the Right Arrow key
      • Player - Player 7 (Green) Presses the Right Arrow key
      • Player - Player 8 (Pink) Presses the Right Arrow key
      • Player - Player 9 (Gray) Presses the Right Arrow key
      • Player - Player 10 (Light Blue) Presses the Right Arrow key
      • Player - Player 11 (Dark Green) Presses the Right Arrow key
      • Player - Player 12 (Brown) Presses the Right Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Unit - Make TempUnit face ((Facing of TempUnit) - 5.00) over 0.00 seconds
      • Unit Group - Add TempUnit to GroupRight
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Right Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Right Loop <gen>
        • Else - Actions
  • Right Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GroupRight and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Unit - Make TempUnit face ((Facing of TempUnit) - 5.00) over 0.00 seconds
  • Right Stop
    • Events
      • Player - Player 1 (Red) Releases the Right Arrow key
      • Player - Player 2 (Blue) Releases the Right Arrow key
      • Player - Player 3 (Teal) Releases the Right Arrow key
      • Player - Player 4 (Purple) Releases the Right Arrow key
      • Player - Player 5 (Yellow) Releases the Right Arrow key
      • Player - Player 6 (Orange) Releases the Right Arrow key
      • Player - Player 7 (Green) Releases the Right Arrow key
      • Player - Player 8 (Pink) Releases the Right Arrow key
      • Player - Player 9 (Gray) Releases the Right Arrow key
      • Player - Player 10 (Light Blue) Releases the Right Arrow key
      • Player - Player 11 (Dark Green) Releases the Right Arrow key
      • Player - Player 12 (Brown) Releases the Right Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Unit Group - Remove TempUnit from GroupRight
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in GroupRight) Equal to 0
        • Then - Actions
          • Trigger - Turn off Right Loop <gen>
        • Else - Actions
  • Back
    • Events
      • Player - Player 1 (Red) Presses the Down Arrow key
      • Player - Player 2 (Blue) Presses the Down Arrow key
      • Player - Player 3 (Teal) Presses the Down Arrow key
      • Player - Player 4 (Purple) Presses the Down Arrow key
      • Player - Player 5 (Yellow) Presses the Down Arrow key
      • Player - Player 6 (Orange) Presses the Down Arrow key
      • Player - Player 7 (Green) Presses the Down Arrow key
      • Player - Player 8 (Pink) Presses the Down Arrow key
      • Player - Player 9 (Gray) Presses the Down Arrow key
      • Player - Player 10 (Light Blue) Presses the Down Arrow key
      • Player - Player 11 (Dark Green) Presses the Down Arrow key
      • Player - Player 12 (Brown) Presses the Down Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Custom script: call SetUnitTimeScale(udg_TempUnit, -1.00)
      • Custom script: call SetUnitAnimationByIndex(udg_TempUnit, 6)
      • Unit Group - Add TempUnit to GroupBack
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Back Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Back Loop <gen>
        • Else - Actions
  • Back Loop
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GroupBack and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Set TempPoint = (Position of TempUnit)
          • Set TempPoint2 = (TempPoint offset by 1.50 towards ((Facing of TempUnit) + 180.00) degrees)
          • Unit - Move TempUnit instantly to TempPoint2
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)
  • Back Stop
    • Events
      • Player - Player 1 (Red) Releases the Down Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Custom script: call SetUnitTimeScale(udg_TempUnit, 1.00)
      • Unit Group - Remove TempUnit from GroupBack
      • Unit - Order TempUnit to Stop
      • Animation - Reset TempUnit's animation
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in GroupBack) Equal to 0
        • Then - Actions
          • Trigger - Turn off Back Loop <gen>
        • Else - Actions
 
Last edited:
Level 7
Joined
May 11, 2010
Messages
278
Something like this?

  • Initialization
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set ActivePlayers = (All players matching (((Matching player) slot status) Equal to Is playing))
      • Set TempPoint = (Random point in Region 000 <gen>)
      • Player Group - Pick every player in ActivePlayers and do (Actions)
        • Loop - Actions
          • Set TempInt = (Player number of (Picked player))
          • Unit - Create 1 Footman for (Picked player) at TempPoint facing Default building facing degrees
          • Unit - Create 1 Demon Hunter for (Picked player) at TempPoint facing Default building facing degrees
          • Set UnitOfPlayer[TempInt] = (Last created unit)
          • Set TempUnit = (Last created unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of TempUnit) Equal to Footman
            • Then - Actions
              • Set AnimationOfPlayer[TempInt] = 6
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of TempUnit) Equal to Demon Hunter
            • Then - Actions
              • Set AnimationOfPlayer[TempInt] = 8
            • Else - Actions
And of course, change in the movement triggers:
  • Actions
    • Set TempInt = (Player number of (Triggering player))
    • Set TempUnit = UnitOfPlayer[TempInt]
    • Set TempInt2 = AnimationOfPlayer[TempInt]
    • Custom script: call SetUnitAnimationByIndex(udg_TempUnit, udg_TempInt2)
What about the camera?

EDIT:
New update, new triggers:
Somewhat local to the test map. Will improve this to make it easier to import.
  • Initialization
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set ActivePlayers = (All players matching (((Matching player) slot status) Equal to Is playing))
      • Set TempPoint = (Random point in Region 000 <gen>)
      • Player Group - Pick every player in ActivePlayers and do (Actions)
        • Loop - Actions
          • Set TempInt = (Player number of (Picked player))
          • Unit - Create 1 Footman for (Picked player) at TempPoint facing Default building facing degrees
          • Unit - Create 1 Demon Hunter for (Picked player) at TempPoint facing Default building facing degrees
          • Set UnitOfPlayer[TempInt] = (Last created unit)
          • Set TempUnit = (Last created unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of TempUnit) Equal to Footman
            • Then - Actions
              • Set AnimationOfPlayer[TempInt] = 6
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of TempUnit) Equal to Demon Hunter
            • Then - Actions
              • Set AnimationOfPlayer[TempInt] = 8
            • Else - Actions
  • Camera Update
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in ActivePlayers and do (Actions)
        • Loop - Actions
          • Set TempInt = (Player number of (Picked player))
          • Set TempUnit = UnitOfPlayer[TempInt]
          • Set TempPoint = (Position of TempUnit)
          • Custom script: set udg_TempReal=GetLocationZ(udg_TempPoint)
          • Camera - Lock camera target for (Picked player) to TempUnit, offset by (0.00, 0.00) using Default rotation
          • Camera - Set (Picked player)'s camera Angle of attack to 345.00 over 0.10 seconds
          • Camera - Set (Picked player)'s camera Distance to target to 600.00 over 0.10 seconds
          • Camera - Set (Picked player)'s camera Height Offset to (TempReal + 100.00) over 0.10 seconds
          • Camera - Set (Picked player)'s camera Rotation to (Facing of TempUnit) over 0.10 seconds
          • Custom script: call RemoveLocation(udg_TempPoint)
  • Camera Angle
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in ActivePlayers and do (Actions)
        • Loop - Actions
          • Set TempUnit = UnitOfPlayer[(Player number of (Picked player))]
          • Set TempPoint = (Position of TempUnit)
          • Set TempPoint2 = (TempPoint offset by 500.00 towards (Facing of TempUnit) degrees)
          • Set RealArray[1] = (Distance between TempPoint and TempPoint2)
          • Custom script: set udg_TempReal=GetLocationZ(udg_TempPoint)
          • Set RealArray[2] = TempReal
          • Custom script: set udg_TempReal=GetLocationZ(udg_TempPoint2)
          • Set RealArray[3] = TempReal
          • Set RealArray[4] = (Atan(((RealArray[3] - RealArray[2]) / RealArray[1])))
          • Camera - Set (Picked player)'s camera Angle of attack to (345.00 + (RealArray[4] x 0.50)) over 0.10 seconds
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)




There are so many triggers.
  • Forward
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
      • Player - Player 2 (Blue) Presses the Up Arrow key
      • Player - Player 3 (Teal) Presses the Up Arrow key
      • Player - Player 4 (Purple) Presses the Up Arrow key
      • Player - Player 5 (Yellow) Presses the Up Arrow key
      • Player - Player 6 (Orange) Presses the Up Arrow key
      • Player - Player 7 (Green) Presses the Up Arrow key
      • Player - Player 8 (Pink) Presses the Up Arrow key
      • Player - Player 9 (Gray) Presses the Up Arrow key
      • Player - Player 10 (Light Blue) Presses the Up Arrow key
      • Player - Player 11 (Dark Green) Presses the Up Arrow key
      • Player - Player 12 (Brown) Presses the Up Arrow key
    • Conditions
    • Actions
    • Set TempInt = (Player number of (Triggering player))
    • Set TempUnit = UnitOfPlayer[TempInt]
    • Set TempInt2 = AnimationOfPlayer[TempInt]
    • Custom script: call SetUnitAnimationByIndex(udg_TempUnit, udg_TempInt2)
    • Unit Group - Add TempUnit to GroupForward
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Forward Loop <gen> is on) Equal to False
      • Then - Actions
        • Trigger - Turn on Forward Loop <gen>
      • Else - Actions
  • Forward Loop
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GroupForward and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Set TempPoint = (Position of TempUnit)
          • Set TempPoint2 = (TempPoint offset by 3.00 towards (Facing of TempUnit) degrees)
          • Unit - Move TempUnit instantly to TempPoint2
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)
  • Forward Stop
    • Events
      • Player - Player 1 (Red) Releases the Up Arrow key
      • Player - Player 2 (Blue) Releases the Up Arrow key
      • Player - Player 3 (Teal) Releases the Up Arrow key
      • Player - Player 4 (Purple) Releases the Up Arrow key
      • Player - Player 5 (Yellow) Releases the Up Arrow key
      • Player - Player 6 (Orange) Releases the Up Arrow key
      • Player - Player 7 (Green) Releases the Up Arrow key
      • Player - Player 8 (Pink) Releases the Up Arrow key
      • Player - Player 9 (Gray) Releases the Up Arrow key
      • Player - Player 10 (Light Blue) Releases the Up Arrow key
      • Player - Player 11 (Dark Green) Releases the Up Arrow key
      • Player - Player 12 (Brown) Releases the Up Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Unit Group - Remove TempUnit from GroupForward
      • Unit - Order TempUnit to Stop
      • Animation - Reset TempUnit's animation
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in GroupForward) Equal to 0
        • Then - Actions
          • Trigger - Turn off Forward Loop <gen>
        • Else - Actions
  • Left
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
      • Player - Player 2 (Blue) Presses the Left Arrow key
      • Player - Player 3 (Teal) Presses the Left Arrow key
      • Player - Player 4 (Purple) Presses the Left Arrow key
      • Player - Player 5 (Yellow) Presses the Left Arrow key
      • Player - Player 6 (Orange) Presses the Left Arrow key
      • Player - Player 7 (Green) Presses the Left Arrow key
      • Player - Player 8 (Pink) Presses the Left Arrow key
      • Player - Player 9 (Gray) Presses the Left Arrow key
      • Player - Player 10 (Light Blue) Presses the Left Arrow key
      • Player - Player 11 (Dark Green) Presses the Left Arrow key
      • Player - Player 12 (Brown) Presses the Left Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Unit - Make TempUnit face ((Facing of TempUnit) + 5.00) over 0.00 seconds
      • Unit Group - Add TempUnit to GroupLeft
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Left Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Left Loop <gen>
        • Else - Actions
  • Left Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GroupLeft and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Unit - Make TempUnit face ((Facing of TempUnit) + 5.00) over 0.00 seconds
  • Left Stop
    • Events
      • Player - Player 1 (Red) Releases the Left Arrow key
      • Player - Player 2 (Blue) Releases the Left Arrow key
      • Player - Player 3 (Teal) Releases the Left Arrow key
      • Player - Player 4 (Purple) Releases the Left Arrow key
      • Player - Player 5 (Yellow) Releases the Left Arrow key
      • Player - Player 6 (Orange) Releases the Left Arrow key
      • Player - Player 7 (Green) Releases the Left Arrow key
      • Player - Player 8 (Pink) Releases the Left Arrow key
      • Player - Player 9 (Gray) Releases the Left Arrow key
      • Player - Player 10 (Light Blue) Releases the Left Arrow key
      • Player - Player 11 (Dark Green) Releases the Left Arrow key
      • Player - Player 12 (Brown) Releases the Left Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Unit Group - Remove TempUnit from GroupLeft
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in GroupLeft) Equal to 0
        • Then - Actions
          • Trigger - Turn off Left Loop <gen>
        • Else - Actions
  • Right
    • Events
      • Player - Player 1 (Red) Presses the Right Arrow key
      • Player - Player 2 (Blue) Presses the Right Arrow key
      • Player - Player 3 (Teal) Presses the Right Arrow key
      • Player - Player 4 (Purple) Presses the Right Arrow key
      • Player - Player 5 (Yellow) Presses the Right Arrow key
      • Player - Player 6 (Orange) Presses the Right Arrow key
      • Player - Player 7 (Green) Presses the Right Arrow key
      • Player - Player 8 (Pink) Presses the Right Arrow key
      • Player - Player 9 (Gray) Presses the Right Arrow key
      • Player - Player 10 (Light Blue) Presses the Right Arrow key
      • Player - Player 11 (Dark Green) Presses the Right Arrow key
      • Player - Player 12 (Brown) Presses the Right Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Unit - Make TempUnit face ((Facing of TempUnit) - 5.00) over 0.00 seconds
      • Unit Group - Add TempUnit to GroupRight
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Right Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Right Loop <gen>
        • Else - Actions
  • Right Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GroupRight and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Unit - Make TempUnit face ((Facing of TempUnit) - 5.00) over 0.00 seconds
  • Right Stop
    • Events
      • Player - Player 1 (Red) Releases the Right Arrow key
      • Player - Player 2 (Blue) Releases the Right Arrow key
      • Player - Player 3 (Teal) Releases the Right Arrow key
      • Player - Player 4 (Purple) Releases the Right Arrow key
      • Player - Player 5 (Yellow) Releases the Right Arrow key
      • Player - Player 6 (Orange) Releases the Right Arrow key
      • Player - Player 7 (Green) Releases the Right Arrow key
      • Player - Player 8 (Pink) Releases the Right Arrow key
      • Player - Player 9 (Gray) Releases the Right Arrow key
      • Player - Player 10 (Light Blue) Releases the Right Arrow key
      • Player - Player 11 (Dark Green) Releases the Right Arrow key
      • Player - Player 12 (Brown) Releases the Right Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Unit Group - Remove TempUnit from GroupRight
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in GroupRight) Equal to 0
        • Then - Actions
          • Trigger - Turn off Right Loop <gen>
        • Else - Actions
  • Back
    • Events
      • Player - Player 1 (Red) Presses the Down Arrow key
      • Player - Player 2 (Blue) Presses the Down Arrow key
      • Player - Player 3 (Teal) Presses the Down Arrow key
      • Player - Player 4 (Purple) Presses the Down Arrow key
      • Player - Player 5 (Yellow) Presses the Down Arrow key
      • Player - Player 6 (Orange) Presses the Down Arrow key
      • Player - Player 7 (Green) Presses the Down Arrow key
      • Player - Player 8 (Pink) Presses the Down Arrow key
      • Player - Player 9 (Gray) Presses the Down Arrow key
      • Player - Player 10 (Light Blue) Presses the Down Arrow key
      • Player - Player 11 (Dark Green) Presses the Down Arrow key
      • Player - Player 12 (Brown) Presses the Down Arrow key
    • Conditions
    • Actions
    • Set TempInt = (Player number of (Triggering player))
    • Set TempUnit = UnitOfPlayer[TempInt]
    • Set TempInt2 = AnimationOfPlayer[TempInt]
    • Custom script: call SetUnitTimeScale(udg_TempUnit, -1.00)
    • Custom script: call SetUnitAnimationByIndex(udg_TempUnit, udg_TempInt2)
    • Unit Group - Add TempUnit to GroupBack
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Back Loop <gen> is on) Equal to False
      • Then - Actions
        • Trigger - Turn on Back Loop <gen>
      • Else - Actions
  • Back Loop
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GroupBack and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Set TempPoint = (Position of TempUnit)
          • Set TempPoint2 = (TempPoint offset by 1.50 towards ((Facing of TempUnit) + 180.00) degrees)
          • Unit - Move TempUnit instantly to TempPoint2
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)
  • Back Stop
    • Events
      • Player - Player 1 (Red) Releases the Down Arrow key
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempUnit = UnitOfPlayer[TempInt]
      • Custom script: call SetUnitTimeScale(udg_TempUnit, 1.00)
      • Unit Group - Remove TempUnit from GroupBack
      • Unit - Order TempUnit to Stop
      • Animation - Reset TempUnit's animation
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in GroupBack) Equal to 0
        • Then - Actions
          • Trigger - Turn off Back Loop <gen>
        • Else - Actions
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
Check out my camera movement system and see if the functionality compares to it.

http://www.hiveworkshop.com/forums/...0-1-a-239423/?prev=status=a&u=deathismyfriend

Sorry i can't test it myself.

Mine has a lot of different ways to customize. It is not only 3rd person it can do 1st person as well. It allows for changing of angle of attack, height, roll. It can have different modes for each player. Allowing full control to the map maker or to the players. It can also limit control to each player individually. There are a few other things it can do as well.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
-You seem to be leaking CP_Point
-You don't necessarily set MovPoint2 but you always remove it
-Try using only CP_Point, not MovPoint2
-As you check pathing with the item method, there is necessarily no need to rely in setting unit position instantly. That also does pathinc check. Try SetUnitX/Y instead
 
Level 7
Joined
May 11, 2010
Messages
278
-You seem to be leaking CP_Point
-You don't necessarily set MovPoint2 but you always remove it
-Try using only CP_Point, not MovPoint2

I realize the leak now that you point it out.
I'll look into these points.

-As you check pathing with the item method, there is necessarily no need to rely in setting unit position instantly. That also does pathing check. Try SetUnitX/Y instead

That makes sense. I just never think of using custom scripts like those unless someone points it out :p

I'll update soon!
 
Top