1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Getting mouse position

Discussion in 'StarCraft II Modding' started by CannonFodder100, May 22, 2010.

  1. CannonFodder100

    CannonFodder100

    Joined:
    Jan 1, 2010
    Messages:
    3
    Resources:
    0
    Resources:
    0
    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.
     
  2. splashy5

    splashy5

    Joined:
    Jul 22, 2007
    Messages:
    259
    Resources:
    0
    Resources:
    0
    you cant get position unless you click
     
  3. MGCǂSpectre

    MGCǂSpectre

    Joined:
    Feb 4, 2005
    Messages:
    3,007
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Ok and how do you detect the position of the mouse after clicking?
     
  4. splashy5

    splashy5

    Joined:
    Jul 22, 2007
    Messages:
    259
    Resources:
    0
    Resources:
    0
    with the-mouse click Position X
    mouse click Position Y
    mouse click Position Z
    Then make point from XYZ
     
  5. MGCǂSpectre

    MGCǂSpectre

    Joined:
    Feb 4, 2005
    Messages:
    3,007
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    • Attack
      • Events
        • UI - Player 1 clicks Right mouse button Down.
      • Local Variables
      • Conditions
        • (Mouse X position clicked in the world) == Value 2



    this? what do you equal it to?
     
  6. splashy5

    splashy5

    Joined:
    Jul 22, 2007
    Messages:
    259
    Resources:
    0
    Resources:
    0
    • 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))
     
  7. CannonFodder100

    CannonFodder100

    Joined:
    Jan 1, 2010
    Messages:
    3
    Resources:
    0
    Resources:
    0
    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.