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

Hello, I have a crash issue with simple ability

Status
Not open for further replies.
Level 10
Joined
May 24, 2016
Messages
339
Hello, the things is, I created a simple ability given to hydra. (seen on screenshot)
Screenshot_25.png


Based on fire arrow (the one that shoots the flame and stun unit)
I set range cast to 185, range missile to 9999, damage to 10 (it does not matter will it eventually hit the hero or have to travel all the way to target to 2 point)

When used, simply teleport target hero to second location point (seen on screenshot), and cast on target shadow strike ability (parameters on screenshot)
Screenshot_28.png
Screenshot_27.png


So the thing is, I encounter crashing right exactly hydra uses fire bolt ability. I encountered it in multiplayer, and managed to crash test it 2 times in a row. And then it stopped crashing. I changed nothing but it stopped. Completely. I mean, I ran around 50 test runs where I did exactly the same things all over and over, and nothing. But the problem can't be solved just because it's not repeating for me now.
Anyone could give me a clue?
JASS:
elseif GetSpellAbilityId() == 'A02K' then // the trigger spell register works fine by itself, it check for other skills too

set tr = GetSpellTargetUnit()
call SetUnitX(tr,-13049)
call SetUnitY(tr,12765)
call SetUnitLife(tr,GetUnitLife(tr) + 10) // I use this alt function in damage register system by looking_for_help. It never gave me any problems. Here I add 10 hp for unit if he manages to // lose it
call GroupAddUnit(HydraShallowed,tr) // the group is declared and CreateGroup() in code, I dont recycle it or something, its cosmetic group for now
set F = CreateUnit(Player(12),dummy,GetUnitX(tr),GetUnitY(tr),0) // simple dummy I use all the way around
call UnitApplyTimedLife(F,'BTLF',1.5)
call UnitAddAbility(F,'AEsh') // that shadowstrike ability
call IssueTargetOrder(F,"shadowstrike",tr)

if GetLocalPlayer() == GetOwningPlayer(tr) then
call PanCameraToTimed(GetRectCenterX(gg_rct_HydraMouth), GetRectCenterY(gg_rct_HydraMouth), 0.5) // the region is placed on 2 location
endif
endif
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
The spell you're talking about is Firebolt, which is just a copy of Storm Bolt.

Anyway, using GetLocalPlayer() with the wrong functions will cause a desync, which I imagine happens here:
vJASS:
if GetLocalPlayer() == GetOwningPlayer(tr) then
    call PanCameraToTimed(GetRectCenterX(gg_rct_HydraMouth), GetRectCenterY(gg_rct_HydraMouth), 0.5) // the region is placed on 2 location
endif

Why not use the function designed for a Player?
vJASS:
PanCameraToTimedForPlayer(whichPlayer, x, y, duration)

If these coordinates are too far out of bounds it could cause a crash:
vJASS:
call SetUnitX(tr,-13049)
call SetUnitY(tr,12765)
 
Level 10
Joined
May 24, 2016
Messages
339
The spell you're talking about is Firebolt, which is just a copy of Storm Bolt.

Anyway, using GetLocalPlayer() with the wrong functions will cause a desync, which I imagine happens here:
vJASS:
if GetLocalPlayer() == GetOwningPlayer(tr) then
    call PanCameraToTimed(GetRectCenterX(gg_rct_HydraMouth), GetRectCenterY(gg_rct_HydraMouth), 0.5) // the region is placed on 2 location
endif

Why not use the function designed for a Player?
vJASS:
PanCameraToTimedForPlayer(whichPlayer, x, y, duration)

If these coordinates are too far out of bounds it could cause a crash:
vJASS:
call SetUnitX(tr,-13049)
call SetUnitY(tr,12765)
You can see where -13049, 12765 is exactly, its written "here" on the 2 screenshot.
It's not out of boundaries, I believe
 
Level 10
Joined
May 24, 2016
Messages
339
There's like a 90% chance that it's because of the GetLocalPlayer() usage. That would be the most important thing to change and test.
I use it around 20 times at the start of the game, PanCameraToTimed using rect x and rect y with getlocalplayer()

No crashes

I heard on one topic dedicated to crashes, that even being at the edge of the map give risk with map getting crashed due to manipulation with set unit x and y. So maybe I should increase the map size and never interact with edges.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Well, it'd be a desync, not a crash, so if it's not desyncing players then GetLocalPlayer() is not the issue.

Anyway, those are the only two things that stand out to me.

Of course there can be outside code that causes the problem, hard to tell without seeing everything.
 
Level 10
Joined
May 24, 2016
Messages
339
Well, it'd be a desync, not a crash, so if it's not desyncing players then GetLocalPlayer() is not the issue.

Anyway, those are the only two things that stand out to me.

Of course there can be outside code that causes the problem, hard to tell without seeing everything.
Could you help me as expierenced one: does saving real or any other values via hash on dying units handle cause problems?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Could you help me as expierenced one: does saving real or any other values via hash on dying units handle cause problems?
That sounds fine to me but I suppose the unit could eventually be removed from the game and the handle would be null. But even then I doubt it'd crash. All I can really suggest without seeing all of your code/triggers is to disable anything "new" that you've added recently and test the map. Of course, if the crash is inconsistent then it's not a very easy thing to do...

Are you sure it's a crash and not a desync? Crash means the players game closes entirely and desync means it takes you back to the BNET menu.
 
Level 10
Joined
May 24, 2016
Messages
339
That sounds fine to me but I suppose the unit could eventually be removed from the game and the handle would be null. But even then I doubt it'd crash. All I can really suggest without seeing all of your code/triggers is to disable anything "new" that you've added recently and test the map. Of course, if the crash is inconsistent then it's not a very easy thing to do...

Are you sure it's a crash and not a desync? Crash means the players game closes entirely and desync means it takes you back to the BNET menu.
yeah that crash definitely, all player get the game closed completely

The spell that always been used when game crashed.

JASS:
// Global timer every 0.1 second loop





call GroupClear(P)

set bj_groupAddGroupDest = P

call ForGroup(Radiance, function GroupAddGroupEnumJ)

       // set g = CopyGroup(Paladins)

loop

    set f = FirstOfGroup(P)

    exitwhen f == null

 

 

 

    set R = LoadReal(Hash, GetHandleId(f), StringHash("Radiance_R"))

    if R <= 0 then

        call UnitRemoveAbility(f, 'A01F') // tornado aura abillity to give a buff to hero

           // call UnitRemoveAbility(f,'B00D')

            //call echo("end")

        call DestroyEffect(LoadEffectHandle(Hash, GetHandleId(f), StringHash("Radiance_eff"))) // ability effect to owner

        call RemoveSavedHandle(Hash, GetHandleId(f), StringHash("Radiance_eff"))

        call SaveReal(Hash, GetHandleId(f), StringHash("Radiance_R"), 0.)

        call RemoveSavedReal(Hash, GetHandleId(f), StringHash("Radiance_R"))

        call GroupRemoveUnit(Radiance, f)

    else

        set R = R - 0.1

            //call echo("-R")

        call SaveReal(Hash, GetHandleId(f), StringHash("Radiance_R"), R)

        set B = Condition(function Radiance_Filter)

        call GroupClear(P2)

        call GroupEnumUnitsInRange(P2, GetUnitX(f), GetUnitY(f), 400, B)

        loop

            set F2 = FirstOfGroup(P2)

            exitwhen F2 == null

            call UnitDamageTarget(f, F2, 5., false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)

            if not IsUnitInGroup(F2, RadianceFireEffect) then

                call SaveEffectHandle(Hash, GetHandleId(F2), StringHash("Radiance_enemy_eff"), AddSpecialEffectTarget("Abilities\\Spells\\Other\\ImmolationRed\\ImmolationRedDamage.mdl", F2, "chest"))

                call SaveReal(Hash, GetHandleId(F2), StringHash("Radiance_enemy_eff_R"), 0.3)

                call GroupAddUnit(RadianceFireEffect, F2)

            endif

                //call echo(R2S(r))"Ember Shield I FX 5.mdx"

            call GroupRemoveUnit(P2, F2)

        endloop

        call DestroyBoolExpr(B)

         

    endif





    call GroupRemoveUnit(P, f)

endloop

  

call GroupClear(P) //  RADIANCE effect target, made for giving interval for fire effect to targets

set bj_groupAddGroupDest = P

call ForGroup(RadianceFireEffect, function GroupAddGroupEnumJ)

loop

    set f = FirstOfGroup(P)

    exitwhen f == null

    set R = LoadReal(Hash, GetHandleId(f), StringHash("Radiance_enemy_eff_R"))

    if R <= 0 then // or IsUnitDead(f)

        call DestroyEffect(LoadEffectHandle(Hash, GetHandleId(f), StringHash("Radiance_enemy_eff")))

        call SaveReal(Hash, GetHandleId(f), StringHash("Radiance_enemy_eff_R"), 0.)

        call RemoveSavedReal(Hash, GetHandleId(f), StringHash("Radiance_enemy_eff_R"))

        call GroupRemoveUnit(RadianceFireEffect, f)

    else

        set R = R - 0.1

        call SaveReal(Hash, GetHandleId(f), StringHash("Radiance_enemy_eff_R"), R)

    endif

    call GroupRemoveUnit(P, f)

endloop


//Code indented using The_Witcher's Script language Aligner
//Download the newest version and report bugs at www.hiveworkshop.com

JASS:
elseif GetSpellAbilityId() == 'AOsf' then //RADIANCE spell event, simply works like demonhunter fire shield
call GroupAddUnit(Radiance,c)
call SaveReal(Hash,GetHandleId(c),StringHash("Radiance_R"),15.)
//if LoadEffectHandle(
call SaveEffectHandle(Hash,GetHandleId(c),StringHash("Radiance_eff"),/*
*/AddSpecialEffectTarget("Liberty.mdx",c,"chest"))
call UnitAddAbility(c,'A01F')
call PlaySoundAtPoint("Abilities\\Spells\\NightElf\\Immolation\\ImmolationDecay1.wav", GetUnitX(c), GetUnitY(c) )
 
Last edited:
Level 10
Joined
May 24, 2016
Messages
339
That sounds fine to me but I suppose the unit could eventually be removed from the game and the handle would be null. But even then I doubt it'd crash. All I can really suggest without seeing all of your code/triggers is to disable anything "new" that you've added recently and test the map. Of course, if the crash is inconsistent then it's not a very easy thing to do...

Are you sure it's a crash and not a desync? Crash means the players game closes entirely and desync means it takes you back to the BNET menu.
Uncle, I ran so much runs and I hope Im close to the truth. It has no any connection with all listen above.
Could you tell me, about tornado aura ability, if you turn its stats into negative, could it cause problems?
 

Attachments

  • Screenshot_29.png
    Screenshot_29.png
    8.1 KB · Views: 7
Status
Not open for further replies.
Top