• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Camera Lock System v1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Another system i used in my map. Lock player's camera to a unit and moves smoothly. This system could be useful for fast-playing combat map.
  • Features
    - Smoothly lock and moves the camera to a unit
    - GUI-Friendly
    - MUI
  • Triggers
    • Camera Lock Init
      • Events
        • Map initialization
      • Conditions
      • Actions
        • -------- --------------------------- --------
        • -------- After importing this system, you might need to sets these variables again --------
        • Set Clck_loopTrigger = Camera Lock Loop <gen>
        • Set Clck_resetTrigger = Camera Reset Lock <gen>
        • -------- --------------------------- --------
        • -------- Determines the loop timer speed --------
        • Set Clck_loopSpeed = 0.03
        • -------- Note: I recommend you not to change this, but for some reason i leave this configurable for those who might need this somehow --------
        • -------- --------------------------- --------
        • -------- Do not change anything below this line if don't know what you're doing --------
        • -------- =========================================================================== --------
        • Trigger - Add to Clck_loopTrigger the event (Time - Every Clck_loopSpeed seconds of game time)
    • Camera Start Lock
      • Events
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Clck_count Equal to 0
          • Then - Actions
            • Trigger - Turn on Clck_loopTrigger
          • Else - Actions
        • Set Clck_count = (Clck_count + 1)
        • Set Clck_playerID = (Player number of Clck_lockPlayer)
        • Set Clck_unit[Clck_playerID] = Clck_lockUnit
        • Set Clck_time[Clck_playerID] = Clck_lockTime
        • Player Group - Add Clck_lockPlayer to Clck_playerForce
        • Custom script: set udg_Clck_lockPlayer=null
        • Set Clck_lockTime = 0.00
        • Set Clck_lockUnit = No unit
    • Camera Reset Lock
      • Events
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Clck_lockPlayer is in Clck_playerForce) Equal to True
          • Then - Actions
            • Camera - Reset camera for Clck_lockPlayer to standard game-view over 0.00 seconds
            • Player Group - Remove Clck_lockPlayer from Clck_playerForce
            • Set Clck_count = (Clck_count - 1)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Clck_count Equal to 0
              • Then - Actions
                • Trigger - Turn off Clck_loopTrigger
              • Else - Actions
          • Else - Actions
    • Camera Lock Loop
      • Events
      • Conditions
      • Actions
        • Player Group - Pick every player in Clck_playerForce and do (Actions)
          • Loop - Actions
            • Set Clck_player = (Picked player)
            • Set Clck_playerID = (Player number of Clck_player)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Clck_unit[Clck_playerID] is dead) Equal to False
              • Then - Actions
                • Set Clck_tempLoc = (Position of Clck_unit[Clck_playerID])
                • Camera - Pan camera for Clck_player to Clck_tempLoc over Clck_time[Clck_playerID] seconds
                • Custom script: call RemoveLocation(udg_Clck_tempLoc)
              • Else - Actions
                • Trigger - Run Clck_resetTrigger (ignoring conditions)
    • On Selection
      • Events
        • Player - Player 1 (Red) Selects a unit
        • Player - Player 1 (Red) Deselects a unit
      • Conditions
      • Actions
        • Set tempPlayer = (Triggering player)
        • Set tempGroup = (Units currently selected by tempPlayer)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in tempGroup) Greater than 0
          • Then - Actions
            • Set Clck_lockUnit = (Random unit from tempGroup)
            • Set Clck_lockPlayer = tempPlayer
            • Set Clck_lockTime = 0.40
            • Trigger - Run Camera Start Lock <gen> (ignoring conditions)
          • Else - Actions
            • Set Clck_lockPlayer = tempPlayer
            • Trigger - Run Camera Reset Lock <gen> (ignoring conditions)
        • Custom script: call DestroyGroup(udg_tempGroup)

Keywords:
Camera, Player, Smooth, GUI, MUI
Contents

Plunder Isle (Map)

Reviews
15:45, 7th Aug 2014 BPower: The code is okay, but it's not enough for a spell submission. In my eyes this is tutorial or template material any half experienced users can code a similar system within a few minutes. Rejected due to simpleness.

Moderator

M

Moderator

15:45, 7th Aug 2014
BPower:
The code is okay, but it's not enough for a spell submission.
In my eyes this is tutorial or template material any half experienced users can code a similar system within a few minutes.
Rejected due to simpleness.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
Aw shiet, you managed to do both the things I hate in one system.
1. indexing
2. comments that ruin the readability

anyway, rather simple system but useful. However, do you really need all those triggers? I think you can create it with 2 triggers. (3 if you want the setup trigger) I mean you need one for adding the unit to the system, and one for the actual system. That's it I think.
 
Top