• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Is it possible to make a unit ignore a specific given order?

Status
Not open for further replies.
Level 10
Joined
Oct 5, 2008
Messages
355
Hello there,

As my search unfortunally haven't brought anything, i try to tickle the hive-mind if someone got an idea to solve the particular problem:

The situation:

There are multiple occasions where i would like to give out an order without really ordering the unit to move, like ordering a point-targeted skill while the unit is walking without interupting the move. The same with channeling skills to order a channel with right click to move certain parts of it in a direction without breaking the channeling. Or in my last project, where an acolyte targeting a tree should result in a different behaviour than the acolyte trying to harvest the tree. Or a taunted unit being held back from attacking by spamming the stop command.

As I know, there are some workarounds definetly possible, but most of them involving making it impossible to cancel the channeling or involve unintuitive controls (like the tornado ability needing you to click the tornado and order it around).
My last resort now would be to trigger a system which replicates the last order a unit is given and reorders that whenever a unit is given an invalid order, which is doable, but really annoying and still hits some limitations (because the unit is just reordered to do what it wanted and not stopped from it in the first place).

So my question would be if there is any way to stop a unit from receiving a specific order (with other orders still being proceeded as normal) or a way to receive an order via events (which is currently known and possible) and then stopping its execution?

Thank you in advance.
 
Perhaps these libraries might be of interest:

LastOrder - Wc3C.net -> Gets the 3 last issued orders.
[vJASS] - Order Matrix -> Same thing, but it's unfiltered and on Hiveworkshop.

You can get the previous orders from there and re-issue it (of course, watch out for infinite trigger loops.)
 
Last edited:
Level 10
Joined
Oct 5, 2008
Messages
355
These will really help and remove the need to make a system myself for that, thank you!

That said, it will probably still causse the canceling of channeling skills, which is annoying, but workaroundable, since i got a custom cooldown system already in place in my project (pre 1.29, so its an MPI system which just removes dummies which are conditions for the skills, but it works for me and wc3 even with 1.29 doesn't have ways to trigger cooldowns without recasting the skill i know of, so there we go.).
 
Level 40
Joined
Feb 27, 2007
Messages
5,094
like ordering a point-targeted skill while the unit is walking without interupting the move
Something like that wouldn't cast anyway unless you casting unit had 0 cast point, 0 cast backswing, and no animations on the skill. Otherwise the unit does take some finite amount of time to cast before resuming walking.

If you set those values to 0 for all your units and triggered spell animations yourself (with copious dummies to cast the actual spells when needed) then this might be doable. You could also intercept orders given while the unit is moving and continue to manually move the unit while it is casting with SetUnitX/Y which don't interrupt units' current orders when used.
 
Level 10
Joined
Oct 5, 2008
Messages
355
Thats why i am asking this in the first place. Reordering the whole thing would interrupt, but if i would be able to get the order and then just skip it, the unit wouldnt stop moving at all. What i had in mind was that i would only get the order and then manually set the ability on cooldown and fire the skill i had in mind, so the unit woudln't cast the ability at all, the triggerwork would emulate the cast.

But the idea is good. I already trigger all the spells in the project myself anyway, so emulating the proceding of the movement shouldn't be too much of a hassle.
 
Status
Not open for further replies.
Top