I also personally dislike the idea of splitting the mouse moved trigger into multiple instances, one for every player. While it may in theory be possible that it is more efficient, it has not yet been proven and it will be very hard to do so. However, it adds a lot of duplicated code and is just by itself a very ugly design, screaming for errors. It also adds overhead to other places of code, such as the mouse key press switch cases and also map and variable initialization.
Yes i also do not like this at all and prefer to have it all in one trigger but how exactly is that supposed to be made? Only way to get the mouse location is by this trigger.
Regarding the quick click question, would it not just be easy to add a check that waits until the trigger is on before turning it off so it does not stay on?
The only way i have found it to get the position is if its run in a event trigger that check if mouse is moved or clicked. I did the loop inside that trigger hoping it would update it but it only get the value of the mouse location the instant the trigger runs and not while it runs. So the only way to make this work well is if we find a way to get mouse position without running it in a trigger.
To put it plain, blizzard have not included that function as far as i know :(
Yes i would really like to do that but if you can make an example map of that very easy thing that i would be extremely happy because i can't do it at all.
If you can show me that one simple row on how to load a variable with the mouse coordinates then that would solve all problems. So far many have said to do just that and even i would have said it but i have not found one single way to do it.
Here i even made a sample map for you, all you have to do is fix the variable.
I understand what you say but i don't understand how to store the mouse position without using the trigger. The only way to get the mouse location is from the trigger when mouse is moved or clicked.
If you can show how to "get" the mouse location without using the value in the image then i would be very happy!
I have a diablo like movement system. Unit follow mouse when left mouse btn down. I have to updating the mouse location on mouse movement but i have heard that doing this make it run the trigger like crazy and this causes lag on the server (locally its fine). So what i want to do it get the mouse move location without running the mouse move trigger over and over. Best solution so far is to limit the amount of time the trigger can run and with some testing i have set it to 0.06 real time seconds. This give me strangely enough 8 times per real time seconds (did run some test triggers to measure this) witch is in fact 0,125 per trigger and not 0.06.
To make it super simple, i want as little trigger as possible to run to reduce lag.
I have been told that running the mouse move trigger to get the mouse location is a bad thing (lags the game), better to run it in a loop then executing new triggers. I have been trying this but i cant seam to get the new mouse location in the world unless i use that trigger its like it only update one time and that is when that trigger run so a while loop.
Yes i also do not like this at all and prefer to have it all in one trigger but how exactly is that supposed to be made? Only way to get the mouse location is by this trigger.
Regarding the quick click question, would it not just be easy to add a check that waits until the trigger is on before turning it off so it does not stay on?
@Mille25: Go
How about a trigger with condition? Would that just as good as turning it on/off?
Ok so the information i have got from is is in the pictures below, from what i understand this is the best solution?
As it is now, the trigger will not be on unless the player press down the mouse button.
Thank you :)
The only way i have found it to get the position is if its run in a event trigger that check if mouse is moved or clicked. I did the loop inside that trigger hoping it would update it but it only get the value of the mouse location the instant the trigger runs and not while it runs. So the only way to make this work well is if we find a way to get mouse position without running it in a trigger.
To put it plain, blizzard have not included that function as far as i know :(
@BasharTeg: Go
Yes i would really like to do that but if you can make an example map of that very easy thing that i would be extremely happy because i can't do it at all.
If you can show me that one simple row on how to load a variable with the mouse coordinates then that would solve all problems. So far many have said to do just that and even i would have said it but i have not found one single way to do it.
Here i even made a sample map for you, all you have to do is fix the variable.
I understand what you say but i don't understand how to store the mouse position without using the trigger. The only way to get the mouse location is from the trigger when mouse is moved or clicked.
If you can show how to "get" the mouse location without using the value in the image then i would be very happy!
I'm sorry, i dont fully understand what you mean.
I have a diablo like movement system. Unit follow mouse when left mouse btn down. I have to updating the mouse location on mouse movement but i have heard that doing this make it run the trigger like crazy and this causes lag on the server (locally its fine). So what i want to do it get the mouse move location without running the mouse move trigger over and over. Best solution so far is to limit the amount of time the trigger can run and with some testing i have set it to 0.06 real time seconds. This give me strangely enough 8 times per real time seconds (did run some test triggers to measure this) witch is in fact 0,125 per trigger and not 0.06.
To make it super simple, i want as little trigger as possible to run to reduce lag.
I did it like this. Now it turn the trigger off for 0.01 sec and then turn it on again. Best solution i have so far but the response is a bit slow.
dont worry about the other player thing, i just want it working for one player atm, i just make one trigger for each player
I tested like in the image now but still the exact same result.
I have been told that running the mouse move trigger to get the mouse location is a bad thing (lags the game), better to run it in a loop then executing new triggers. I have been trying this but i cant seam to get the new mouse location in the world unless i use that trigger its like it only update one time and that is when that trigger run so a while loop.
Any suggestions or solutions to it?