Disable Arrow Key Camera Control

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,289
As the title says I want to disable the arrow keys function to control the camera.

I searched a little but according to the replies it was impossible to flat out disable it. However a few claimed that you could trigger it so it seemed like it was disabled.

I tried the three examples given in this thread: https://www.hiveworkshop.com/forums...ible-disable-arrow-key-camera-panning-183686/
None of them worked as intended, they were buggy and had a delay before restoring the camera. Hopefully something has been discovered since 2010.

edit:
I am using the following: This prevents the camera from moving as intended. However, unless I unlock it afterwards I wont be able to move the camera with the mouse.
  • Key Disable
    • Events
    • Conditions
    • Actions
      • the trigger is started from another trigger, don't worry about the event.
      • Set tloc = (Target of (Current camera))
      • Unit - Move cam_dummy instantly to tloc
      • Camera - Lock camera target for Player 1 (Red) to cam_dummy, offset by (0.00, 0.00) using Default rotation
      • Custom script: call RemoveLocation(udg_tloc)
 
If that is the only problem you can save camera values of player before unlocking and apply values after unlocking.
 
So I thought too. Sadly it didn't work for me.
  • Actions
    • Set tloc = (Target of (Current camera))
    • Unit - Move cam_dummy instantly to tloc
    • Camera - Lock camera target for Player 1 (Red) to cam_dummy, offset by (0.00, 0.00) using Default rotation
    • Set t_AoA = (Angle of attack of (Current camera))
    • Set t_rotation = (Rotation of (Current camera))
    • Custom script: call RemoveLocation(udg_tloc)
Don't you dare comment on my professional camera system, lol.
  • Cam Movement
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
      • Player - Player 1 (Red) Presses the Left Arrow key
      • Player - Player 1 (Red) Presses the Down Arrow key
      • Player - Player 1 (Red) Presses the Right Arrow key
      • Player - Player 1 (Red) Releases the Up Arrow key
      • Player - Player 1 (Red) Releases the Left Arrow key
      • Player - Player 1 (Red) Releases the Down Arrow key
      • Player - Player 1 (Red) Releases the Right Arrow key
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Custom script: if GetTriggerEventId() == EVENT_PLAYER_ARROW_UP_DOWN then
      • Set AoA_speed = -2.00
      • Trigger - Run Key Disable <gen> (checking conditions)
      • Skip remaining actions
      • Custom script: elseif GetTriggerEventId() == EVENT_PLAYER_ARROW_DOWN_DOWN then
      • Set AoA_speed = 2.00
      • Trigger - Run Key Disable <gen> (checking conditions)
      • Skip remaining actions
      • Custom script: elseif GetTriggerEventId() == EVENT_PLAYER_ARROW_DOWN_UP or GetTriggerEventId() == EVENT_PLAYER_ARROW_UP_UP then
      • Set AoA_speed = 0.00
      • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
      • Camera - Set Player 1 (Red)'s camera Rotation to t_rotation over 0.00 seconds
      • Camera - Set Player 1 (Red)'s camera Angle of attack to t_AoA over 0.00 seconds
      • Skip remaining actions
      • Custom script: elseif GetTriggerEventId() == EVENT_PLAYER_ARROW_LEFT_DOWN then
      • Set Rotation_speed = -2.00
      • Trigger - Run Key Disable <gen> (checking conditions)
      • Skip remaining actions
      • Custom script: elseif GetTriggerEventId() == EVENT_PLAYER_ARROW_RIGHT_DOWN then
      • Set Rotation_speed = 2.00
      • Trigger - Run Key Disable <gen> (checking conditions)
      • Skip remaining actions
      • Custom script: elseif GetTriggerEventId() == EVENT_PLAYER_ARROW_LEFT_UP or GetTriggerEventId() == EVENT_PLAYER_ARROW_RIGHT_UP then
      • Set Rotation_speed = 0.00
      • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
      • Camera - Set Player 1 (Red)'s camera Rotation to t_rotation over 0.00 seconds
      • Camera - Set Player 1 (Red)'s camera Angle of attack to t_AoA over 0.00 seconds
      • Skip remaining actions
      • Custom script: else
      • Camera - Set Player 1 (Red)'s camera Angle of attack to ((Angle of attack of (Current camera)) + AoA_speed) over 0.03 seconds
      • Camera - Set Player 1 (Red)'s camera Rotation to ((Rotation of (Current camera)) + Rotation_speed) over 0.03 seconds
      • Custom script: endif
 
Well, what I am guessing is you are using mouse wheel, which mainly changes "distance to target", not AoA(only a little maybe).Save distance value too and it works.
 
Status
Not open for further replies.
Back
Top