I know I saw a way to make a unit always go towards a player's mouse, but I forget what trigger it is. I could easily impliment this feature in space battles and races. Can someone please tell me what that was?
Well its very simple just use the Event- Player mouse moved and then use Unit- Issue Order Targeting Point XY and use Player Mouse moved X and Player mouse moved Y to get that point.
However this brings up another problem, if the player keeps his/her mouse in the same position and does not move it then the unit will only move when the mouse is moved, so you should set it up this way
Event- Player moves mouse
Actions-
Set Variable X[PlayerNumber]= Mouse Moved X
Set Variable Y[PlayerNumber]= Mouse Moved Y
Then set up another loop trigger
Event- Timer Every X seconds of Game Time (or Real Time)
Actions-
For each player in Player Group (Your Player Group)
Unit Issue Order Targeting Point XY (X[Picked Player Number], Y[Picked Player Number])
You will probably have to set up separate triggers to store the unit you want to move, if you need that too let me know
EDIT: the spacing isnt working for some reason
EDIT2: you could also use data tables its just your preference really
sorry for the late response but i made a test map for you :D
to create a variable click the top left button with the "X=" make sure you make it the correct type for what you need it for, if you need a single variable to hold multiple values check Array, and set the number of values you need it to hold
I know I saw a way to make a unit always go towards a player's mouse, but I forget what trigger it is. I could easily impliment this feature in space battles and races. Can someone please tell me what that was?
@Reaper872: Go
Well its very simple just use the Event- Player mouse moved and then use Unit- Issue Order Targeting Point XY and use Player Mouse moved X and Player mouse moved Y to get that point.
However this brings up another problem, if the player keeps his/her mouse in the same position and does not move it then the unit will only move when the mouse is moved, so you should set it up this way
Event- Player moves mouse
Actions- Set Variable X[PlayerNumber]= Mouse Moved X
Set Variable Y[PlayerNumber]= Mouse Moved Y
Then set up another loop trigger
Event- Timer Every X seconds of Game Time (or Real Time)
Actions- For each player in Player Group (Your Player Group)
Unit Issue Order Targeting Point XY (X[Picked Player Number], Y[Picked Player Number])
You will probably have to set up separate triggers to store the unit you want to move, if you need that too let me know
EDIT: the spacing isnt working for some reason EDIT2: you could also use data tables its just your preference really
So how do I set up the variables? Sorry, new at this... I can't make variables equal each other without having a variable to set, lol.
@Reaper872: Go
sorry for the late response but i made a test map for you :D
to create a variable click the top left button with the "X=" make sure you make it the correct type for what you need it for, if you need a single variable to hold multiple values check Array, and set the number of values you need it to hold
o ok, thanks. I just wasn't sure... integer unit, unit group, player ect. Its all so confusing what to do about what.