Dummy Units Not Casting

overload119

New Member
Reaction score
5
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 IssuePointOrderLoc( d, "carrionswarm", l )
    
    call PolledWait(0.5)
    call SetUnitPositionLoc( u, l )
    call RemoveLocation(l)
    
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


My dummy unit isn't casting anything, even though he is able to (the spell requires no mana, requirements, etc )

Please help? It has been driving me crazy!
 

jwallstone

New Member
Reaction score
33
Please provide more information. Show what CreateDummy does, and it looks like you have a specialized event registration function (TriggerRegisterAnyUnitEventNL). Also, one thing that stands out already is that the dummy's position isn't even set correctly until AFTER you order it to cast the ability.

But more importantly, it'd be a lot easier if you tried debugging the problem yourself by breaking the problem down. Next time you have a problem like this, try it out with a dummy that is visible and controllable by the player (no locust). That way you can actually see what is happening step by step and see where it falls apart. You can think of similar ways of breaking the problem down to debug for any sort of problem in the future.
 

overload119

New Member
Reaction score
5
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.
 

jwallstone

New Member
Reaction score
33
So you're unit is being created with the carrion swarm ability. If you don't add an expiration timer, and let it live and order the unit to cast it manually, it sounds like it works?

If so, one possibility is that the unit's cast animation is taking longer than it's life. It's good to set the Cast Point and Cast Backswing both to 0.0 on dummies. In your specific case, I see that you are giving it a life of 5 seconds, which should be plenty.

There are two other possibilities that come to mind: your dummy already has another ability based off carrion swarm, and is trying to cast both. Not likely, given your screenshot in the other thread.

The other: do you have another trigger that responds to units being given orders? For example, A unit is issued an order targeting a point, with an action issuing a different order to the unit?
 

overload119

New Member
Reaction score
5
Right now in my trigger I use a timed life of 8, and still no work.

I use this same dummy unit for ALL my dummy spells, and they all still work fine. It's just Carrion Swarm that seems to be having this issue.

I've look and I've looked for any other triggers that would affect this but have come to the conclusion that there aren't any. I've even changed the dummy spell so that it is a different value and have disabled a lot of triggers and still no avail.

Thank you so much for your reply.
 

overload119

New Member
Reaction score
5
... I fixed it... whether you'll believe me or not, it's extremely stupid..

I manually created a unit. In GUI i made another trigger that causes that manually created unit to Carrion Swarm a random area when the spell is cast....

For some reason, when I added this the dummy unit that was part of the spell originally started casting Carrion Swarm as well...

I deleted the manually placed unit, and it still functioned.

Problem solved, but I have no idea how this happened...

EDIT: When you delete the manually placed unit, it will break again.
 

jwallstone

New Member
Reaction score
33
Weird! I've never heard of something like that. If you'd like me to take a look at it directly, you can post the map and I'd be happy to try to help. It'd be a puzzle. Of course, if you don't want to, that's fine too.
 

overload119

New Member
Reaction score
5
Bump.
I can no longer create anymore dummy units and have them cast a spell, as I get the same error.

My temporary fix is this:

Place a dummy unit on the map with the ability carrion swarm...
All of a sudden it works...

I don't want to add a temporary fix for EACH dummy unit with a spell.
 

Uszi

New Member
Reaction score
5
I would double check your other triggers.

I had a lot of problems with dummy units before. I usually wind up needing to make exceptions for them when I make triggers that are supposed to apply generally to all units.

Like I have a player 12 that controls all the enemy monsters. Player 12 also controls the dummy units I use to give players certain debuffs.

It wasn't working, and I was trying to figure out why. Then I realized I had a seperate trigger that made all of player 12's units attack the players every couple of seconds. This trigger was keeping the dummys from casting.


So: Make sure your dummys aren't subject to other triggers giving them orders.

Otherwise, I'm not well acquainted with JASS, so I can't tell you if you're using the wrong function or something like that.
 

overload119

New Member
Reaction score
5
I would double check your other triggers.

I had a lot of problems with dummy units before. I usually wind up needing to make exceptions for them when I make triggers that are supposed to apply generally to all units.

Like I have a player 12 that controls all the enemy monsters. Player 12 also controls the dummy units I use to give players certain debuffs.

It wasn't working, and I was trying to figure out why. Then I realized I had a seperate trigger that made all of player 12's units attack the players every couple of seconds. This trigger was keeping the dummys from casting.


So: Make sure your dummys aren't subject to other triggers giving them orders.

Otherwise, I'm not well acquainted with JASS, so I can't tell you if you're using the wrong function or something like that.

Very good suggestion, but had been tried. The thing is all dummy spells are by casted by this one unit. ALL the other spells that involve this same dummys are working fine. It's just Carrion Swarm that it's not working with.

Thanks for replying.

EDIT: You just made me realize that this is the only location based dumym spell I've used yet.. That could have something to do with it..

EDIT2: When I change the order to Carrion Swarm a unit, it works fine. Thanks a lot for this find! But I still want to know why locations aren't working :(
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top