Game crashes!

Sim

Forum Administrator
Staff member
Reaction score
534
I've been working on spell triggers recently, and I've created cool spells.

But now I've got a crashing spell, and JassCraft just doesn't know that one :p

Here is the trigger!

Code:
function Trig_Hell_Strike_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A05M'
endfunction

function Trig_Hell_Strike_Actions takes nothing returns nothing
    local unit cast = GetTriggerUnit()
    local unit u
    local player p = GetOwningPlayer(cast)
    local location l = GetSpellTargetLoc()
    local location ll
    local real debug1 = GetLocationX(l)
    local real debug2 = GetLocationY(l)
    local integer i = GetRandomInt(8, 11)
    local integer ii = 0
    
    loop
        exitwhen ii == i
        set ll = PolarProjectionBJ(l, GetRandomReal(50.00, 800.00), GetRandomReal(0.00, 360.00))
        set u = CreateUnit(p, 'h003', debug1, debug2, 270.00)
        call UnitAddAbility(u, 'A05N')
        call SetUnitAbilityLevel(u, 'A05N', 1)
        call UnitApplyTimedLife(u, 'BTLF', 10.00)
        call IssuePointOrderLoc(u, "flamestrike", ll)
        set ii = ii + 1
    endloop
    set i = GetRandomInt(5, 8)
    set ii = 0
    call PolledWait(1.00)
    [B]loop
        exitwhen ii == i
        set ll = PolarProjectionBJ(l, GetRandomReal(50.00, 800.00), GetRandomReal(0.00, 360.00))
        set u = CreateUnit(p, 'h003', debug1, debug2, 270.00)
        call UnitAddAbility(u, 'A05O')
        call SetUnitAbilityLevel(u, 'A05O', 1)
        call UnitApplyTimedLife(u, 'BTLF', 10.00)
        call IssuePointOrderLoc(u, "inferno", ll)
        call PolledWait(GetRandomReal(0.75, 1.75))
        set ii = ii + 1
    endloop
    
    call RemoveLocation(l)
    call RemoveLocation(ll) 
    set cast = null
    set u = null
    set p = null
    set l = null
    set ll = null
endfunction
[/B]
//===========================================================================
function InitTrig_Hell_Strike takes nothing returns nothing
    set gg_trg_Hell_Strike = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Hell_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Hell_Strike, Condition( function Trig_Hell_Strike_Conditions ) )
    call TriggerAddAction( gg_trg_Hell_Strike, function Trig_Hell_Strike_Actions )
endfunction

I bolded the lines where I think it happens, because of the wait (It doesn't crash right away, it crashes 1 second after I cast the spell).

P.S. Testing in Single Player with 1 computer.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Well, I'll then add a small information that tickled (does this word even exist? :p) me. The Inferno spell had to summon nothing because I want it to be only meteors crashing, no infernals or anything appearing, so I set it to "Dummy".

It creates a dummy upon landing. Might be the cause of the problem?

I didn't find a "none" choice :cool:
 

Sim

Forum Administrator
Staff member
Reaction score
534
Any ideas? :p

It's still crashing... :(
 

emjlr3

Change can be a good thing
Reaction score
395
add debug msgs and see which line it crashes on
 

Sim

Forum Administrator
Staff member
Reaction score
534
Debug messages are kinda useless when you don't even have the time to read what displays :(
 

SFilip

Gone but not forgotten
Reaction score
634
Perhaps line by line elimination (commenting) until you find the one to blame?
 

Sir Gordon

Decent User (I'm as good as you)
Reaction score
43
>P.S. Testing in Single Player with 1 computer.
Does this also happen in Local Test Map? (F9)

Just a question.
 

Sim

Forum Administrator
Staff member
Reaction score
534
post the Inferno spell.

Here it is.

@Chocobo: Shouldn't be the problem, since I also got a similar line just before the loop, and it isn't crashing.

-------------------

Keep in mind this is only the dummy spell that spawns once the flame strikes are over (In short: after the polledwait).
 

Attachments

  • Inferno.w3x
    16.3 KB · Views: 202

Sim

Forum Administrator
Staff member
Reaction score
534
*breaking news*

After commenting all the trigger, it appears the bug comes from the base spell, Flame Strike. It makes the game lag, I don't know why... It doesn't crash though, only lags. But when I add up more flame strikes, it crashes.

I reduced the AoE from 99999 to 800, and it helped, but still...

Any ideas why a simple flame strike spell makes the game lag?

Here's a screenshot of the object editor.
 

Master

Thou shall be helped by...The Black Adder!
Reaction score
72
Maximum damage? :rolleyes:
Even though in normal state it's not a thing to make Wc3 lag, you can always try to change it.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Well, I'm always casting it on no unit, just to see.

If maximum damage is the cause, it'd be odd, since it damages no unit when I test it :p Worth a try though.
 

emjlr3

Change can be a good thing
Reaction score
395
half damage interval, 0, that is, well, forever and ever always, try a 1 there too

btw, debug msgs are good, at a wait after each line and a msg, that way u can see it displayed before it crashes
 

Sir Gordon

Decent User (I'm as good as you)
Reaction score
43
Hm...did you try to make an exact spell with that and try the new one? maybe it won't work, but who knows...
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
btw, debug msgs are good, at a wait after each line and a msg, that way u can see it displayed before it crashes
sry for the offtopic and the noobie question
what are debug msgs? :confused:
 

emjlr3

Change can be a good thing
Reaction score
395
Code:
function BJDebugMsg takes string msg returns nothing
    local integer i = 0
    loop
        call DisplayTimedTextToPlayer(Player(i),0,0,60,msg)
        set i = i + 1
        exitwhen i == bj_MAX_PLAYERS
    endloop
endfunction
 

Sim

Forum Administrator
Staff member
Reaction score
534
half damage interval, 0, that is, well, forever and ever always, try a 1 there too

I will try this.

btw, debug msgs are good, at a wait after each line and a msg, that way u can see it displayed before it crashes

The trigger doesn't exist anymore. This simple spell in object editor lags the game out...

It doesn't crash anymore though.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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