Making an autocast that doesnt autocast

Level 1
Joined
Nov 24, 2024
Messages
2
Hello everyone, I've been trying to make a new kind of autocast ability in terms of ai and auto usage conditions. I've been unable to find an appropriate existing autocast ability to base my new ability off of, so I'm at the point where I'm trying to come up with an autocast ability that both: will cast on a target friendly unit when manually activated like a standard spell, but won't autocast normally under any circumstances even when autocast is turned on. This is because I'm intending to control the autocast behavior through triggers alone. I tried to use the Inner Fire ability, setting the "Data - Autocast Range" field to a very low value, but it didn't seem to affect the casting unit's behavior at all. I was also able to get close to what I wanted by making a searing arrow that targets friendly units, but it wasn't perfect since it'd activate when auto attacking friendly targets and involved an auto attack in the cast. I'm still trying to brainstorm this, but wondering if anyone else has any ideas. Thanks!
 
Level 1
Joined
Nov 24, 2024
Messages
2
Well I could use a standard cast ability and have it casted automatically through triggers, that would be a technically functional option, but I'd really like to have the option to enable and disable the autocasting like any other autocast, integrating the activation/deactivation into the casting behavior triggers.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Well I could use a standard cast ability and have it casted automatically through triggers, that would be a technically functional option, but I'd really like to have the option to enable and disable the autocasting like any other autocast.
I see, if you cannot find an ability that works then you can try the following:

I'll use Bloodlust as the example here.

Make a trigger that cancels the Issued Order event if Autocasting is enabled:
  • Cancel Order
    • Events
      • Unit - A unit issued an order targeting an object
    • Conditions
      • (Level of Bloodlust for (Triggering unit)) Greater than 0
      • (Issued order) Equal to (Order("bloodlust"))
      • Is_Autocast_Enabled[(Custom value of (Triggering unit))] Equal to True
    • Actions
      • Set Variable Unit = (Triggering unit)
      • Custom script: call BlzPauseUnitEx( udg_Unit, true )
      • Unit - Order Unit to Stop
      • Custom script: call BlzPauseUnitEx( udg_Unit, false )
Then your triggers that manage the autocasting behavior would temporarily disable the previous trigger before issuing the order:
  • Custom AI
    • Events
      • ...
    • Conditions
    • Actions
      • Trigger - Turn off Cancel Order
      • Unit - Order YourUnit to Orc - Bloodlust YourOtherUnit
      • Trigger - Turn on Cancel Order
That should prevent it from autocasting. Is_Autocast_Enabled is a Boolean array variable that is taking advantage of Unit Indexing. You would toggle it to TRUE and FALSE when your unit issues the "bloodluston" and "bloodlustoff" orders.

Of course if you can get what Chaosium suggested to work then that's a lot easier.
 
Level 30
Joined
Aug 29, 2012
Messages
1,382
I haven't tested it, but I've been surprised by autocast spells in the past, like a reverse inner fire and it turns out your own units know how to autocast it on enemies, so that pretty neat :)

One possible problem with Curse is that it may turn icons red in the control group, but heh one problem at a time :p
 
I haven't tested it, but I've been surprised by autocast spells in the past, like a reverse inner fire and it turns out your own units know how to autocast it on enemies, so that pretty neat :)

One possible problem with Curse is that it may turn icons red in the control group, but heh one problem at a time :p
Autocast abilities can be versatile like that, although theoretically even if it was a buff, if the targeting parameters was set to enemies they would still cast it on them :p

I also don't actually know what the desired outcome of this spell thingy is, it sounds like it's better to just make an autocast ability? Since right clicking will turn the autocasting on and off? I'm definitely missing something here 😰
 
Level 24
Joined
Feb 27, 2019
Messages
833
Its possible to manipulate at least targets allowed and to disable auto-cast behaviour by having multiple abilities with the same base ability on a unit. I made this example map for another thread. The Fake Heal has no targets allowed and is the ability that is shown in the command card, is what the player interacts with and is used as the ability that has auto cast turned on/off. The Real Heal is the ability that is cast when the player tries to manually cast the Fake Heal.
 

Attachments

  • Combined Targets Allowed Trick Auto.w3m
    18.4 KB · Views: 4
Top