• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Detecting middle mouse button idea

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I was told this is impossible, but I wonder...

Here's a trigger that almost works:
  • mouse test
    • Events
      • Time - Every 0.07 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Angle of attack of the current camera view) Less than camera
        • Then - Actions
          • Game - Display to (All players) the text: down
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Angle of attack of the current camera view) Greater than camera
            • Then - Actions
              • Game - Display to (All players) the text: up
            • Else - Actions
        • Camera - Reset camera for Player 7 (Green) to standard game-view over 0.00 seconds
        • Camera - Lock camera target for Player 7 (Green) to Blood Mage 0025 <gen>, offset by (0.00, 0.00) using Default rotation
        • Camera - Set Player 7 (Green)'s camera Angle of attack to 315.00 over 0.00 seconds
        • Set camera = (Angle of attack of the current camera view)
There are some very strange things. For one, some actions use radians by default and some use degrees... which is very strange. For two, I need to use "current camera" which might desync without some fancy JASS.

Basically, the idea is to detect camera movement that is caused by the middle mouse, then reset it. The problem, is that the camera movement appears to be on a scale from "all the way down" to "all the way up". I want to force the actual camera to be in the middle, so if the mouse rolls up the camera goes in one direction, down it goes in another. But the way it appears to work, whatever you assign the camera to in the trigger, the mouse cannot roll up anymore.

Still, I'm not sure this is impossible. Has anyone tried something like this before?

UPDATE:

  • mouse test Copy
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Angle of attack of the current camera view) Greater than camera
        • Then - Actions
          • Game - Display to (All players) the text: up
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Angle of attack of the current camera view) Less than camera
        • Then - Actions
          • Game - Display to (All players) the text: down
        • Else - Actions
      • Set camera = (Angle of attack of the current camera view)
That works, but there is a limit...once the camera is all the way up or down you can't detect further movement in that direction. Also, you have to let the mouse move the camera as well, which sucks.
 
Status
Not open for further replies.
Top