is there really no access to any cursor position info unless an event is triggered? Seems like there should just be mouse position available in some variable...
Long answer: Having the need to always keep track of mouse position at all times is really resources and network heavy for the game engine. If your map need mouse position, you use the events, no one else has to take the performance hit except those who need. its that simple
but isnt the mouse position already kept track of constantly? if i wanted to check on its current UI/world position during a trigger without the mouse moving it would be really nice. I imagine it like a function that you could call anywhere that would just get whatever info starcraft is using for the mouse position. I know this is probably wishful thinking..but it seems so easy I don't know why they wouldn't include it. Would this be subject to the same speed issues that an event is? It doesn't seem like it.
Imagine sc2 like this, your trigger and your map when played loaded on bnet server, then all other player connect to it, all action in trigger has to be synchronized for all player before it continue, where your mouse is on the screen is dependent on your computer and isn't send to server nor to the trigger system. But when you click some unit, it is sent that you select that unit etc.. So you need to use some kind of events if you want that information to be sent through bnet servers.
If you mouse is truly not moving, then the mouse position is the last recorded position when the "mouse moved" events fired. Implement it like that.
I am talking about the mouse position that is dependant on your computer. That would be perfect. It wouldn't necessarily have to concern the other players.
I have created the mouse move trigger during a special condition. I don't want it on all the time because it consumes so many resources. when its no longer needed I destroy the trigger. Now the mouse can move and the position will be different than the last known position. When the trigger is recreated the position will be totally different and anything that would rely on that position would be wrong. To get an updated position I have to not only create the trigger..but hope the mouse moves.
I was trying to make a diablo move system but the event Mouse Moved isn't very good at all. It was buggy because it looked for where the mouse moved even when the mouse was not moved and that caused lag. Also, because it only chooses a new location if it is moved, when i would click and hold the mouse for the character to keep running in a particular direction. It would stop at the point I clicked and would not continue if i didn't move the mouse after I clicked (this was after I put in triggers to keep it firing so often; I don't know if it does this before I did that).
End thoughts, same problem as before exists; I still can't detect mouse position very well via triggers. That, my friend, is annoying because that was the whole purpose of it.
i hear ya...it just seems like it should be so easy to get a one time coordinate for the mouse location. but instead its got to be this big event driven deal.. ..i just want to know where the mouse is....just one time. its 2 numbers
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
is there really no access to any cursor position info unless an event is triggered? Seems like there should just be mouse position available in some variable...
Short answer: No
Long answer: Having the need to always keep track of mouse position at all times is really resources and network heavy for the game engine. If your map need mouse position, you use the events, no one else has to take the performance hit except those who need. its that simple
but isnt the mouse position already kept track of constantly? if i wanted to check on its current UI/world position during a trigger without the mouse moving it would be really nice. I imagine it like a function that you could call anywhere that would just get whatever info starcraft is using for the mouse position. I know this is probably wishful thinking..but it seems so easy I don't know why they wouldn't include it. Would this be subject to the same speed issues that an event is? It doesn't seem like it.
@starKidney: Go
Imagine sc2 like this, your trigger and your map when played loaded on bnet server, then all other player connect to it, all action in trigger has to be synchronized for all player before it continue, where your mouse is on the screen is dependent on your computer and isn't send to server nor to the trigger system. But when you click some unit, it is sent that you select that unit etc.. So you need to use some kind of events if you want that information to be sent through bnet servers.
If you mouse is truly not moving, then the mouse position is the last recorded position when the "mouse moved" events fired. Implement it like that.
Triggers Name: Player 1 MouseMove Tracker
thats the basics of it
each player should really have thier own trigger for this.
I am talking about the mouse position that is dependant on your computer. That would be perfect. It wouldn't necessarily have to concern the other players.
I have created the mouse move trigger during a special condition. I don't want it on all the time because it consumes so many resources. when its no longer needed I destroy the trigger. Now the mouse can move and the position will be different than the last known position. When the trigger is recreated the position will be totally different and anything that would rely on that position would be wrong. To get an updated position I have to not only create the trigger..but hope the mouse moves.
yes soul carver this is what I have done. the trigger that registers the mouse move event needs an up to date mouse position though...
I was trying to make a diablo move system but the event Mouse Moved isn't very good at all. It was buggy because it looked for where the mouse moved even when the mouse was not moved and that caused lag. Also, because it only chooses a new location if it is moved, when i would click and hold the mouse for the character to keep running in a particular direction. It would stop at the point I clicked and would not continue if i didn't move the mouse after I clicked (this was after I put in triggers to keep it firing so often; I don't know if it does this before I did that).
End thoughts, same problem as before exists; I still can't detect mouse position very well via triggers. That, my friend, is annoying because that was the whole purpose of it.
i hear ya...it just seems like it should be so easy to get a one time coordinate for the mouse location. but instead its got to be this big event driven deal.. ..i just want to know where the mouse is....just one time. its 2 numbers