Illusion Wand Issue

wellwish3r

wishes wells.
Reaction score
52
I tried to make a blink spell that leaves an illusion behind, the method to create the illusion is called properly, however, nothing happens, here is the code:

JASS:
method createIllusion takes nothing returns nothing
        local real x = GetUnitX(.munit)
        local real y = GetUnitY(.munit)
        local player p = GetOwningPlayer(.munit)
        local unit u = CreateUnit(p,.did,x,y,GetUnitFacing(.munit))
        local item it = CreateItem(.iid,0,0)
        call UnitAddItem(u,it)
        call UnitUseItemTarget(u,it,.munit)
        set .count = .count + 1
        call UnitApplyTimedLife(u,'BTLF',3.0)
    endmethod


the Illusion wand works when i use it manually.
 

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
static method (...)
endmethod

That isn't a solution, look at the syntax he's using.

Anyway, you should make the item ability into a unit ability, and give that ability to the dummy via object editor. Then issue the unit the order. This will save you some lines of code too :)
 

cleeezzz

The Undead Ranger.
Reaction score
268
JASS:
scope ORDERID initializer Init

private function Actions takes nothing returns nothing
    call BJDebugMsg("ID: " + I2S( GetIssuedOrderId()))
    call BJDebugMsg("OrderString: " + OrderId2String( GetIssuedOrderId()))
endfunction

//===========================================================================
private function Init takes nothing returns nothing
    local trigger trig = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
    call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
    call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddAction( trig, function Actions )
endfunction

endscope
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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