I've locked the camera to a unit; but I can't unlock now!

AlicanC

New Member
Reaction score
2
In my map if a player enters "-camera 1" this trigger gets enabled:
Code:
Camera Copy
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        -------- Third-Person camera --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Last_Camera Equal to 1
            Then - Actions
                Set Last_UnitGroup = (Units owned by Last_Player matching (((Matching unit) is selected by Last_Player) Equal to True))
                Set Last_Integer = (Number of units in Last_UnitGroup)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Last_Integer Equal to 1
                    Then - Actions
                        Set Last_Unit = (Random unit from Last_UnitGroup)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Hero_Picked[(Player number of Last_Player)] Equal to True
                                Hero_Alive[(Player number of Last_Player)] Equal to True
                            Then - Actions
                                Set Last_Unit = Hero[(Player number of Last_Player)]
                            Else - Actions
                                Skip remaining actions
                Camera - Pan camera for Last_Player to (Position of Last_Unit) over 1.00 seconds
                Camera - Lock camera target for Last_Player to Last_Unit, offset by (0.00, 0.00) using Default rotation
                Camera - Set Last_Player's camera Distance to target to 1100.00 over 0.75 seconds
                Camera - Set Last_Player's camera Angle of attack to -20.00 over 0.75 seconds
                Camera - Set Last_Player's camera Rotation to (Facing of Last_Unit) over 0.75 seconds
            Else - Actions
                Do nothing
This works perfect; but now I want to make a command "-camera normal" to teke the camera back to normal; but this doesn't work:
Code:
Camera Copy
    Events
        Blah blah
    Conditions
    Actions
        Camera - Pan camera for Last_Player to (Position of Last_Unit) over 1.00 seconds
        Camera - Lock camera target for Last_Player to Last_Unit, offset by (0.00, 0.00) using Default rotation
        Camera - Set Last_Player's camera Distance to target to 1100.00 over 0.75 seconds
        Camera - Set Last_Player's camera Angle of attack to -20.00 over 0.75 seconds
        Camera - Set Last_Player's camera Rotation to (Facing of Last_Unit) over 0.75 seconds

What now!?!?
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
You will want to use Camera - Reset to Game Camera. Also, you will need to disable the other trigger when the camera control is normal.

BTW, 0.01 is pretty frequent. 0.02 or 0.03 should be fine.
 

AlicanC

New Member
Reaction score
2
Thanks for help. I did the same thing; but my trigger kept reseting camera every 0.01 second :)
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
If the camera is locked you can also type "CTRL + C" ...or was it CTRL+V?..hmm, think it was C :D
(just wanted you to know, in case you didnt)
Cheerio
 

ertaboy356b

Old School Gamer
Reaction score
86
Hmmm, maybe if you rewrite your trigger like this it should work, not sure though:

1. Make an empty PlayerGroup, lets name it, CameraGroup
2. Make a trigger that when the player enters "- camera 1", that player is added into CameraGroup.
3. Make a trigger with periodic event(for camera locking purposes) that will pan the camera to every player on CameraGroup.
4. Make a trigger that when a player enters "- camera normal", that player is removed from CameraGroup.

So you have 3 triggers, The one who sets who will be locked, the one who locks, and the one who sets who will be removed from the locked..

:)
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
instead of writing something... just use an ability instead.. 1000times better.
personally, i really hate maps where u have to type in things, to get things to work. Example
-withdraw , -camlock, -go, ........ ;)
So, ye, put an ability instead on your unit, i doubt u got 6 abilities on it... ;)
If u do got 6 abils, well, change the stop button, to an ability "lock cam" and change its icon..? Since stop button (using hold pos instead)= rarely used.. i mean NEVER!... When "unit issued order stop" > do actions... :rolleyes: :confused:
Cheerio
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
@manytimes, can you change the "stop" icon just through the Interface menu? (just curious)
 

AlicanC

New Member
Reaction score
2
Hmmm, maybe if you rewrite your trigger like this it should work, not sure though:

1. Make an empty PlayerGroup, lets name it, CameraGroup
2. Make a trigger that when the player enters "- camera 1", that player is added into CameraGroup.
3. Make a trigger with periodic event(for camera locking purposes) that will pan the camera to every player on CameraGroup.
4. Make a trigger that when a player enters "- camera normal", that player is removed from CameraGroup.

So you have 3 triggers, The one who sets who will be locked, the one who locks, and the one who sets who will be removed from the locked..

:)
I solved it already.

Setting camera modes:
Code:
camera normal
    Events
        Player - Player 1 (Red) types a chat message containing -camera -normal as An exact match
        Player - Player 2 (Blue) types a chat message containing -camera -normal as An exact match
        Player - Player 5 (Yellow) types a chat message containing -camera -normal as An exact match
        Player - Player 7 (Green) types a chat message containing -camera -normal as An exact match
    Conditions
    Actions
        Set Last_Player = (Triggering player)
        Set Camera[(Player number of Last_Player)] = 0
        Camera - Reset camera for Last_Player to standard game-view over 0.00 seconds
        Game - Display to (Player group(Last_Player)) for 5.00 seconds the text: |cffff3300!Message|...
Code:
camera thirdperson
    Events
        Player - Player 1 (Red) types a chat message containing -camera -thirdperson as An exact match
        Player - Player 2 (Blue) types a chat message containing -camera -thirdperson as An exact match
        Player - Player 5 (Yellow) types a chat message containing -camera -thirdperson as An exact match
        Player - Player 7 (Green) types a chat message containing -camera -thirdperson as An exact match
    Conditions
    Actions
        Set Last_Player = (Triggering player)
        Set Camera[(Player number of Last_Player)] = 1
        Game - Display to (Player group(Last_Player)) for 5.00 seconds the text: |cffff3300!Message|...
Camera Trigger:
Code:
Camera
    Events
        Time - Every 0.02 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Set Last_Player = (Picked player)
                Set Last_Camera = Camera[(Player number of Last_Player)]
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Last_Player slot status) Equal to Is playing
                    Then - Actions
                        -------- Normal camera --------
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Last_Camera Equal to 0
                            Then - Actions
                                Skip remaining actions
                            Else - Actions
                                Do nothing
                        -------- Third-Person camera --------
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Last_Camera Equal to 1
                            Then - Actions
                                Set Last_UnitGroup = (Units owned by Last_Player matching (((Matching unit) is selected by Last_Player) Equal to True))
                                Set Last_Integer = (Number of units in Last_UnitGroup)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        Last_Integer Equal to 1
                                    Then - Actions
                                        Set Last_Unit = (Random unit from Last_UnitGroup)
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                Hero_Picked[(Player number of Last_Player)] Equal to True
                                                Hero_Alive[(Player number of Last_Player)] Equal to True
                                            Then - Actions
                                                Set Last_Unit = Hero[(Player number of Last_Player)]
                                            Else - Actions
                                                Skip remaining actions
                                Camera - Pan camera for Last_Player to (Position of Last_Unit) over 1.00 seconds
                                Camera - Lock camera target for Last_Player to Last_Unit, offset by (0.00, 0.00) using Default rotation
                                Camera - Set Last_Player's camera Distance to target to 1100.00 over 0.75 seconds
                                Camera - Set Last_Player's camera Angle of attack to -20.00 over 0.75 seconds
                                Camera - Set Last_Player's camera Rotation to (Facing of Last_Unit) over 0.75 seconds
                                Skip remaining actions
                            Else - Actions
                                Do nothing
                        -------- First-Person camera --------
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Last_Camera Equal to 2
                            Then - Actions
                                Set Last_Unit = Hero[(Player number of Last_Player)]
                                -------- Not Finished Yet... --------
                                Skip remaining actions
                            Else - Actions
                                Do nothing
                    Else - Actions
                        Do nothing

---

instead of writing something... just use an ability instead.. 1000times better.
personally, i really hate maps where u have to type in things, to get things to work. Example
-withdraw , -camlock, -go, ........ ;)
So, ye, put an ability instead on your unit, i doubt u got 6 abilities on it... ;)
If u do got 6 abils, well, change the stop button, to an ability "lock cam" and change its icon..? Since stop button (using hold pos instead)= rarely used.. i mean NEVER!... When "unit issued order stop" > do actions... :rolleyes: :confused:
Cheerio
I didn't modify heroes or abilities. I tried to add Elemental Tri Fury; but it didn't work. I think I can do something like spellbook and put commands in it.
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Knocksious: Yes.. change its icon at least (through game interface) BUUUT! When it comes to the "display text" msg, above the stop icon, im not that sure, never tested/checked/tried...:cool: to use the stop button is also like an last resort..if you have used all the slots....
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top