Game Crashing question.

Terrabull

Veteran Member (Done that)
Reaction score
38
I have a trigger that creates a unit group, then assigns all the units in that group an ability. This works fine when I test it in single player, but when people are beta testing it they are getting fatal errors. I have heard a lot that it happens with this trigger (or triggers nearly identical to this, just the ability ID is changed.)
My questions:
Would this trigger cause a crash?
Is it possible for a unit to die between being assigned to the group, and given the ability?

If the answer to both of those questions (or at least, the answer to the first question) is "No." Then does anyone know what could be causing the crash? I am not sure what to even look for.

JASS:
function Cond_Morale_Vampiric takes nothing returns boolean
    return GetSpellAbilityId() == 'A01K'
endfunction

function Add_Vampiric takes nothing returns nothing
    call UnitAddAbility(GetEnumUnit(),'A01G')
    call UnitAddAbility(GetEnumUnit(),'A020')
endfunction

function Act_Morale_Vampiric takes nothing returns nothing
    local group TG = CreateGroup()
    local integer P = 0
    if GetTriggerUnit() == gg_unit_n010_0181 then
        set P = 10
    else
        set P = 11
    endif
    call GroupEnumUnitsOfPlayer(TG,Player(P),Condition(function Not_Structure))
    call ForGroup(TG,function Add_Vampiric)
    call DestroyGroup(TG)
    set TG = null
    call SetUnitOwner(GetTriggerUnit(),Player(P),true)
endfunction

//===========================================================================
function InitTrig_Morale_Vampiric takes nothing returns nothing
    set gg_trg_Morale_Vampiric = CreateTrigger()
    call TriggerRegisterUnitEvent(gg_trg_Morale_Vampiric,gg_unit_n010_0181,EVENT_UNIT_SPELL_FINISH)
    call TriggerRegisterUnitEvent(gg_trg_Morale_Vampiric,gg_unit_n010_0182,EVENT_UNIT_SPELL_FINISH)
    call TriggerAddCondition(gg_trg_Morale_Vampiric,Condition(function Cond_Morale_Vampiric))
    call TriggerAddAction(gg_trg_Morale_Vampiric,function Act_Morale_Vampiric)
endfunction


A related trigger, not sure if it is necessary to post this.
JASS:
library LeftMorale initializer Init_Left_Morale requires Morale
    
    function Cond_Left_Morale takes nothing returns boolean
        return GetTriggerUnit() == gg_unit_n010_0181
    endfunction
    
    function Act_Left_Morale takes nothing returns nothing
        if GetOwningPlayer(GetTriggerUnit()) == Player(10) and GetTriggerUnit() == gg_unit_n010_0181 then
            call SetUnitOwner(gg_unit_n010_0181,GetTriggerPlayer(),true)
            call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,5,"|CFFFF0000You |CFFFF5500have |CFFFFBF0030 |CFFEAFF00seconds |CFF40FF00to |CFF00EA15use |CFF00956Athe |CFF0040BFMorale |CFF552AFFCenter.")
            call TriggerSleepAction(30.00)
            if GetOwningPlayer(GetTriggerUnit()) == GetTriggerPlayer() then
                call SetUnitOwner(gg_unit_n010_0181,Player(10),true)
            endif
        else
            if GetOwningPlayer(GetTriggerUnit()) != GetTriggerPlayer() and GetTriggerUnit() == gg_unit_n010_0181 then
                call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,7,"|CFF59DED2C|CFF65DCCAu|CFF71DAC2r|CFF7ED8B9r|CFF8AD6B1e|CFF96D4A8n|CFFA3D1A0t|CFFAFCF97l|CFFBBCD8Fy |CFFE1C675i|CFFDEC77Bn |CFFD7C988u|CFFD4CA8Fs|CFFD1CB95e|CFFCDCC9C, |CFFC7CEA9p|CFFC3CFAFl|CFFBCD2BDe|CFFBBC7B3a|CFFBABBA9s|CFFB9AF9Ee |CFFB79789w|CFFB68C7Fa|CFFB58074i|CFFB4746At |CFFB25C553|CFFB1504A0 |CFFA85062s|CFFA4516Ee|CFF9F517Ac|CFF9A5186o|CFF965292n|CFF91529Ed|CFF8C52AAs|CFF8853B6.|R")
            endif
        endif
    endfunction

    //===========================================================================
    function Init_Left_Morale takes nothing returns nothing
        local integer i = 0
        set gg_trg_Left_Morale = CreateTrigger()
        loop
        exitwhen i>3
            call TriggerRegisterPlayerUnitEvent(gg_trg_Left_Morale,Player(i),EVENT_PLAYER_UNIT_SELECTED,Condition(function Morale_Center))
            set i=i+1
        endloop
//        call TriggerAddCondition(gg_trg_Left_Morale,Condition(function Cond_Left_Morale))
        call TriggerAddAction(gg_trg_Left_Morale,function Act_Left_Morale)
    endfunction
endlibrary
 

Exide

I am amazingly focused right now!
Reaction score
448
JASS:

    if GetTriggerUnit() == gg_unit_n010_0181 then


"Comparing two variables of different primitive types is not allowed."
-According to JassCraft.

That, and as AdamGriffith already mentioned:

JASS:

    call GroupEnumUnitsOfPlayer(TG,Player(P),Condition(function Not_Structure))


What the heck? :p
 
Reaction score
456
>"Comparing two variables of different primitive types is not allowed."
It's a global variable. Preplaced unit in world editor.
 

Exide

I am amazingly focused right now!
Reaction score
448
>"Comparing two variables of different primitive types is not allowed."
It's a global variable. Preplaced unit in world editor.

I see.
Tell that to JassCraft, as well. :rolleyes:
 

Terrabull

Veteran Member (Done that)
Reaction score
38
So no one has any ideas what would cause a fatal error in a Warcarft map?
 

Terrabull

Veteran Member (Done that)
Reaction score
38
It shouldn't be null, it's a unit pre-placed in the World Editor. It's there every time the map starts.
 

Terrabull

Veteran Member (Done that)
Reaction score
38
Final Bump.
Does anyone have any idea what could cause the game to crash? Even if it's not related to the code in the first post.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top