• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Make it impossible to deactivate an auto-cast ability

Level 3
Joined
Jul 5, 2024
Messages
13
I'd like to enforce it so that the searing arrows ability can't be toggled off.

  • Untitled Trigger 002
    • Events
      • Unit - Flametrooper 0001 <gen> Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(unflamingarrows))
    • Actions
      • Custom script: call IssueImmediateOrder (GetTriggerUnit(), "flamingarrows")
Without a wait before the custom script this simply won't work. Any ideas?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
What is your end goal? Because it sounds like this could be solved by simply forcing the ability on from the get go and preventing it from being toggled entirely.

Unit enters map -> Toggle on searing -> Hide ability.

You could have a separate Ability act as it's icon, thus creating a "passive" Searing Arrows.
 
Level 3
Joined
Jul 5, 2024
Messages
13
i would like to have a passive ability but with the auto-cast border. Using a passive ability could be a workaround IF I could add a mana cost to it but thats not possible afaik. The auto-cast ability should cost mana and that should be visible in the header of the ability.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
i would like to have a passive ability but with the auto-cast border. Using a passive ability could be a workaround IF I could add a mana cost to it but thats not possible afaik. The auto-cast ability should cost mana and that should be visible in the header of the ability.
Okay, I found that this works, although it interrupts other orders:
  • Searing Arrows Toggle Fix
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Level of Searing Arrows (Passive) for (Triggering unit)) Equal to 1
      • (Issued order) Equal to (Order(unflamingarrows))
    • Actions
      • Unit - Pause (Triggering unit)
      • Unit - Unpause (Triggering unit)
 

Attachments

  • SearingArrowsPassive.w3m
    17.5 KB · Views: 5
Level 45
Joined
Feb 27, 2007
Messages
5,578
If you are not aware: Searing Arrows is an Orb effect, and a unit can only ever have one Orb effect active at a time natively in WC3. Some have priority and will overwrite others; Searing Arrows (and other auto cast attack modifiers) generally have priority over others. Examples of such Orb effects include Orb of Frost/Fire/Lightning/Slow/etc., Envenomed Spears, Liquid Fire, Lifesteal, Feedback, and many more things that modify attacks.

By giving this always-active Searing Arrows passive ability, you will disallow this unit from benefitting from any other Orb effect. If that’s fine and will not affect your map, then proceed as Uncle has shown. If that matters to you, you will need to find another solution.

To that end, I would suggest seeing if you can find an auto cast ability that will retain its autocast border status if the ability is disabled by a trigger or by a missing techtree requirement. It may be possible to ‘grey out’ the icon but keep the appearance of auto-cast. I would try things like Replenish Life/Mana, Frost Armor, Faerie Fire, etc. with something like this:
  • Give the spell a techtree requirement of some custom unit-type, such that the spell can’t be cast unless the owning player has one such unit.
  • Preplace one such unit on the map.
  • On game start, manually order the unit to autocast the spell (by yourself, no need to muck with triggers).
  • After it has been set to auto-cast, remove that requirement unit. You could make a trigger that removes it when you do something like enter a chat message or you could just kill it with another unit to be simple.
  • See if the ability still shows as autocast.
  • Instead of a requirement unit you could also disable the ability with the trigger action to do so, though in older versions of wc3 this does not have the option to keep the ability on the command card.
It may also just be worth your time to accept that the auto-cast border will not be possible on a passive skill. Why do you care specifically about showing this? If you are trying to imply something about its behavior you could make a custom icon with a different border (though it couldn’t be animated). If you actually want the Searing Arrows effect to trigger when the unit has enough mana, that’s another story. It is relatively easy to detect an attack and deduct mana from the attacking unit, if that is desired.

Exhume Corpses is a passive ability that can have a cooldown and mana cost. The quirks about getting it to cast ‘on-demand’ are detailed here: Passive ability with cooldown - Best method!
 
Level 3
Joined
Jul 5, 2024
Messages
13
Thank you, I was aware of the limitations. Playing around I stumbled across another bug, that giving abilities like searing arrows a CD won't trigger it when the unit auto-attacks. But there are workarounds for this luckily using triggers.

The idea is that the unit requires mana to attack, so having an auto-cast ability toggled on and showing a mana cost is the most beautiful solution that also makes most visual sense.

Thank you for the tip using Exhume Corpse. Checking it out
 
Top