• 🏆 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!

Disable Arrow Key Camera Control

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
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: http://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)
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
If that is the only problem you can save camera values of player before unlocking and apply values after unlocking.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
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
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
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.
Top