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

Preventing Camera Zoom Resets

Status
Not open for further replies.
Level 10
Joined
Mar 25, 2008
Messages
339
I really want to get rid of this "every seconds of game time" crud, is there any way to prevent the camera from resetting when someone hits their scroll wheel, and ideally, angling/scrolling at the correct distance?
Camera Scroll Fixer
Events
Time - Every 0.20 seconds of game time
Conditions
Actions
If ((Player 1 (Red) slot status) Equal to Is playing) then do (Camera - Set Player 1 (Red)'s camera Distance to target to CameraReal[1] over 0.00 seconds) else do (Do nothing)
If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Camera - Set Player 2 (Blue)'s camera Distance to target to CameraReal[2] over 0.00 seconds) else do (Do nothing)
If ((Player 3 (Teal) slot status) Equal to Is playing) then do (Camera - Set Player 3 (Teal)'s camera Distance to target to CameraReal[3] over 0.00 seconds) else do (Do nothing)
If ((Player 4 (Purple) slot status) Equal to Is playing) then do (Camera - Set Player 4 (Purple)'s camera Distance to target to CameraReal[4] over 0.00 seconds) else do (Do nothing)
If ((Player 5 (Yellow) slot status) Equal to Is playing) then do (Camera - Set Player 5 (Yellow)'s camera Distance to target to CameraReal[5] over 0.00 seconds) else do (Do nothing)
If ((Player 6 (Orange) slot status) Equal to Is playing) then do (Camera - Set Player 6 (Orange)'s camera Distance to target to CameraReal[6] over 0.00 seconds) else do (Do nothing)
If ((Player 7 (Green) slot status) Equal to Is playing) then do (Camera - Set Player 7 (Green)'s camera Distance to target to CameraReal[7] over 0.00 seconds) else do (Do nothing)
If ((Player 8 (Pink) slot status) Equal to Is playing) then do (Camera - Set Player 8 (Pink)'s camera Distance to target to CameraReal[8] over 0.00 seconds) else do (Do nothing)
If ((Player 9 (Gray) slot status) Equal to Is playing) then do (Camera - Set Player 9 (Gray)'s camera Distance to target to CameraReal[9] over 0.00 seconds) else do (Do nothing)
If ((Player 10 (Light Blue) slot status) Equal to Is playing) then do (Camera - Set Player 10 (Light Blue)'s camera Distance to target to CameraReal[10] over 0.00 seconds) else do (Do nothing)
If ((Player 11 (Dark Green) slot status) Equal to Is playing) then do (Camera - Set Player 11 (Dark Green)'s camera Distance to target to CameraReal[11] over 0.00 seconds) else do (Do nothing)
If ((Player 13 (Maroon) slot status) Equal to Is playing) then do (Camera - Set Player 13 (Maroon)'s camera Distance to target to CameraReal[13] over 0.00 seconds) else do (Do nothing)
If ((Player 14 (Navy) slot status) Equal to Is playing) then do (Camera - Set Player 14 (Navy)'s camera Distance to target to CameraReal[14] over 0.00 seconds) else do (Do nothing)
If ((Player 15 (Turquoise) slot status) Equal to Is playing) then do (Camera - Set Player 15 (Turquoise)'s camera Distance to target to CameraReal[15] over 0.00 seconds) else do (Do nothing)
If ((Player 16 (Violet) slot status) Equal to Is playing) then do (Camera - Set Player 16 (Violet)'s camera Distance to target to CameraReal[16] over 0.00 seconds) else do (Do nothing)
If ((Player 17 (Wheat) slot status) Equal to Is playing) then do (Camera - Set Player 17 (Wheat)'s camera Distance to target to CameraReal[17] over 0.00 seconds) else do (Do nothing)
If ((Player 18 (Peach) slot status) Equal to Is playing) then do (Camera - Set Player 18 (Peach)'s camera Distance to target to CameraReal[18] over 0.00 seconds) else do (Do nothing)
If ((Player 19 (Mint) slot status) Equal to Is playing) then do (Camera - Set Player 19 (Mint)'s camera Distance to target to CameraReal[19] over 0.00 seconds) else do (Do nothing)
If ((Player 20 (Lavender) slot status) Equal to Is playing) then do (Camera - Set Player 20 (Lavender)'s camera Distance to target to CameraReal[20] over 0.00 seconds) else do (Do nothing)
If ((Player 21 (Coal) slot status) Equal to Is playing) then do (Camera - Set Player 21 (Coal)'s camera Distance to target to CameraReal[21] over 0.00 seconds) else do (Do nothing)
If ((Player 22 (Snow) slot status) Equal to Is playing) then do (Camera - Set Player 22 (Snow)'s camera Distance to target to CameraReal[22] over 0.00 seconds) else do (Do nothing)
If ((Player 23 (Emerald) slot status) Equal to Is playing) then do (Camera - Set Player 23 (Emerald)'s camera Distance to target to CameraReal[23] over 0.00 seconds) else do (Do nothing)
If ((Player 24 (Peanut) slot status) Equal to Is playing) then do (Camera - Set Player 24 (Peanut)'s camera Distance to target to CameraReal[24] over 0.00 seconds) else do (Do nothing)

"The Primary Camera Trigger"
Camera Trigger
Events
Player - Player 1 (Red) types a chat message containing -cam as A substring
Player - Player 2 (Blue) types a chat message containing -cam as A substring
Player - Player 3 (Teal) types a chat message containing -cam as A substring
Player - Player 4 (Purple) types a chat message containing -cam as A substring
Player - Player 5 (Yellow) types a chat message containing -cam as A substring
Player - Player 6 (Orange) types a chat message containing -cam as A substring
Player - Player 7 (Green) types a chat message containing -cam as A substring
Player - Player 8 (Pink) types a chat message containing -cam as A substring
Player - Player 9 (Gray) types a chat message containing -cam as A substring
Player - Player 10 (Light Blue) types a chat message containing -cam as A substring
Player - Player 11 (Dark Green) types a chat message containing -cam as A substring
Player - Player 13 (Maroon) types a chat message containing -cam as A substring
Player - Player 14 (Navy) types a chat message containing -cam as A substring
Player - Player 15 (Turquoise) types a chat message containing -cam as A substring
Player - Player 16 (Violet) types a chat message containing -cam as A substring
Player - Player 17 (Wheat) types a chat message containing -cam as A substring
Player - Player 18 (Peach) types a chat message containing -cam as A substring
Player - Player 19 (Mint) types a chat message containing -cam as A substring
Player - Player 20 (Lavender) types a chat message containing -cam as A substring
Player - Player 21 (Coal) types a chat message containing -cam as A substring
Player - Player 22 (Snow) types a chat message containing -cam as A substring
Player - Player 23 (Emerald) types a chat message containing -cam as A substring
Player - Player 24 (Peanut) types a chat message containing -cam as A substring
Conditions
(Entered chat string) Not equal to -cam reset
(Entered chat string) Not equal to -resetcam
(Entered chat string) Not equal to -camstop
(Entered chat string) Not equal to -camstart
Actions
Set VariableSet CameraReal[(Player number of (Triggering player))] = (Real((Substring((Entered chat string), 6, 10))))
Game - Display to (Player group((Triggering player))) the text: (|cFF0080C0Console: |r|cFF00D2D2Your cameras height has been set to: |r + (String(CameraReal[(Player number of (Triggering player))])))
Camera - Set (Triggering player)'s camera Distance to target to CameraReal[(Player number of (Triggering player))] over 0.00 seconds
 
@Aniki discovered this cool trick: [vJASS] - LockedCamera
Edit: Actually now I'm not sure you can apply it to lock distance only, while allowing mouse normal mouse interactions. Have you some locking location to a unit or something, then it should work for sure. Else, and if does lock too much for you, you might try similar method but merely use SetCamDistance over huge amount of time instead of PanCamera. I'm not sure if it works
 
Last edited:
Status
Not open for further replies.
Top