Fatal Error Before Map Loads..

Charapanga

New Member
Reaction score
46
As the title suggests, my map crashes even before it fully loads the error is something like this:

This application has encountered a critical error:

FATAL ERROR!

Program: C:\Program Files\Warcraft III\War3.exe
Exception: 0xC0000005 ( ACCESS_VIOLATION) at 001B:6f4216E1

The instruction at '0x6F4216E1' refferenced memory at '0x00000020'
The memory could not be 'read'.

Press OK to terminate the application.

I have NO imports
I have 2 custom units (Critters)
Last thing i added is a Library to a trigger
JASS:
library globals 

globals
    private group GodG = CreateGroup()
endglobals

function God takes nothing returns unit
    set GodG = GetUnitsInRectAll(gg_rct_God)
    return FirstOfGroup(GodG)
endfunction

endlibrary


And it crashes at around 75%
 
Reaction score
341

Azlier

Old World Ghost
Reaction score
461
Have you tried using the native? I don't know if it will help much or not...

JASS:
library Globals 

globals
    private group GodG = CreateGroup()
endglobals

function God takes nothing returns unit
    call GroupEnumUnitsInRect(GodG,gg_rct_God,null)
    return FirstOfGroup(GodG)
endfunction

endlibrary


EDIT: Well, almost beaten. But I found the answer! GroupEnumUnitsInRect returns nothing, you cannot set anything to it.
 

Charapanga

New Member
Reaction score
46
JASS:
scope Testing initializer Init

private function Actions takes nothing returns nothing
    local player p = GetTriggerPlayer()
    call CreateFogModifierRectBJ(true, p,FOG_OF_WAR_VISIBLE ,GetPlayableMapRect())
    set p = null
endfunction

//===========================================================================
private function Init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    local integer i = 0
    loop
        call TriggerRegisterPlayerChatEvent(t, ConvertedPlayer(i), "-test", true)
        set i = i + 1
        exitwhen i == 12
    endloop
    call TriggerAddAction( t, function Actions )
endfunction

endscope

JASS:
scope Weather initializer Init

private function Actions takes nothing returns nothing
    local location loc = GetRandomLocInRect(GetPlayableMapRect())
    local effect SFX = AddSpecialEffectLocBJ(loc, "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl")
    call UnitDamagePointLoc(God(), 0.1, 20, loc, GetRandomReal(100, 200), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING)
    call DestroyEffect(SFX)
    set SFX = null
    call RemoveLocation(loc)
    set loc = null
endfunction

//===========================================================================
function Init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic(t, 1.00)
    call TriggerAddAction( t, function Actions )
    set t = null
endfunction

endscope


JASS:
function NSMatching takes nothing returns boolean
    return GetUnitTypeId(GetFilterUnit()) == 'nnsu'
endfunction

function NSActions2 takes nothing returns nothing
    call PauseUnit(GetEnumUnit(), true)
    call SetUnitAnimation(GetEnumUnit(), "Spell")
endfunction

function NSActions takes nothing returns nothing
    local group g = CreateGroup()
    set g = GetUnitsInRectMatching(gg_rct_Summoners, Condition(function NSMatching))
    call ForGroupBJ(g, function NSActions2)
    call DestroyGroup(g)
    set g = null
    call DestroyTrigger(GetTriggeringTrigger())
endfunction

//===========================================================================
function Init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterTimerEvent(t, 0.01, false)
    call TriggerAddAction( t, function NSActions )
    set t = null
endfunction

These
 

Azlier

Old World Ghost
Reaction score
461
JASS:
scope Testing initializer Init

private function Actions takes nothing returns nothing
    local player p = GetTriggerPlayer()
    call CreateFogModifierRectBJ(true, p,FOG_OF_WAR_VISIBLE ,GetPlayableMapRect())
    set p = null
endfunction

//===========================================================================
private function Init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    local integer i = 0
    loop
        call TriggerRegisterPlayerChatEvent(t, ConvertedPlayer(i), "-test", true)
        set i = i + 1
        exitwhen i == 12
    endloop
    call TriggerAddAction( t, function Actions )
endfunction

endscope


See that ConvertedPlayer? That's a BJ which returns the player of the number you plug in - 1. It's useless. Anyway, its crashing your game because it calls for Player(-1)
 
Reaction score
341
JASS:
scope Testing initializer Init

private function Actions takes nothing returns nothing
    local player p = GetTriggerPlayer()
    call CreateFogModifierRectBJ(true, p,FOG_OF_WAR_VISIBLE ,GetPlayableMapRect())
    set p = null
endfunction

//===========================================================================
private function Init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    local integer i = 0
    loop
        call TriggerRegisterPlayerChatEvent(t, ConvertedPlayer(i), "-test", true)
        set i = i + 1
        exitwhen i == 12
    endloop
    call TriggerAddAction( t, function Actions )
endfunction

endscope


Change to

JASS:
scope Testing initializer Init

private function Actions takes nothing returns nothing
    local player p = GetTriggerPlayer()
    call CreateFogModifierRectBJ(true, p,FOG_OF_WAR_VISIBLE ,GetPlayableMapRect())
    set p = null
endfunction

//===========================================================================
private function Init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    local integer i = 0
    loop
        call TriggerRegisterPlayerChatEvent(t, GetPlayerId(i), "-test", true)
        set i = i + 1
        exitwhen i == 12
    endloop
    call TriggerAddAction( t, function Actions )
endfunction

endscope
 

Azlier

Old World Ghost
Reaction score
461
Nope. You need Player(i). That's right, just Player(i).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top