Is there anyway to create a new data field or insert a local variable into a unit in the data editor which can then be used for checking conditions?
I essentially would like to know which previous point the unit is coming from, to prevent back tracking. This means a unit moving from the top lane to the middle lane would only be able to go up the middle lane or continue towards the bottom lane, without the option to go back up through the path they were just on.
I really dont know of a way of doing this without having a local variable for the unit and placing a value there whenever it enters a lane. The trigger would appear something like this:
Any unit enters region Middle;
if unit previous lane == top;
order unit attack targeting point middle tower;
else if;
unit has behavior pathtobottom;
order unit attack targeting point bottom lane;
Or, what if i place the unit in a Global Unit Group belonging to either Top, Middle, Bottom and I could possibly use that as a check for which lane they were coming from? So just change the above trigger to check if unit belongs to unit group top lane...?(then change their unit group to the lane in which they have entered)
Unit any unit enters region middle;
Triggering unit is in Unit Group Top Lane == True;
unit order triggering unit to attack targeting point middle tower;
Think the unit group method will work, however would still like to know if theres a way to store a variable locally in a unit, thanks.
-Trenan
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Is there anyway to create a new data field or insert a local variable into a unit in the data editor which can then be used for checking conditions?
I essentially would like to know which previous point the unit is coming from, to prevent back tracking. This means a unit moving from the top lane to the middle lane would only be able to go up the middle lane or continue towards the bottom lane, without the option to go back up through the path they were just on.
I really dont know of a way of doing this without having a local variable for the unit and placing a value there whenever it enters a lane. The trigger would appear something like this:
Any unit enters region Middle;
if unit previous lane == top;
order unit attack targeting point middle tower;
else if;
unit has behavior pathtobottom;
order unit attack targeting point bottom lane;
Or, what if i place the unit in a Global Unit Group belonging to either Top, Middle, Bottom and I could possibly use that as a check for which lane they were coming from? So just change the above trigger to check if unit belongs to unit group top lane...?(then change their unit group to the lane in which they have entered)
Unit any unit enters region middle;
Triggering unit is in Unit Group Top Lane == True;
unit order triggering unit to attack targeting point middle tower;
Think the unit group method will work, however would still like to know if theres a way to store a variable locally in a unit, thanks.
-Trenan