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 The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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