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

Changing the missile

Level 3
Joined
Apr 16, 2025
Messages
21
Hello. I created an item that when activated gives the hero barrage for 5 seconds, like it temporarily attacks three targets. The problem is that I can't change the projectile type for each individual hero. I'm trying to determine the projectile type of the hero (it seems easy) and change the projectile type of the ability using triggers, but for some reason the last step doesn't work. I called the trigger that replaces the string "amat", but it doesn't work. What am I doing wrong?

Sorry, I had to convert GUI to JASS because my editor is in a different language.
JASS:
function Trig_trrtttyty__________________________________________u_Actions takes nothing returns nothing
    call BlzSetAbilityStringLevelFieldBJ( BlzGetUnitAbility(GetTriggerUnit(), 'Aroc'), ABILITY_SLF_MISSILE_ART, ( GetUnitAbilityLevelSwapped('Aroc', GetTriggerUnit()) - 1 ), "Abilities\\Spells\\Other\\BlackArrow\\BlackArrowMissile.mdl" )
endfunction
 

Attachments

  • 123.png
    123.png
    49.6 KB · Views: 12
Last edited:
Level 14
Joined
Jan 10, 2023
Messages
260
Last I knew many of those BlzSetAbilityBlahField()/BlzSetUnitBlahField() functions don't work for some fields.

This should be easy to test if you debug some of those values.
I would use BJDebugMsg() to test what level it is "Get"ing from the unit, and then input 0 and 1 directly for the level to see if it prefers one of them, I want to say it wants level "0" for level 1..

I get suspicious of the ones that are "LevelFields" but don't change per level, still I think many of them do work even not having a value that changes with level.
 
Level 3
Joined
Apr 16, 2025
Messages
21
Last I knew many of those BlzSetAbilityBlahField()/BlzSetUnitBlahField() functions don't work for some fields.

This should be easy to test if you debug some of those values.
I would use BJDebugMsg() to test what level it is "Get"ing from the unit, and then input 0 and 1 directly for the level to see if it prefers one of them, I want to say it wants level "0" for level 1..

I get suspicious of the ones that are "LevelFields" but don't change per level, still I think many of them do work even not having a value that changes with level.
The funny thing is that this field is not divided into levels. It applies to all levels...
 
Level 14
Joined
Jan 10, 2023
Messages
260
That's what I was getting at here:
I get suspicious of the ones that are "LevelFields" but don't change per level, still I think many of them do work even not having a value that changes with level.

I might be able to test it for you later, depending on how what I'm working on goes.

When in doubt BJDebugMsg() everything!
 
Level 14
Joined
Jan 10, 2023
Messages
260
Missile Art is not a level field, it is a string field last I remember.

Also, since Barrage is a passive, Increase and Decrease ability level directly after you change the parameter. Otherwise, your change won't be saved into the ability.
The only thing that was making me hesitate to say that is the constant's name ABILITY_SLF_MISSILE_ART, the SLF part, but they've been inconsistent enough so far with their variable names lol it's worth ruling out.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,896
I tried every trick in the book but couldn't get it to work. Missile Art is setup to be a Level String field which doesn't make any sense since it's a single field that's shared between all Levels. Safe to assume that it was never implemented or just implemented incorrectly.

@Wing-Span
The solution is to create a unique Barrage ability for each ranged Hero, and Add the appropriate one in response to using the item. I attached an example map. EDIT: Here's an explanation if you're confused.

Step 1) Copy and paste the Unit Indexer folder into your map. Ensure that you don't already have one of these in your map (you likely do not).
Step 2) Copy and paste the Barrage folder into your map.
Step 3) Update the Barrage Item Setup trigger to reference your Barrage abilities and the Heroes that use those abilities. You must match the [indexes]:
  • Barrage Item Setup
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Define how many Barrage abilities you have in total: --------
      • Set VariableSet Barrage_Array_Total = 2
      • -------- --------
      • -------- Define the first hero / ability pairing: --------
      • Set VariableSet Barrage_Array_Heroes[1] = Archmage
      • Set VariableSet Barrage_Array_Abilities[1] = Barrage (Archmage)
      • -------- --------
      • -------- Define the second hero / ability pairing: --------
      • Set VariableSet Barrage_Array_Heroes[2] = Keeper of the Grove
      • Set VariableSet Barrage_Array_Abilities[2] = Barrage (Kotg)
      • -------- --------
      • -------- Define the third hero / ability pairing... and so on for every single combination. --------
Step 4) Update the Conditions in the Barrage Item Use trigger to match your own Item ability:
  • Barrage Item Use
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Barrage (Item - Activate)
    • Actions
Step 5) In that same trigger you can customize the Duration of Barrage. I've set it to 5.00 seconds based on what you said in your first post:
  • Set VariableSet Barrage_Caster_Duration[Barrage_CV] = 5.00
 

Attachments

  • Barrage New Art 1.w3m
    25.1 KB · Views: 0
Last edited:
Top