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

Getting mouse position

Status
Not open for further replies.
Level 2
Joined
Jan 1, 2010
Messages
3
How might one go about acquiring the current position of the mouse in a trigger? For example, upon hitting Numpad 1, it grabs the mouse's position and either moves a point to it if necessary or simply plugs the value into another action which would create a unit at point.

Thanks, and let me know if I need to clarify.
 
Level 10
Joined
Jul 22, 2007
Messages
261
  • Clickie Clickie
    • Events
      • UI - Player 1 clicks Left mouse button Down.
    • Local Variables
      • Mouse X = 0.0 <Real>
      • Mouse Y = 0.0 <Real>
      • Mouse Z = 0.0 <Real>
      • Mouse Clicked Position = No Point <Point>
    • Conditions
    • Actions
      • Variable - Set Mouse X = (Mouse X position clicked in the world)
      • Variable - Set Mouse Y = (Mouse Y position clicked in the world)
      • Variable - Set Mouse Z = (Mouse Z position clicked in the world)
      • Variable - Set Mouse Clicked Position = (Point(Mouse X, Mouse Y, Mouse Z))
 
Level 2
Joined
Jan 1, 2010
Messages
3
Thanks, Splashy, that's exactly what I needed to know. Using that, I can set those variables and move a point or maybe actually just plug that straight into a Create Unit or whatever trigger. Perfect solution, and exactly what I needed to know.
 
Status
Not open for further replies.
Top