I've already checked around and there doesn't seem to be a solution to this but the last thread I found was half a year old and I don't have HotS so I thought there might be something new.
Anyway what I need is a trigger that gets the mouse location say every 0.25 seconds. I'm aware of the mouse moved and clicked event responses, but the problem is in my map your camera is locked to a unit that is moving, so your cursor is constantly changing location, whither you move your mouse or not.
If there is no direct way to do this I've reasoned out a work around I think will do quite nicely and have some questions on it. My idea is use the mouse moved event to update the cursor point variable any time you actually move your mouse, but as well have a trigger that constantly offsets the cursor point variable in the direction your unit is facing, and factor in its current speed. So my question here is how does SCII actually recognize speed, would a unit speed of 1 mean it moves 1 distance per second?
"So my question here is how does SCII actually recognize speed, would a unit speed of 1 mean it moves 1 distance per second?"
Yes, one distance per game time second.
"My idea is use the mouse moved event to update the cursor point variable any time you actually move your mouse..."
I don't see why it needs to be so complicated. If you want an accurate mouse location in relation to the unit, instead of saving the mouse moved location, set two variables (both of type real) that save the angle from the unit to the mouse moved point to and the distance between the unit and the mouse moved point.
If your idea is to have a trigger that "constantly offsets the cursor point", then why not just have a trigger that constantly records the cursor point?
I believe that's what he suggested, but he's accounting for the fact that only the mouse moving triggers the mouse moved event. So if the camera is following a unit, then when the mouse isn't in motion the variable containing the mouse's movement becomes invalid.
Nice idea I never thought of doing it that way, I'm going to try this as soon as I get back into this map, this problem is the one that turned me away from it last time.
Thanks guys but the mouse moved or clicked position actions only work if the event for the trigger is mouse moved or clicked, and as I mentioned your cursor will be moving in my map without the mouse being moved or clicked, so I can't rely on these alone.
What exactly are you trying to accomplish? There might be an easier (and/or less trigger intensive) way to do it.
Rollback Post to RevisionRollBack
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
My idea is use the mouse moved event to update the cursor point variable any time you actually move your mouse, but as well have a trigger that constantly offsets the cursor point variable in the direction your unit is facing, and factor in its current speed. So my question here is how does SCII actually recognize speed, would a unit speed of 1 mean it moves 1 distance per second?
Sounds a bit like you need the controls I put into my map.
I'm saving the offset from the hero to the last input point and then I'm starting a trigger that keeps using a calculated point for orders as long as the mouse button is pressed. Click for more details how I've set it up.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I've already checked around and there doesn't seem to be a solution to this but the last thread I found was half a year old and I don't have HotS so I thought there might be something new.
Anyway what I need is a trigger that gets the mouse location say every 0.25 seconds. I'm aware of the mouse moved and clicked event responses, but the problem is in my map your camera is locked to a unit that is moving, so your cursor is constantly changing location, whither you move your mouse or not.
If there is no direct way to do this I've reasoned out a work around I think will do quite nicely and have some questions on it. My idea is use the mouse moved event to update the cursor point variable any time you actually move your mouse, but as well have a trigger that constantly offsets the cursor point variable in the direction your unit is facing, and factor in its current speed. So my question here is how does SCII actually recognize speed, would a unit speed of 1 mean it moves 1 distance per second?
Thanks
@Drunkenseagull: Go
"So my question here is how does SCII actually recognize speed, would a unit speed of 1 mean it moves 1 distance per second?"
Yes, one distance per game time second.
"My idea is use the mouse moved event to update the cursor point variable any time you actually move your mouse..."
I don't see why it needs to be so complicated. If you want an accurate mouse location in relation to the unit, instead of saving the mouse moved location, set two variables (both of type real) that save the angle from the unit to the mouse moved point to and the distance between the unit and the mouse moved point.
@Drunkenseagull: Go
If your idea is to have a trigger that "constantly offsets the cursor point", then why not just have a trigger that constantly records the cursor point?
@MasterWrath: Go
I believe that's what he suggested, but he's accounting for the fact that only the mouse moving triggers the mouse moved event. So if the camera is following a unit, then when the mouse isn't in motion the variable containing the mouse's movement becomes invalid.
@Drunkenseagull: Go
Try Mouse Clicks Pos X :)
@Charysmatic: Go
Nice idea I never thought of doing it that way, I'm going to try this as soon as I get back into this map, this problem is the one that turned me away from it last time.
@MasterWrath: Go @Mugen245: Go
Thanks guys but the mouse moved or clicked position actions only work if the event for the trigger is mouse moved or clicked, and as I mentioned your cursor will be moving in my map without the mouse being moved or clicked, so I can't rely on these alone.
@Drunkenseagull: Go
What exactly are you trying to accomplish? There might be an easier (and/or less trigger intensive) way to do it.
Sounds a bit like you need the controls I put into my map.
I'm saving the offset from the hero to the last input point and then I'm starting a trigger that keeps using a calculated point for orders as long as the mouse button is pressed. Click for more details how I've set it up.