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

Unit is not recieving order

Status
Not open for further replies.

EdgeOfChaos

E

EdgeOfChaos

This is my current code:

JASS:
    function applyEffect takes unit target, integer toAdd returns nothing
        local unit dummy = CreateUnit(Player(0),DUMMY,GetUnitX(target),GetUnitY(target),0)
        call UnitAddAbility(dummy,toAdd)
        call IssueTargetOrderById(dummy,toAdd,target)
        call UnitApplyTimedLife(dummy,'BTLF',1.0)
    endfunction

DUMMY is a constant integer for the unit type of my dummy.
toAdd is the ability ID (for this a custom storm bolt)
Target is the unit to apply it to.

I'm trying to use it to cast a custom storm bolt. I made the dummy visible and belong to me for the test, and it is being created correctly, and the ability is being added. It just won't cast it. What am I doing wrong here?

(and no, it's not something like mana cost or cast range, I checked both of those. I can cast the ability manually OK from the dummy, it's just the trigger that won't use it.)
 
always use apply timed life as a first after creating for dummys

JASS:
function applyEffect takes unit target, integer toAdd returns nothing
        local unit dummy = CreateUnit(Player(0),DUMMY,GetUnitX(target),GetUnitY(target),0)
        call UnitApplyTimedLife(dummy,'BTLF',1.0)
        call UnitAddAbility(dummy,toAdd)
        call IssueTargetOrderById(dummy,toAdd,target)
endfunction

zibi
edit:
and null dummy
 
Level 11
Joined
Dec 19, 2012
Messages
411
Well, i usually avoid using this native IssueTargetOrderById as I would also have the same problem with you (perhaps it my own problem...). As a replacement i would use this native IssueTargetOrder. It always working fine as long as the string order is input correctly.
 

EdgeOfChaos

E

EdgeOfChaos

always use apply timed life as a first after creating for dummys

JASS:
function applyEffect takes unit target, integer toAdd returns nothing
        local unit dummy = CreateUnit(Player(0),DUMMY,GetUnitX(target),GetUnitY(target),0)
        call UnitApplyTimedLife(dummy,'BTLF',1.0)
        call UnitAddAbility(dummy,toAdd)
        call IssueTargetOrderById(dummy,toAdd,target)
endfunction

zibi
edit:
and null dummy

Still not working, I'm afraid. Spawns, but doesn't do anything.
 
Status
Not open for further replies.
Top