• 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 change that trigger to give ability for all units?

Status
Not open for further replies.
Level 7
Joined
Dec 5, 2013
Messages
280
function Trig_Infernal_Func001002 takes nothing returns nothing
call UnitAddAbilityBJ( 'AHbz', GroupPickRandomUnit(GetUnitsOfTypeIdAll('H008')) )
endfunction

function Trig_Infernal_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_Infernal_Func001002 )
endfunction

//===========================================================================
function InitTrig_Infernal takes nothing returns nothing
set gg_trg_Infernal = CreateTrigger( )
call TriggerAddAction( gg_trg_Infernal, function Trig_Infernal_Actions )
endfunction

This trigger now gives Blizzard to only random units of the unit type. I want to give the ability for all units. This was originally GUI trigger, then i converted it into a custom text.
 
Why didn't you just post the GUI trigger?

  • Actions
    • Set group = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to UNIT-TYPE))
    • Unit Group - Pick every unit in group and do (Actions)
      • Loop - Actions
        • Unit - Add Ability to (Picked unit)
    • Custom script: call DestroyGroup(udg_group)
Here's a proper JASS version:

JASS:
function Trig_Infernal_Actions takes nothing returns nothing
    local group g = CreateGroup()
    local unit u  = null
    
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, null)
    
    set u = FirstOfGroup(g)
    loop
        exitwhen u == null
        if (GetUnitTypeId(u) == 'H008') then
            call UnitAddAbility(u, 'AHbz')
        endif
        call GroupRemoveUnit(g, u)
        set u = FirstOfGroup(g)
    endloop
    
    call DestroyGroup(g)
    set g = null
endfunction

//===========================================================================
function InitTrig_Infernal takes nothing returns nothing
    set gg_trg_Infernal = CreateTrigger()
    // some event
    call TriggerAddAction(gg_trg_Infernal, function Trig_Infernal_Actions)
endfunction
 
Level 7
Joined
Dec 5, 2013
Messages
280
I copypasted that code as it is, nothing added, brings those two lines of error.

I would build this trigger as GUI, but I cant figure out how
 
I copypasted that code as it is, nothing added, brings those two lines of error.
Check the demo map.

It compiles just fine your error is elsewhere. Make sure the trigger is titled "Infernal".

I would build this trigger as GUI, but I cant figure out how

I've already provided it in GUI for you..
 

Attachments

  • Foxace.w3m
    12.2 KB · Views: 25
Level 7
Joined
Dec 5, 2013
Messages
280
It started to work

Where can I see list of code names of all abilities? I would like to change that spell
 
Level 7
Joined
Dec 5, 2013
Messages
280
Thank you. In addition i would like to change the visuals of spells. I have managed to create different effects on top of the original effect but I want to replace the original, and i want to have effect for the whole duration of spell

Where can I see list of all possible locations for effect? default is overhead

Also, is begins channeling the ability only working option? And i want new effect for all units of the unit type that cast the spell, for now i only know how to create this for one unit
 
Level 7
Joined
Mar 6, 2006
Messages
282
Thank you. In addition i would like to change the visuals of spells. I have managed to create different effects on top of the original effect but I want to replace the original, and i want to have effect for the whole duration of spell

For replacing the effects the spell already has, it depends on what spell it is. Some spells allow you to have art in places, and others don't. If there is an effect you would like, and the spell doesn't support it (you can choose the effect but it just won't show), then you need to trigger it.

  • Special Effect - Create a special effect attached to the overhead of (Picked unit) using spellpath
  • Special Effect - Destroy (Last created special effect)
Where can I see list of all possible locations for effect? default is overhead

They're called attachment points. A quick google will give you the list, here's one:

http://www.hiveworkshop.com/forums/411139-post2.html

Also, is begins channeling the ability only working option?

The proper one to use is "Generic Unit Event - A unit starts the effect of an ability"

And i want new effect for all units of the unit type that cast the spell, for now i only know how to create this for one unit

Put the special effect action in the Unit Group loop.

  • Unit Group - Pick every unit in group and do actions
    • Special Effect - Create
    • Special Effect - Destroy
    • other stuff
 
Level 7
Joined
Dec 5, 2013
Messages
280
Problem is that the animation only appears once, effect needs to loop for the duration of the spell

Also how to create event for unit group? I only can figure out how to create event for single unit
 
Status
Not open for further replies.
Top