• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

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.
 
Level 2
Joined
Sep 2, 2004
Messages
15
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. )
 
Level 8
Joined
Feb 15, 2009
Messages
463
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
 
Level 4
Joined
Jul 9, 2008
Messages
88
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.
Top