HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

All triggers running at map init refuse to work!

04-20-2008, 05:21 PM#1
Na_Dann_Ma_GoGo
Hey guys,
I've run in serious problems with my map. I dunno when exactly it happens but there was a point from which of all of my triggers that run at map initiallization don't seem to work (only for one map). I hope nothing got corrupted in my map but I've already tries this:

-downloaded the newest NewGen today
-changed init trigger to a scope to init it that way (who knows, got have helped^^)
-removed ALL triggers from my map and created a new that runs at map init

Everything failed . I really can't figure out why this crap doesn't work because I didn't change something important... or at least don't remember. The triggers work fine when I use a timer event after 1sec or so...

Please try to help me here, if necessary I could post my map in a pm.
04-20-2008, 05:30 PM#2
Rising_Dusk
Check all of your triggers' InitTrigs, you must be crashing the thread in one of those. Make sure all vars used are initialized and so forth.
04-20-2008, 05:31 PM#3
Alexander244
Yeah, we're probably going to need to see the code.

Quote:
-changed init trigger to a scope to init it that way (who knows, got have helped^^)
-removed ALL triggers from my map and created a new that runs at map init
For the first you changed this:
Collapse JASS:
function InitTrig_A takes nothing returns nothing
endfunction
to this:
Collapse JASS:
scope A
    public function InitTrig takes nothing returns nothing
    endfunction
endscope
?

No quite sure what you mean by the second; you have one onInit that calls the other Init functions?
04-20-2008, 06:08 PM#4
Na_Dann_Ma_GoGo
At Rising Dusk:
Well I thought about that as well... but as I stated I removed all my triggers and then created a new that runs at initialization. And even then it did not work.

And about the scope stuff, I know how to use scopes correctly, that's not my problem. And I hardly doubt showing the code could help... as I said I removed all and blabla.. :/
04-20-2008, 06:09 PM#5
Rising_Dusk
If you removed all code from your map, I'm unsure how in the world you could test if a thread is crashing or not.
04-20-2008, 06:29 PM#6
Captain Griffen
This would be the syntax:

Collapse JASS:
scope A initializer InitTrig
    public function InitTrig takes nothing returns nothing
    endfunction
endscope

We can't help witout code and/or a map.
04-20-2008, 06:39 PM#7
Na_Dann_Ma_GoGo
Quote:
Originally Posted by Rising_Dusk
If you removed all code from your map, I'm unsure how in the world you could test if a thread is crashing or not.

Well in creating a single new trigger and test whether it works or not?


However tell me whom I shall post the map and I do it via pm, don't want to post it public you know.
04-20-2008, 06:43 PM#8
Rising_Dusk
Quote:
Originally Posted by Na_Dann_Ma_GoGO
Well in creating a single new trigger and test whether it works or not?
Well, if that single trigger includes all code from the other triggers, it would still include anything that's causing a thread crash. Just go through the InitTrigs one by one, I can almost guarantee that's where it is.
04-20-2008, 06:43 PM#9
Captain Griffen
Just pastebin it in the next hour or so and I'll try and take a look at it.
04-20-2008, 06:47 PM#10
Na_Dann_Ma_GoGo
Quote:
Originally Posted by Rising_Dusk
Well, if that single trigger includes all code from the other triggers, it would still include anything that's causing a thread crash. Just go through the InitTrigs one by one, I can almost guarantee that's where it is.

Nahh^^, I mean I removed simply everything and made a new simple trigger that shall create a footman for red at map init. And even then, that one did NOT work.

Okay Griffen I'll put all triggers that shall be run at map ini into one folder and send you the map. Take as much time as you want, it doesn't hurry.
Thanks in advance.
04-20-2008, 06:47 PM#11
Alexander244
public InitTrig doesn't need initializer (assuming scope name is the same as trigger-block name), nor will it work as it gets scope name as suffix and not prefix.
04-20-2008, 06:59 PM#12
Rising_Dusk
Quote:
Originally Posted by Na_Dann_Ma_GoGO
Nahh^^, I mean I removed simply everything and made a new simple trigger that shall create a footman for red at map init. And even then, that one did NOT work.
That sounds like something a lot more serious than a code failure.
04-20-2008, 07:05 PM#13
Na_Dann_Ma_GoGo
Yes... that's why I posted this in general thread. Since it works for other maps it shouldn't be an editor specific problem... but further than that I have no clue.
04-20-2008, 08:09 PM#14
Captain Griffen
Okay, basically, change the scope declaration to this:

Collapse JASS:
scope Initialization initializer InitTrig

And change the InitTrig function to this:

Collapse JASS:
private function InitTrig takes nothing returns nothing
    call Actions.execute()
endfunction

There is no way that the WE will run your trigger at map init, unless you use the variable created by WE for your trigger.
04-20-2008, 08:21 PM#15
Na_Dann_Ma_GoGo
Ahh okay thanks, will do that in future. Yet that's not the origin of my problem in the case of my map, since I did that scope add AFTER my problem occured :/