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

[JASS] Casting in my map just isnt' working sometimes.

Status
Not open for further replies.
Level 2
Joined
Jun 25, 2006
Messages
18
I seem to be having an issue in my map, when using the native "IssueTargetOrder". I have several triggers in my map that use it, and sometimes they work, sometimes they don't. Is there any known reasons why this happens? A trigger as simple as this has issues...

JASS:
function GlacialSpikeCond takes nothing returns boolean
    return UnitHasAbility(GetTriggerUnit(), 'A06K')
endfunction
function GlacialSpike takes nothing returns nothing
    local unit u            = GetTriggerUnit()
    local unit v            = GetAttacker()
    call IssueTargetOrder(u, "thunderbolt", v)
    set u = null
    set v = null
endfunction
function InitTrig_GlacialSpike takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer i = 0
    loop
        exitwhen i > 11
        call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_ATTACKED, null)
        set i = i + 1
    endloop
    call TriggerAddCondition(t, Condition(function GlacialSpikeCond))
    call TriggerAddAction(t, function GlacialSpike)
    set t = null
endfunction

It works sometimes, the units actually cast the stormbolt. Same with many other triggers in my map, sometimes work. Perhaps theres some error elsewhere in my script.
 
Level 2
Joined
Jun 25, 2006
Messages
18
Yes, I made sure all the obvious reasons are not the issue. Mana cost is 0, targets allowed, range, unit acquisition range, etc.. like I said it works sometimes others it just doesn't. I don't know if the unit is getting attacked so fast maybe the order is just happening to quickly and the unit can't respond or what.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
attacked unit casts stormbolt to attacker hmm
Im sure you checked cooldown too

I suggest you to try with a dummy
if you attack 2 times quickly it wont be able to cast second I guess :/
 
Status
Not open for further replies.
Top