Storing Current Commands To Resume Them After A "Stop" Command

WolfieeifloW

WEHZ Helper
Reaction score
372
I have a trigger for a spell to drain mana per second.
If the unit doesn't have enough mana, the trigger turns the spell off:
Code:
Else - Actions
    Unit - Order dashingUnit to Human Footman - Stop Defend
    Trigger - Turn off (This trigger)
However, I want the unit to resume what he/she was doing before it was ordered to "stop", instead of just standing there when it's issued this order.
So I'm wondering how to do that ;) ?

Thanks in advance TH.net!
 

Deele

New Member
Reaction score
0
There is variable type Order. Store Issued order into that variable before issuing an order, to stop that hero from moving.
Code:
Set OrderVariable = (Issued order)
Or maybe, I did not understood what do you want...
 

eXirrah

New Member
Reaction score
51
What he wants is a way to order the unit the last order.

There is no other way than to check which was it's last order.
Store the order in a variable like deele said.
and then use ifs
if the order in variable is equal to attack, then issue the unit to attack
if the order in variable is equal to move, then issue the unit to move

This will not be in any case MUI though. You need to store the point/target of the order in other variable as well.

Note: btw use "it" when talking about unit and "she/he" when talking about player. The unit is not a person :)
 

Deele

New Member
Reaction score
0
Warcraft editor does not allow issue a custom order to unit...
There should be a way to solve this one with JASS, but unfortunately I don't know it...
 

eXirrah

New Member
Reaction score
51
WE doesn't allow you to use custom order, cause of the types of order you might wanna issue.

There are 3 types of orders
1. Targeting a point.
2. With no target
3. Targeting an object.

So even in JASS you can't make the unit to move at no point.

That's why I told you to check with ifs what the order is and order it from the warcraft presets
Trigger:
  • if
    • conditions
      • varOrder equals to Move
    • actions
      • Unit - issue unit to move at varOrderPoint
    • else
      • do nothing
    • .... more ifs for all kind of orders the unit has
 

WolfieeifloW

WEHZ Helper
Reaction score
372
These can't be the solutions :confused: .
DotA has it all throughout it's map, where you use a skill and continue on your way without stopping.
 

WindexIsBack

New Member
Reaction score
100
There are multiple ways to do it.

First way, is to record whenever a unit is ordered. This than records the info into the units string, or something similiar (units string could point to an array for a string varaible which holds the units info, for example)
First 2 digits could represent what kind of order it was. Attack, patrol, ect.
Next 5 digits would represent the order location (X and Y)
It is HIGHLy recommend you add 24,000 to both X and Y coordinates. This will remove the - position values.

When triggers order the unit, it should not be recorded. It's even possible in GUI, but not recommended.
 

averes

New Member
Reaction score
17
This may work. Probably would be better written in JASS though, but here it is in GUI first.

Code:
Add Order
    Events
        Unit - A unit enters (Entire map)
    Conditions
    Actions
        Trigger - Add to Set Order <gen> the event (Unit - (Entering unit) Is issued an order targeting a point)
        Trigger - Add to Follow Order <gen> the event (Unit - (Entering unit) Is issued an order targeting an object)
Code:
Set Order
    Events
    Conditions
    Actions
        Set LastOrder[UnitValue] = (Issued order)
        Unit - Set the custom value of (Ordered unit) to UnitValue
        Set UnitDest[(Custom value of (Ordered unit))] = (Target point of issued order)
        Set UnitValue = (UnitValue + 1)
Code:
Follow Order
    Events
    Conditions
        And - All (Conditions) are true
            Conditions
                (Issued order) Not equal to (Order(attack))
                (Issued order) Not equal to (Order(smart))
    Actions
        Wait 0.40 seconds
        Unit - Order (Ordered unit) to LastOrder[(Custom value of (Ordered unit))] UnitDest[(Custom value of (Ordered unit))]
        Custom script: call RemoveLocation(udg_UnitDest[GetUnitUserData(GetOrderedUnit())])

It's 3 triggers, you need an order array, a location array, and a integer variables. You may need to add a delay in before it issues the order, otherwise it may cancel it out. Delays in GUI are pretty bad though, so that may destroy this whole thing.

EDIT: eXirrah, chill out. Your wrong anyway. Its not an invalid line its GUI. Your also wrong about pretty much everything else. The if conditions can be avoided with the added condition in the updated trigger and using waits your able to do it fairly well. It's MUI. If you had an array of wait times to use for various abilities it would be very plausible. It may not be the best way of doing it but it would work.

EDIT: I see why you thought that. The function to take an order string is from WEU. Just get the new gen.
 

eXirrah

New Member
Reaction score
51
There is no way to do that man ... I already explained why, and explained how it must be done. If you read my post you will understand why it is not possible.

EDIT:
To WindexIsBack: what happens if the order is issued at object and not coordinates ?
To WolfieNoCT: I doubt that IceFrog has created some method of breaking WE function limits and order the units to do something by just 2-3 lines of code.
It is most possible that he did it my way actually cause JASS or GUI I see no other way. Store the order in some variable. Store the target point/target object in some other variable. and after the spell is cast he will need to check if the order is issued at point,object or no target. At least these 3 ifs are required and there is no going arround them.

Unit - Order (Ordered unit) to LastOrder[(Custom value of (Ordered unit))] UnitDest[(Custom value of (Ordered unit))] <- invalid line

WE doesn't let you use variables in that command, but only presets
 

WolfieeifloW

WEHZ Helper
Reaction score
372
I'm just going to order the unit to Attack Move to a point 300 units in the direction he is going after the Stop Defend.
Code:
Else - Actions
    Unit - Order dashingUnit to Human Footman - Stop Defend
    Set tempPoint = (Position of dashingUnit)
    Set tempOffset = (tempPoint offset by 1000.00 towards (Facing of dashingUnit) degrees)
    Unit - Order dashingUnit to Attack-Move To tempOffset
    Custom script:   call RemoveLocation(udg_tempOffset)
    Custom script:   call RemoveLocation(udg_tempPoint)
    Trigger - Turn off (This trigger)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top