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

[Trigger] Critical error

Status
Not open for further replies.
Level 3
Joined
May 26, 2014
Messages
41
Can this trigger cause the game to crash? The game doesn't crash all the time, but like once in 20-30 games or more often if the game goes into late game, which made me believe this is the trigger that might be causing it.

  • Max level aura
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of |cff008040Battlefield Experience|r for (Attacking unit)) Equal to 70
      • (Custom value of (Attacking unit)) Not equal to 66
      • ((Attacking unit) is Mechanical) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current research level of Leader for (Owner of (Attacking unit))) Equal to 1
        • Then - Actions
        • Else - Actions
          • Set ExpPoint = (Position of (Attacking unit))
          • Unit - Set the custom value of (Attacking unit) to 66
          • Special Effect - Create a special effect at ExpPoint using Abilities\Spells\Items\AIem\AIemTarget.mdl
          • Unit - Add Commander to (Attacking unit)
          • Unit - Add Inventory (Hero) to (Attacking unit)
          • Unit - Add Stop to (Target unit of ability being cast)
          • Unit - Add Charge to (Target unit of ability being cast)
          • Set int1 = (Random integer number between 1 and 8)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • int1 Equal to 1
            • Then - Actions
              • Unit - Add Vampiric Aura (Neutral Hostile) to (Attacking unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • int1 Equal to 2
                • Then - Actions
                  • Unit - Add Command Aura to (Attacking unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • int1 Equal to 3
                    • Then - Actions
                      • Unit - Add Unholy Aura (Neutral Hostile) to (Attacking unit)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • int1 Equal to 4
                        • Then - Actions
                          • Unit - Add Endurance Aura (Neutral Hostile) to (Attacking unit)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • int1 Equal to 5
                            • Then - Actions
                              • Unit - Add Trueshot Aura (Neutral Hostile) to (Attacking unit)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • int1 Equal to 6
                                • Then - Actions
                                  • Unit - Add Thorns Aura (Neutral Hostile) to (Attacking unit)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • int1 Equal to 7
                                    • Then - Actions
                                      • Unit - Add Devotion Aura (Neutral Hostile) to (Attacking unit)
                                    • Else - Actions
                                      • Unit - Add Brilliance Aura (Neutral Hostile) to (Attacking unit)
          • Custom script: call RemoveLocation(udg_ExpPoint)
 
Last edited:
Level 3
Joined
May 26, 2014
Messages
41
So basically, what does your trigger do? Is it when hero attack enemy unit, it gives random ability to him?
There's an exp system in the map, so when a unit reaches a certain level he becomes a Commander, getting a random aura and abilities to control nearby units.

The trigger appears to leak a special effect.

It also uses custom values, something which may conflict if you use GUI based unit indexers.

Hm, thanks for pointing out the effect leak, will fix. Although I don't think it happens enough times to make the game crash? Even though it does happen in the late game, so it might be some kind of a leak.

What do u mean by "GUI based unit indexers"? I'm not too advanced at this stuff, but I think the critical error might have appeared around the time i started using custom values.

Few players have send me the replays of the critical error and all of them happen late into the game, like 1 hour + (Certainly not every game, not too often as well, I would say). I've tried to see what's going on in the moment of the crash, but haven't noticed anything special.
 
Level 3
Joined
Jun 18, 2016
Messages
68
There's an exp system in the map, so when a unit reaches a certain level he becomes a Commander, getting a random aura and abilities to control nearby units.
well, simply set them into variables
Aura[1] = Vampiric Aura
Aura[2] = Endurance Aura
Aura[3] = Bash
Aura[4] = Evasion
And so on... until max aura amount you have. Then,
Aura_max = [Max number of your aura]

and when your unit become commander,
set Aura_Random = (Random integer number between 1 to (Aura_Max))
Add Ability (Aura[Aura_Random]) to (Your Unit)

i think should work.
 
Level 3
Joined
May 26, 2014
Messages
41
well, simply set them into variables
Aura[1] = Vampiric Aura
Aura[2] = Endurance Aura
Aura[3] = Bash
Aura[4] = Evasion
And so on... until max aura amount you have. Then,
Aura_max = [Max number of your aura]

and when your unit become commander,
set Aura_Random = (Random integer number between 1 to (Aura_Max))
Add Ability (Aura[Aura_Random]) to (Your Unit)

i think should work.
Thanks, but that's not the problem, since that part was in another trigger, where you would add a Commander to a unit with an item. I only need to figure out what's causing the critical error.
 
Level 3
Joined
May 26, 2014
Messages
41
Sorry for the late reply, was away. Yeah i have 2 logs from different games, although they're from me watching the replay that crashed, not from initial games, if that makes any difference.
 

Attachments

  • 2016-07-11 15.09.54 Crash.txt
    17.1 KB · Views: 28
  • 2016-07-21 19.02.28 Crash.txt
    13.9 KB · Views: 40
Level 20
Joined
Aug 13, 2013
Messages
1,696
Thats nested if's,

Did you try to delete this trigger?
There are so many things to fix in this stuff especially it can be shorten.
Store attacking unit into variable
Where did you get that " target unit of ability being cast " ?
You can merge the " if current research level..., " into the main If statement
Destroy the special effect ALWAYS, leaving it can cause serious massive lags. ( dont know if this crash but I think this is not the cause )
Store the abilities into array. ( remove that nested if's )
Setting custom value is not recommended, I suggest to create an integer array and use unit indexer system ( Bribe ) it is much better. ( Integer[ GetUnitUserData( unit ) ] = 66 )

I also suggest you to read this:
[Crash] - List of WarCraft III Crashes
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
Both crashes are completely unrelated, crashing at completely different parts of the program.

Crash "2016-07-11 15.09.54 Crash.txt" seems to have 'K00A' on the stack multiple times. Whatever that is might be the cause.

Crash "2016-07-21 19.02.28 Crash.txt" has nothing really consistent on the stack so there is not the slightest hint as to the cause.
 
Level 3
Joined
May 26, 2014
Messages
41
Thats nested if's,

Did you try to delete this trigger?
There are so many things to fix in this stuff especially it can be shorten.
Store attacking unit into variable
Where did you get that " target unit of ability being cast " ?
You can merge the " if current research level..., " into the main If statement
Destroy the special effect ALWAYS, leaving it can cause serious massive lags. ( dont know if this crash but I think this is not the cause )
Store the abilities into array. ( remove that nested if's )
Setting custom value is not recommended, I suggest to create an integer array and use unit indexer system ( Bribe ) it is much better. ( Integer[ GetUnitUserData( unit ) ] = 66 )

I also suggest you to read this:
[Crash] - List of WarCraft III Crashes
No, i didnt try to delete it yet, but as I've said this critical error does not happen too often, so even after deleting it, i would need too much time to figure out if it's fixed. Thanks for other suggestions and yeah I've read that topic few times, can't see anything that would be the case for me though.


Both crashes are completely unrelated, crashing at completely different parts of the program.

Crash "2016-07-11 15.09.54 Crash.txt" seems to have 'K00A' on the stack multiple times. Whatever that is might be the cause.

Crash "2016-07-21 19.02.28 Crash.txt" has nothing really consistent on the stack so there is not the slightest hint as to the cause.
Hm, yeah I can't see any connection between them in the game as well. But i think they all happen ~ 50 mins + into the game. I haven't found K00A in the object editor, but I'll look some more, thanks.
 
Level 3
Joined
May 26, 2014
Messages
41
Actually, i think i've found the ability it's reffering to with "K00A", as it's sometimes reversed in the crash log. So the ability is A00K and it's basically a unit target effect to show his experience above his head, which is connected to this trigger:
JASS:
function Trig_ABXP_Battle_Experience_Conditions takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A00F', GetKillingUnitBJ()) > 0 ) ) then
        return false
    endif
    if ( not ( GetUnitAbilityLevelSwapped('A00F', GetKillingUnitBJ()) < 95 ) ) then
        return false
    endif
    if ( not ( IsPlayerEnemy(GetOwningPlayer(GetKillingUnitBJ()), GetOwningPlayer(GetDyingUnit())) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_ABXP_Battle_Experience_Func001C takes nothing returns boolean
    if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_ABXP_Battle_Experience_Func006Func001C takes nothing returns boolean
    if ( not ( ( udg_TempInteger / udg_TempInteger2 ) > 3 ) ) then
        return false
    endif
    return true
endfunction

function Trig_ABXP_Battle_Experience_Func006Func002C takes nothing returns boolean
    if ( not ( ( udg_TempInteger2 / udg_TempInteger ) > 5 ) ) then
        return false
    endif
    return true
endfunction

function Trig_ABXP_Battle_Experience_Func006C takes nothing returns boolean
    if ( not ( udg_TempInteger2 >= udg_TempInteger ) ) then
        return false
    endif
    return true
endfunction

function Trig_ABXP_Battle_Experience_Func008Func001Func001Func001C takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A00M', udg_TempUnit) > 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_ABXP_Battle_Experience_Func008Func001Func001C takes nothing returns boolean
    if ( not ( udg_TempInteger3 >= 45 ) ) then
        return false
    endif
    return true
endfunction

function Trig_ABXP_Battle_Experience_Func008Func001Func002C takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A00L', udg_TempUnit) > 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_ABXP_Battle_Experience_Func008Func001C takes nothing returns boolean
    if ( not ( udg_TempInteger3 >= 24 ) ) then
        return false
    endif
    if ( not ( udg_TempInteger3 <= 44 ) ) then
        return false
    endif
    return true
endfunction

function Trig_ABXP_Battle_Experience_Func008Func002C takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A00K', udg_TempUnit) > 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_ABXP_Battle_Experience_Func008C takes nothing returns boolean
    if ( not ( udg_TempInteger3 >= 9 ) ) then
        return false
    endif
    if ( not ( udg_TempInteger3 <= 23 ) ) then
        return false
    endif
    return true
endfunction

function Trig_ABXP_Battle_Experience_Actions takes nothing returns nothing
    if ( Trig_ABXP_Battle_Experience_Func001C() ) then
        call RemoveItem( UnitItemInSlotBJ(GetTriggerUnit(), 1) )
    else
    endif
    set udg_TempUnit = GetKillingUnitBJ()
    set udg_TempUnit2 = GetTriggerUnit()
    set udg_TempInteger = R2I(GetUnitStateSwap(UNIT_STATE_MAX_LIFE, udg_TempUnit))
    set udg_TempInteger2 = R2I(GetUnitStateSwap(UNIT_STATE_MAX_LIFE, udg_TempUnit2))
    if ( Trig_ABXP_Battle_Experience_Func006C() ) then
        if ( Trig_ABXP_Battle_Experience_Func006Func002C() ) then
            set udg_TempInteger3 = ( GetUnitAbilityLevelSwapped('A00F', udg_TempUnit) + 8 )
        else
            set udg_TempInteger3 = ( ( udg_TempInteger2 / udg_TempInteger ) + ( GetUnitAbilityLevelSwapped('A00F', udg_TempUnit) + 2 ) )
        endif
    else
        if ( Trig_ABXP_Battle_Experience_Func006Func001C() ) then
            set udg_TempInteger3 = ( GetUnitAbilityLevelSwapped('A00F', udg_TempUnit) + 3 )
        else
            set udg_TempInteger3 = ( GetUnitAbilityLevelSwapped('A00F', udg_TempUnit) + 4 )
        endif
    endif
    call SetUnitAbilityLevelSwapped( 'A00F', udg_TempUnit, udg_TempInteger3 )
    if ( Trig_ABXP_Battle_Experience_Func008C() ) then
        if ( Trig_ABXP_Battle_Experience_Func008Func002C() ) then
        else
            call UnitAddAbilityBJ( 'A00K', udg_TempUnit )
        endif
    else
        if ( Trig_ABXP_Battle_Experience_Func008Func001C() ) then
            if ( Trig_ABXP_Battle_Experience_Func008Func001Func002C() ) then
            else
                call UnitRemoveAbilityBJ( 'A00K', udg_TempUnit )
                call UnitAddAbilityBJ( 'A00L', udg_TempUnit )
            endif
        else
            if ( Trig_ABXP_Battle_Experience_Func008Func001Func001C() ) then
                if ( Trig_ABXP_Battle_Experience_Func008Func001Func001Func001C() ) then
                else
                    call UnitRemoveAbilityBJ( 'A00L', udg_TempUnit )
                    call UnitAddAbilityBJ( 'A00M', udg_TempUnit )
                endif
            else
            endif
        endif
    endif
endfunction

//===========================================================================
function InitTrig_ABXP_Battle_Experience takes nothing returns nothing
    set gg_trg_ABXP_Battle_Experience = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_ABXP_Battle_Experience, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_ABXP_Battle_Experience, Condition( function Trig_ABXP_Battle_Experience_Conditions ) )
    call TriggerAddAction( gg_trg_ABXP_Battle_Experience, function Trig_ABXP_Battle_Experience_Actions )
endfunction
Is there anything that can cause the crash?
 
Last edited:
Level 3
Joined
May 26, 2014
Messages
41
What is the ability based one? What if you were to change it for another ability?
It's based off Life Regeneration Aura. I think i can change it, but i'm not sure if that will change anything, since that trigger is in effect almost all game long and this error occurs late into the game and very rarely. I also found another replay of a critical and it's reffering to the ability based off Item HP bonus, that gives bonus hp to certain units at night time via trigger. So this seems pretty random.
 
Status
Not open for further replies.
Top