1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Seek unity between the elements in the 22nd Terraining Contest Poll.
    Dismiss Notice
  3. Seize the moment! The 18th Mini Mapping Contest has commenced.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Camera Lock System v1.0

Submitted by Haley
This bundle is marked as substandard. It may contain bugs, not perform optimally or otherwise be in violation of the submission rules.
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
    GUI
    Init
    • 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)

    Start
    • 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

    Reset
    • 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

    Loop
    • 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)

    Example
    • 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
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.
  1. 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.
     
  2. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,482
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    The system is smooth and very enjoyable. But it also affects enemy units. If you accidentally select an enemy unit and it moves to his base, you can not select your units in any free way possible. I hope you got my point with enemy selection. 4/5
     
  3. Haley

    Haley

    Joined:
    Jan 3, 2014
    Messages:
    39
    Resources:
    3
    Spells:
    3
    Resources:
    3
    The unit selection in this map is just to show the using example, you can use this system with different way as you like by following the example...
     
  4. Chaosy

    Chaosy

    Tutorial Reviewer

    Joined:
    Jun 9, 2011
    Messages:
    11,065
    Resources:
    18
    Icons:
    1
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    18
    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.
     
  5. ILH

    ILH

    Joined:
    May 8, 2012
    Messages:
    606
    Resources:
    16
    Models:
    14
    Icons:
    1
    Tutorials:
    1
    Resources:
    16
    • Set Pcht_dropPoint = (tempLoc offset by (Random real number between 0.00 and 500.00) towards (Random angle) degrees)

    You could put the max distance (500) into a variable.
     
  6. Strikest

    Strikest

    Joined:
    Aug 27, 2012
    Messages:
    338
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I hate maps that lock my camera.
     
  7. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,709
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    The example is very bad because you do not propely decrease the counter with it.

    This system is really easy to code by oneself, therefore I tend to reject it.
     
    Last edited: Jun 15, 2014