• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

making a unit use an ability via triggers

Status
Not open for further replies.
Level 2
Joined
Jul 11, 2009
Messages
5
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.
 
Level 2
Joined
Jul 11, 2009
Messages
5
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.
 
Level 11
Joined
Jun 28, 2008
Messages
2,365
Each ability has its proper name. Look for it in object editor. Then just use 1 of the commands Pharaoh provided.
 
Level 7
Joined
Jul 29, 2009
Messages
276
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).
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
''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
 
Level 7
Joined
Jul 29, 2009
Messages
276
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?
 
Level 11
Joined
Jun 28, 2008
Messages
2,365
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.
Top