• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

making a unit use an ability via triggers

Status
Not open for further replies.

Anonymouse

A

Anonymouse

I was a bit unclear on my precious thread, what i need help with right now is how to make a unit use a custom ability it has using a trigger. I cant find it hidden anywhere in the actions.
 
Events: unit is attacked
Conditions: Random integer between 1 and 10 equals 6
Unit is not owned by team 1 or team 4
Actions: ??

In other words, whats the action for making a unit fighting one of mine cast an ability that it has but wont use on its own.
 
It depends; what ability?
The actions to custom-cast an ability are:
  • Unit - Issue an order targeting a unit
  • Unit - Issue an order targeting a point
  • Unit - Issue an order with no target
If your ability is targeting a unit, have the first action, if it is a point target ability, the seconds and if it has no target (e.g. Howl of Terror), the third action.
 
he is talkin about a custom abilty, and for as much as i know this command dosnt do that job (it even uses the defoult values for the original abilitys).
 
''Issue Order Targeting A Unit/Point/No Target'' can cast custom abilities.

For example:
  • Unit - Order (Last created unit) to Orc Raider - Ensnare (Attacked unit)
This function will order <Last Created Unit> to cast any ability based on ''Ensnare'' (or channel with ''ensnare'' Base Order ID) on <Attacked Unit>

If you convert this in JASS, you will get this:
JASS:
call IssueTargetOrderBJ( GetLastCreatedUnit(), "ensnare", GetAttackedUnitBJ() )

Each ability has ''Text - Order String Use/Turn On'', so that function orders unit to cast ability with ''ensnare Order''
60089d1247135170-non-battle-autocast-ensanre.jpg
 
hmmm.. i dont get it, if i have ensnare and a custom ability with the same order string, which will it cast?

and is it possible to just write a new order string?
 
hmmm.. i dont get it, if i have ensnare and a custom ability with the same order string, which will it cast?

and is it possible to just write a new order string?


Well, unit can only cast ability it has. So if it has only one of the abilities nothing bad will happen. If unit has both then bad things happen.
Fix it by changing order string on one of em. Preferably custom ability.
 
Status
Not open for further replies.
Back
Top