• 0

    posted a message on Unit Local Variables

    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

    Posted in: Data
  • 0

    posted a message on General help is needed(local variables)

    iE4TM4PS, I appreciate the response.

    Arrays wont really help me since the amount of units/groups of units is determined by how the game unfolds so there really is no way to track it.

    Placing units into a new unit group as they enter might work, I would have to implement a delay for the final attack order, without one it would just reassign and reorder 1 at a time, just like the way it does now. It also made me think of placing a small region inside a larger region and once the first unit in the wave enters the smaller region I can send an issue to all units in the larger region to change direction(this would hopefully prevent some of the stuttering issues).

    unit uses ability wouldnt help unless the unit was constantly using the ability, in this case the unit is simply responding to a toggle command. I actually have this working right now by having the toggle ability apply a buff, then checking if a unit has that buff behavior as it enters the region of the switch point. This lets me redirect units with single unit precision or large selection groups.

    Thanks again for the input, think I have the basics of my original questions working desirably right now. I'm sure ill be back later with something else i broke(like the 4 hours it took me to figure out why an ability wasnt showing up in game, until i placed an empty behavior in it /wrist)

    -Trenan

    Posted in: Triggers
  • 0

    posted a message on General help is needed(local variables)

    *Edit: Created a toggle ability for each unit which allows you to specify which lane they will attempt to move towards at a switch point. I am effectively using this as a local variable for the unit. It also displays a buff on the unit allowing you to mouse over and check where they will be going at a switch point(which was a nice unintended side effect)

    So basically instead of checking for an activated ability, it checks if the unit is being modified by a certain behavoir*

    Greetings,

    I am currently working on a DOTA style map. However, there are no champions, instead you control the movement of the units spawning down the lanes. The movement of the units is supposed to mimic a rail system, always going forward and not stopping(only to attack) and can only change paths on certain "swtich points".

    I've ran into some fundamental problems which are really hurting me in the developement of the map, i feel the functionality exists but I am just unable to locate it.

    • Would some of the functionality show up is I created variables or flags in the data editor for the specific cases I need? I do not recall a space in the data editor for creating local variables for units *

    1) Can I access local variables(preferably for a unit) other than during the trigger in which they are created?

    • basically need this for creating a pathing system, to check which point in the path they are at. Could also be helpful for other things*

    Triggering unit enters within .5 of Point Top Lane 1

    set variable previousPoint = Point Top Lane 1

    2) How can I access the local unit group of a unit?(every trigger asks me for the name, which I cannot give since they are dynamically generated units)

    • moving waves of units looks tacky using a distance check or region enter, as they tend to fight over pathfinding space, could be prevented if I could give the order to the entire unit group instead of "triggering unit" 1 at a time.*

    Any Unit belonging to player 1 enters region Region Bottom Lane Middle

    Order Triggering Unit's Unit Group to attack point targetting Point Middle Lane Middle

    3) How to check if a certain ability is currently activated?

    • the flags provided in the editor are very limited and mostly involve resources, I would like to check if an ability is currently toggled on, there is an "ability executing" flag, but have not had the opportunity to test it. All units have 3 standard abilities which toggle which lane they will go to after hitting a switch point*

    If Set Path Middle == True/activated/on

    Command unit down path towards middle lane

    Thanks,

    -Trenan

    Posted in: Triggers
  • To post a comment, please or register a new account.