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

[Solved] Why isn't this working guys?

Status
Not open for further replies.
Level 10
Joined
Feb 19, 2006
Messages
237
  • Smoke Potion
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Smoke Potion (dummy)
    • Actions
      • Custom script: local real x = GetSpellTargetX()
      • Custom script: local real y = GetSpellTargetY()
      • Custom script: set bj_lastCreatedUnit = CreateUnit(GetTriggerPlayer(), 'h00A', x, y, bj_UNIT_FACING)
      • Custom script: call UnitAddAbility(bj_lastCreatedUnit, 'Aclf')
      • Custom script: call IssuePointOrderById(bj_lastCreatedUnit, 852473, x, y)
      • Custom script: call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 10.5)
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Do the actions run? Is the dummy created? Does the dummy get the correct ability? Does the dummy get the order? Does the ability require mana or some upgrade so the dummy can't cast it?

You could put in a bit of effort yourself. Use Game - Display text message (BJDebugMsg()) to display debugging messages.

One issue could be that the unit's movement speed is zero and it can't turn and therefore it won't cast the ability.
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
Try this:

JASS:
function test takes nothing returns nothing
    local location loc = GetSpellTargetLoc()
    local unit u = CreateUnitAtLoc(GetTriggerPlayer(), 'h00A', loc, bj_UNIT_FACING)
    call UnitAddAbility(u, 'Aclf')
    call IssuePointOrderByIdLoc(u, 'Aclf', loc)
    call UnitApplyTimedLife(u, 'BTLF', 10.5)
    call RemoveLocation(loc)
    set u = null
endfunction
Like Maker suggested, check the mana cost of your dummy's ability as well as the dummy's movement speed.

- Mr_Bean
 
Level 16
Joined
Aug 7, 2009
Messages
1,406
@Mr_Bean987= you have to null the location variable too or it will leak. But using pure X/Y coordinates is much-much better:
JASS:
function test takes nothing returns nothing
    local location loc = GetSpellTargetLoc()
    local unit u = CreateUnit(GetTriggerPlayer(), 'h00A', GetSpellTarteX(),GetSpellTargetY(), bj_UNIT_FACING)
    call UnitAddAbility(u, 'Aclf')
    call IssuePointOrder(u, "order_string", GetSpellTargetX(),GetSpellTargetY())
    call UnitApplyTimedLife(u, 'BTLF', 10.5)
    call RemoveLocation(loc)
    set u = null
endfunction

Also, IssuePointOrderByID takes an orderid, not an ability id. The list of available orderid's is here:

http://www.thehelper.net/forums/showthread.php/165178-Order-Ids
 
Status
Not open for further replies.
Top