• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Lost control over hero

Status
Not open for further replies.
Level 18
Joined
Nov 21, 2012
Messages
835
Strange bug: hero refuse orders, just follow his last target. Does not react to right-click (smart) order, staff of teleportation order, other ability is not casted (I tryed click few times at this bug-time). When hero dies, and reborn all control worked...

It happends when ability "Invunerable (anti-gravity)" activated. It happdends 1 time on last game I played (before, about 10 cast of this ability was succefull)
This ability is based on WindWalk. At cast time of "Invunerable (anti-gravity)" dummy casts SoulBurn-based spell on a Hero (to not allow hero cast other spells during "Invunerable")

Hero has also passive ability "Harbinger of Nibiru" (based on Evasion). It deals damage after some time after "Invunerable (anti-gravity)" is activated.

When I look at replay both buffs appeared right on hero (from "Invunerable " and "SoulBurn" abilities), and they dissapear as they should.

Only this control not worked. Model of hero is based on this custom model:
http://www.hiveworkshop.com/forums/models-530/power-lich-95113/
I use UnitIndexer.

this is run on event EVENT_PLAYER_UNIT_SPELL_EFFECT when "Invunerable (anti-gravity)" casted:

JASS:
function AntiGravity takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local unit d = CreateUnit(GetTriggerPlayer(), 'n010', x, y, 0.00)
local integer id = GetUnitUserData(d)
local real r

    set udg_Spell_Caster[id] = GetTriggerUnit()
    set udg_Spell_Level[id] = GetUnitAbilityLevel(udg_Spell_Caster[id], GetSpellAbilityId())
    set r = I2R(udg_Spell_Level[id])
    set udg_Spell_Damage[id] = ( 0.20 * r ) + 2.20
    set udg_Spell_Duration[id] = 3.50 + ( 0.50 * r )
    set udg_Spell_Counter[id] = 0
    
    call SetUnitInvulnerable( udg_Spell_Caster[id], true ) //set invun
    
    call UnitAddAbility(d, 'A0C4')  //soul burn
    call SetUnitAbilityLevel(d, 'A0C4', udg_Spell_Level[id])
    call IssueTargetOrder( d, "soulburn", udg_Spell_Caster[id] )
    
    if IsUnitGroupEmptyBJ(udg_Spell_Group_array[142]) then
        call EnableTrigger( gg_trg_LoopAntiGravity )
    endif
    call GroupAddUnit(udg_Spell_Group_array[142], d )
    
set d=null
endfunction


this is loop to deal damage from "Harbinger of Nibiru" spell:

JASS:
//========================================
function Trig_LoopAntiGravity_Func001A takes nothing returns nothing
local unit d = GetEnumUnit()
local integer id = GetUnitUserData(d)
local player pla = GetOwningPlayer(d)
local real x
local real y
local integer harbringer
local real dmg
local unit u

    // Harbringer of Nibiru -------
    // Harbringer of Nibiru -------
if (udg_Spell_Counter[id] == 8) and (GetUnitAbilityLevel(udg_Spell_Caster[id], 'A0C7') > 0) then
    set x = GetUnitX(udg_Spell_Caster[id])
    set y = GetUnitY(udg_Spell_Caster[id])
    set harbringer = GetUnitAbilityLevel(udg_Spell_Caster[id], 'A0C7')
    set dmg = ( 10.00 * I2R(( harbringer * harbringer )) ) + 60.00
    
    // ---increase spell by RobeOfTheMagi and InternallIntelligence  -----
    if HasItemZibi(udg_Spell_Caster[id], 'ward') then
    set dmg = dmg  * 1.25
    elseif HasItemZibi(udg_Spell_Caster[id], 'arsc') then
    set dmg = dmg  * 1.50
    endif
    
    set bj_lastCreatedUnit = CreateUnit(pla, 'e01O', x, y, 0.00)  //this is for visual effect only
    call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 2.00)
        
call GroupEnumUnitsInRange(udg_ug, x, y, 400.00, null)
loop
set u = FirstOfGroup(udg_ug) 
exitwhen u == null
    if IsUnitEnemy(u, pla) and IsUnitType(u, UNIT_TYPE_STRUCTURE) == false then
        call UnitDamageTargetBJ( d, u, dmg, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
    endif    
call GroupRemoveUnit(udg_ug, u)
endloop
call GroupClear (udg_ug) 
        
        
endif

    //  
    set udg_Spell_Counter[id] = ( udg_Spell_Counter[id] + 1 )
    set udg_Spell_Duration[id] = ( udg_Spell_Duration[id] - 0.25 )
    // When the duration reaches 0 it means the spell is done
     if udg_Spell_Duration[id] <= 0.00 then
        // Clean up any data attached to this spell
        call SetUnitInvulnerable( udg_Spell_Caster[id], false )
        set udg_Spell_Counter[id] = 0
        // Remove the dummy from the group and from the game
        call GroupRemoveUnit(udg_Spell_Group_array[142], d )
        call RemoveUnit( d )
        if IsUnitGroupEmptyBJ(udg_Spell_Group_array[142]) then
            call DisableTrigger( GetTriggeringTrigger() )
        endif
    endif
    
set d=null
set u=null
set pla=null
endfunction

//------------------------------------------
function Trig_LoopAntiGravity_Actions takes nothing returns boolean
    call ForGroup( udg_Spell_Group_array[142], function Trig_LoopAntiGravity_Func001A )
    return false
endfunction

//===========================================================================
function InitTrig_LoopAntiGravity takes nothing returns nothing
    set gg_trg_LoopAntiGravity = CreateTrigger(  )
    call DisableTrigger( gg_trg_LoopAntiGravity )
    call TriggerRegisterTimerEventPeriodic( gg_trg_LoopAntiGravity, 0.25 )
    call TriggerAddCondition( gg_trg_LoopAntiGravity, Condition(function Trig_LoopAntiGravity_Actions ))
endfunction


You got any idea what can be wrong? Please remember this control bug appears only sometimes..
 
Level 18
Joined
Nov 21, 2012
Messages
835
So if you disable that trigger it runs without issues?
Lost control occurs only with/after "Invunerable (anti-gravity)" ability activated and not always (let me say 1 per 10-15 casts). I remember players reported few times that lost-control months ago, then I tryed to fix by removing flying effect during this spell, but unfortunatelly problem still exist. Also ask here but no replies
http://www.hiveworkshop.com/forums/triggers-scripts-269/spell-sometimes-bugged-263492/
I am thinking of replacing custom model by standard one from war3.. maybe model??
Or using ability WindWalk + set unit inv + cast on hero soul burn is to much for once, and game sometimes bugs?


I was testing my WarChasers map and I once encounteted an issue with being unable to summon Water Elemental. I don't know why it happened, but once I used another ability and waited 15 seconds or so, I could summon again. The game engine is weird.
Is this ability you've changed? Is it normal summon or done by trigger (CreateUnit). Game engine is weird, but we have to life with this:)
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Is this ability you've changed? Is it normal summon or done by trigger (CreateUnit). Game engine is weird, but we have to life with this:)

Normal summon, no object editor changes to that spell. Water Elemental icon in UI would highlight as if it recongized that I was summoning it, but would not summon until later. I tried pressing W and clicking the icon, same results.

I've seen similar behavior in League of Legends on a different computer. I wonder if they both used the same framework and that it sometimes has that glitch.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
The problem you mention usually occurs with transform/avatar abilities.There should be some videos for that on youtube.(I remember you can do it by using avatar ability on hero + avatar ability on item while attacking something, you lost control of hero)

It is hard to suggest something without a replay or knowledge to reproduce bug, unless someone else had similar problem.
 
Level 18
Joined
Nov 21, 2012
Messages
835
Just for peace of mind I deleted these 2 abilities and replced by new ones in my map in ver 2.09. But problem is not solved.

Thanks Ceday for tip, but when we played on-line there was no hero/unit with morphing/avatar ability. So thats not a reason in this case. I'm also unable to reproduce this bug in single player tests even after look at replay few times.

I found a little similar problem on wc3c. User had problems with ignored right-click orders after he added/removing WindWalk and FanOfKnifes abilities.
In my case we have also ignoring smart orders and also I used WindWalk based ability + SoulBurn + invunerable. Well, maybe someone will find it usefull in the future and will solve lost-control problem.
http://www.wc3c.net/showthread.php?t=110656
 
Status
Not open for further replies.
Top