HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why won't Dummy Units cast?

08-05-2009, 09:47 PM#1
thehellman
Collapse JASS:

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 unit d = CreateDummy( GetOwningPlayer(u), u, 'A00M', GetUnitAbilityLevel(u, 'A00I'), 8)
    local location l = GetSpellTargetLoc()   
    
    call IssuePointOrder(d, "carrionswarm", GetLocationX(l), GetLocationY(l)) 
    
    call PolledWait(0.25)
    
    call SetUnitPositionLoc( u, l )
    call RemoveLocation(l)   
    set l = 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




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!
08-05-2009, 10:16 PM#2
Ignitedstar
Don't you have to remove the Move ability first? Ever since I started doing that, my dummy units have been casting spells just fine.
08-05-2009, 10:23 PM#3
thehellman
Thanks a lot for your response.

I changed the move speed of my dummy unit from 270 to 0, but still no luck.

EDIT: I should also add he casts all other abilities just fine.
08-05-2009, 10:23 PM#4
shadowange1
Does the unit teleport at the end to the targeted loc?
Give the dummy mana or something. check the spells range.
add debug msgs after every line of code to see if it stops somewhere.
something like
Collapse JASS:
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "a" )
theres a shorter one but i cant think of it off the top of my head right now.
just put one after every line of code untill it stops, increases the letter everytime...a>b>c and so on.

edit and i dont know if u put the *//* for this purpose or its like that in ur map but that is a problem.
and does the dummy even spawn?
08-05-2009, 10:27 PM#5
thehellman
Quote:
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'), 8)
call BJDebugMsg("Locals Declared")
call IssuePointOrderLoc( d, "carrionswarm", l )
call BJDebugMsg("Order Given")
call PolledWait(0.5)
call BJDebugMsg("After Wait Duration")
call IssuePointOrderLoc( d, "carrionswarm", l )
call BJDebugMsg("Order Given Again")
call SetUnitPositionLoc( u, l )
call BJDebugMsg("Teleported")
call RemoveLocation(l)
call BJDebugMsg("Location Removed")
endfunction

All messages are being shown in-game.

I just want to clarify something. What I did to my dummy unit (for testing) is removed the Locust ability, and made it a Peasant model. I can now visually see that the spell creates the dummy. It is also given the Carrion Swarm spell.

However, it just isnt' casting it even thouhg if I manually click the dummy, click Carrion Swarm and tell it to cast it somewhere it does it just fine.

Thanks so much for the replies.
08-05-2009, 10:29 PM#6
shadowange1
check if u can cast carrios swarm... it might need a unit target im not sure.
make sure u are ordering the unit correctly

EDIT
well it is a point i just checked.
try to use orderstring instead and use "carrionswarm" i always use strings cuz its easier for me
okay ium an idiot u did do that.
08-05-2009, 10:33 PM#7
thehellman
Zoom (requires log in)

In the screenshot, you can see how I can cast Carrion Swarm on the terrain with no problem.
Thanks a lot for the response.

EDIT:

Quote:
try to use orderstring instead and use "carrionswarm" i always use strings cuz its easier for me

can you elaborate here?
Attached Images
File type: jpguntitled.JPG (81.6 KB)
08-05-2009, 10:39 PM#8
shadowange1
okay i have had ur problem before. try using the BJ and check if that works. assuming it was the same problem as mine

Collapse JASS:
call IssuePointOrderLocBJ( d2, "carrionswarm", l )
replace that with ur order for the dummy
i had to do taht once. i was only able to cast with a bj for some odd reason. lol
08-05-2009, 10:46 PM#9
thehellman
Quote:
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'), 8)

call IssuePointOrderLocBJ(d, "carrionswarm", l)

call PolledWait(0.5)
call SetUnitPositionLoc( u, l )
call RemoveLocation(l)
endfunction

That's my new code, and still no luck.

To add to the things I've tried:
Assign the dummy as a global variable unit.
Changing the dummy unit.

Thank you so much for the help.
08-05-2009, 10:51 PM#10
shadowange1
check the spell. check the orderstring on it. make sure ur using that? lol.
08-05-2009, 10:53 PM#11
thehellman
Zoom (requires log in)

This is the spell I'm using.
Attached Images
File type: jpguntitled.JPG (113.6 KB)
08-05-2009, 11:05 PM#12
shadowange1
try adding the ability to the dummy in the editor instead of by trigger. see if that helps. or tell the dummy unit to do something else. like move to the target(for debuggin).
08-05-2009, 11:11 PM#13
thehellman
I did as you said.
I even told the dummy to cast other abilities and it did.

It just seem like the "carrionswarm" function is being ignored.

Thanks for the reply!!!
08-06-2009, 01:29 AM#14
ToukoAozaki
Try setting unit's both Cast Backswing and Cast Point to 0.
08-06-2009, 04:12 AM#15
Sophismata
Collapse JASS:
if IssuePointOrder(d2, "carrionswarm", GetLocationX(l), GetLocationY(y)) then
    call BJDebugMsg("Order True")
else
    call BJDebugMsg("Order False")
endif