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

[Crash] WTF nothing works

Status
Not open for further replies.
Level 5
Joined
Dec 12, 2011
Messages
116
Hello guys.
I created a new map. Made lots of things.
When I tested it, nothing happened. I mean, NONE of my triggers runned. Then I deleted them all and created the single following trigger:
- On Map Initialization
- Display to (All Players) for 30 seconds the text: "WTF?"

Tested my map. No message to me.
Why the hell is this happening?

You can download the map here (attach).

hamsterpellet
 

Attachments

  • WhatAFuckingBug.w3x
    68.5 KB · Views: 37
Your trigger functions aren't being initialized for some unknown reason..

This will not work
  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: Test
but this will
JASS:
struct tester extends array
    private static method onInit takes nothing returns nothing
        call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"TEST")
    endmethod
endstruct


Now, what I've tried doing is converting ur trigger to custom text and deleting everything but the trigger function and putting a little text message in there. Got nothing... interesting : P. What this means is that the trigger ini function was never called by the map. I'm going to open up the JASS file to see what's going on.


Not sure what to tell you =o.


edit
I believe I solved your problem. I bet you that the globals are crashing the thread.


JASS:
function main takes nothing returns nothing
    call SetCameraBounds(- 5376.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), - 5632.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 5376.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 5120.0 - GetCameraMargin(CAMERA_MARGIN_TOP), - 5376.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 5120.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 5376.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), - 5632.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM))
    call SetDayNightModels("Environment\\DNC\\DNCFelwood\\DNCFelwoodTerrain\\DNCFelwoodTerrain.mdl", "Environment\\DNC\\DNCFelwood\\DNCFelwoodUnit\\DNCFelwoodUnit.mdl")
    call NewSoundEnvironment("Default")
    call SetAmbientDaySound("FelwoodDay")
    call SetAmbientNightSound("FelwoodNight")
    call SetMapMusic("Music", true, 0)
    call CreateRegions()
    call CreateAllUnits()
    call InitBlizzard()

call ExecuteFunc("jasshelper__initstructs7774621")

    call InitGlobals()
    call InitTrig_Untitled_Trigger_001() // INLINED!!

endfunction

As you see, it never makes it to the InitTrig call and the rest of the things certainly don't crash. When looking at InitGlobals.

JASS:
function InitGlobals takes nothing returns nothing
    local integer i= 0
    set udg_CONST_SafeLocX=- 5000.00
    set udg_CONST_SafeLocY=5000.00
    set udg_AbilitiesToPreloadQT=0
    set udg_tempReal=0
    set udg_GDD_Event=0.00
    set udg_GDD_Damage=0.00
    set i=0
    loop
        exitwhen ( i > 8190 )
        set udg_GDD__TriggerArray[i]=CreateTrigger()
        set i=i + 1
    endloop

    set i=0
    loop
        exitwhen ( i > 8190 )
        set udg_GDD__Integers[i]=0
        set i=i + 1
    endloop

    set udg_GDD__LeftMapGroup=CreateGroup()
    set udg_HeroStockStartDelay=12.00
    set udg_GAMEMODE_allrandom=false
    set udg_GAMEMODE_allpick=true
    set udg_TIME_seconds=0
    set udg_TIME_minutes=0
    set udg_playersPlaying=CreateForce()
    set udg_GAMEMODE_GMstring="DEFAULT"
    set udg_tempInteger=0
    set udg_GAMEMODE_norepick=false
    set udg_tempString=""
    set udg_GAMEMODE_StringToShow=""
    set i=0
    loop
        exitwhen ( i > 10 )
        set udg_PXHeroIsSelected[i]=false
        set i=i + 1
    endloop

    set i=0
    loop
        exitwhen ( i > 8190 )
        set udg_HeroTypeAlreadyTaken[i]=false
        set i=i + 1
    endloop

    set i=0
    loop
        exitwhen ( i > 10 )
        set udg_PXUsedRandom[i]=false
        set i=i + 1
    endloop

    set i=0
    loop
        exitwhen ( i > 10 )
        set udg_PXCanRepick[i]=false
        set i=i + 1
    endloop

    set udg_tempIntegerForRealCreateHero=0
endfunction

That's certainly enough to crash the thread ; P. Try changing the array sizes all to 0 and that will fix it. Don't worry, it won't actually change the array sizes, it'll just fix up your init ^)^.


edit
After modifying all of your array sizes to 1, the trigger worked. Thread crash was the problem : ). Always set ur array size to 1 unless u want to crash ur Main function : D.


edit
maddeem has been owned by the nes : P
 

Attachments

  • WhatAFuckingBug.w3x
    67.7 KB · Views: 38

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
This must be like the 7th time I have seen someone encounter the initializer thread crash problem.

In this situation, open map and just look at the GUI variables. If not the GUI variables, then it must be due to too many GUI events and triggers (as they are also initialized in the same thead if I recall).
 
Level 5
Joined
Dec 12, 2011
Messages
116
Hey Nestharus!! Good news:
This lovely map is kidding with me again. :B

  • BI Basic Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set playersPlaying = (All players matching (((Matching player) slot status) Equal to Is playing))
On my tests, that group receives 10 players (from 1 to 10). Player 1 is human, and Players 2-10 are computers.

  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) types a chat message containing myfunc as An exact match
    • Conditions
    • Actions
      • Player Group - Pick every player in playersPlaying and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: Running Loop.
      • Player Group - Pick every player in playersPlaying and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: Running Loop 2.
          • Custom script: call FUNC1( GetEnumPlayer() )
When I test my map, I write "myfunc" at the chat and there is what I receive:


Running Loop.
Running Loop.
Running Loop.
Running Loop.
Running Loop.
Running Loop.
Running Loop.
Running Loop.
Running Loop.
Running Loop.
Running Loop 2.

You can see the JASS below:

JASS:
function FUNC2 takes nothing returns nothing
    call SetPlayerUnitAvailableBJ( udg_tempUnitType, false, GetEnumPlayer() )
endfunction
function FUNC1 takes player p returns nothing
    set udg_tempUnitType = 'Obla'
    call ForForce( udg_playersPlaying, function FUNC2 )
endfunction

PS: This is not the full code. I mean, on my map, My functions do more things than that. But I removed that parts in order to make things smaller.

hamsterpellet
 
Well, you are doing some weird things in the second loop...

#1, I'd display text like -> call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"message". That will display to all players without a silly loop.

#2, wth is up with a ForForce inside of a ForForce.. That means for each player, you are doing something for each player..

like this
JASS:
loop through all players
    loop through all players
        set unit available to false

see what I'm talking about? It should be

JASS:
loop through all players
    set unit available to false

You have mystery nested loop in there... and why you pass the enumerated player I have no idea >.<.


Now, when you run into an issue like this, it usually means a thread crash. A thread crash normally comes from either op limit hit or some variable that wasn't initialized. I see no variable that wasn't initialized here, so try disabling Custom Script and see if your Run Loop 2 or w/e will run 10x. Then enable it and comment out the nested ForForce. You need to disable things until you find the culprit ; P.
 
Level 5
Joined
Dec 12, 2011
Messages
116
So, I can't do a ForForce inside a ForForce? never?
What if I really needed to do it that way (probably, this will never happen, but..)

Thanks anyways. I'll try to solve it and post here if it worked (through edit)

edit
Problem solved. Nestharus, you are the best.
 
Last edited:
Status
Not open for further replies.
Top