• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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