• 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.

How to force a computer player to channel a spell?

Status
Not open for further replies.
Level 7
Joined
Mar 16, 2014
Messages
169
I can order a unit to cast my spell in question just fine, that is not an issue. The problem is the computer player will get distracted and do something else instead, stopping the channel when I want them to continue it.

The spell I want the computer to channel is a custom version of tornado, if that's relevant.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Not too sure about this one. Do you have any triggers that issue orders to the computers? Because if it's one of your triggers like a periodic event that orders computer units to attack/move then you can add conditions to it to prevent it from ordering a unit that's currently channeling.

Anyway, if there's no easy solution than here's an idea that MIGHT work:

1) Create an ability based on Channel, set the follow through time to 1000+ seconds, uncheck Disable Other Abilities, make it Instant, set cd/mana cost to 0, and make sure it's not Visible. Add this ability to your computer unit.
2) Create an ability that targets a point but does nothing. This is your "fake" Tornado ability. Add this ability to your computer unit.
3) Detect when the computer casts the "fake" Tornado ability and create a Dummy unit. Order the Dummy to cast the "real" Tornado ability instead. You'll need to link the Dummy and the Computer Unit to one another using a Hashtable/Unit Indexer/Dynamic Indexing/whatever you're comfortable with.
4) Then put the computer unit in a "channeling" Unit Group and order it unit to cast the Channel ability.
5) Then create a trigger that runs whenever a unit is issued an order targeting a point/object.
6) Add conditions to this new trigger to check if the unit is in your channeling Unit Group. If it is, order the computer unit to cast the Channel ability again instead of doing the original issued order.
7) Have another trigger that checks when a unit in the channeling Unit Group issues an order to "stop". My theory is that the "stop" order will only occur if the computer unit is stunned/silenced/rooted/etc...
8) Remove the dummy unit in response to the "stop" order.
9) Have another trigger that runs when the Dummy stops casting Tornado. When it stops casting the ability order the computer unit to "stop" and remove it from the Channel Group.

This will create the illusion that the Computer Unit is channeling the Tornado ability when in reality it's the Dummy unit. I haven't tested this yet so it might not work. It might not even be necessary...
 
Last edited:
Status
Not open for further replies.
Top