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

DRIVING ME CRAZY: Dummy Units

Status
Not open for further replies.
Level 2
Joined
Sep 2, 2004
Messages
15
Code:
function Trig_Carrion_Swarm_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A00I' 
endfunction

function Trig_Carrion_Swarm_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local location l = GetSpellTargetLoc()
    local unit d = CreateDummy( GetOwningPlayer(u), u, 'A00M', GetUnitAbilityLevel(u, 'A00I'), 5)
    call IssuePointOrderLocBJ( d, "carrionswarm", l )
    call PolledWait(0.5)
    call SetUnitPositionLoc( u, l )
    call RemoveLocation(l)
    set l = null
    set u = null
    set d = null
endfunction

//===========================================================================
function InitTrig_Carrion_Swarm takes nothing returns nothing
    set gg_trg_Carrion_Swarm = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventNL( gg_trg_Carrion_Swarm, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Carrion_Swarm, Condition( function Trig_Carrion_Swarm_Conditions ) )
    call TriggerAddAction( gg_trg_Carrion_Swarm, function Trig_Carrion_Swarm_Actions )
endfunction

The dummy unit won't cast Carrion Swarm.

I've gone into the dummy unit and I've made him completely visible. I can physically lcick on him and see tha the has the Carrion Swarm spell, and can cast it, so the issue isn't that.

I know I use a BJ here, I've tried not using a BJ as well.
 
Thank you for the response. At this time I have done what you have requested, as I have been working on debugging this issue for a while now.. It's really driving me crazy.

I've broken it down to this point:

The event is firing.
The unit is being created.
The unit is given the Carrion Swarm ability, with the right level.
The caster unit is being teleported to the location.

Every line of code works - it's as if the IssuePointOrder line is commented out.

I've used other dummy's, tried using a global unit. The dummy is able to cast other spells no problems.

There are screenshots in this thread

http://www.wc3c.net/showthread.php?t=107056

I'm refreshing this page like crazy. I really want to fix this issue, so if any more information is needed I'll get it to you right away. In the meantime, I'm continueing different methods to isolate the issue.

Code:
function CreateDummy takes player whichPlayer, unit whichUnit, integer abilityID, integer level, real life returns unit
    local unit d = CreateUnit( whichPlayer, 'h002', GetUnitX( whichUnit), GetUnitY(whichUnit), 0 )
    call UnitApplyTimedLife( d, 'BTLF', life)
    call UnitAddAbility( d, abilityID)
    call SetUnitAbilityLevel( d, abilityID, level)
    return d
endfunction

TriggerRegisterEvent is the same as the BJ, except it's leakless.

This was my response taken from another forum ( Yes, I have this issue on every forum I know. )
 
maybe the ability costs mana and your dummy has none? or the ability has a cooldown also why don't you create the dummy in your trigger the normal way? just make
JASS:
set d = CreateUnit( player p , integer rawcode , GetLocationX(l) , GetLocationY(l) , 0)
call UnitAddAbility(d , id)
call IssuePointOrder(d , "carrionswarm",GetLocationX(l) , GetLocationY(l))
call RemoveUnit(d)
call RemoveLocation(l)
set l = null
set d = null
 
Are you wanting it to cast it on its own? Or its not casting when you click the ability button. I didn't quite understand your question.
 
Status
Not open for further replies.
Back
Top