game crashes when loading map


(NavySeal) #1

I added a constructable ladder to my map. I tested it but it didnt work properly, i found out that i dont have a script for my map. So i added a script but when i loaded the map the game froze.

here is a picture of where i put the script and the script itself
http://www.mpomsar.szm.sk/stranky/MaZ%20clan/untitled2.htm


(=DaRk=CrAzY-NuTTeR) #2

i see whats happend, the script is like layers, opend and closed by { and }

you have missed a few of these out

game_manager
{
	{
	spawn
	{
	wm_axis_respawntime 5
	wm_allied_respawntime 5
	wm_number_of_objectives 0
	wm_set_round_timelimit 20

	wm_set_defending_team 0

	wm_setwinnner 0
	}
}

allied ladder
{
	{
	spawn
	{
	wait 200
	trigger self setup

	constructible_class 2
	}

	trigger setup
	{
	setstate allied ladder invisible

	setstate build1 default
	}

	buildstart final
	{
	setstate allied ladder underconstruction

	setstate build1 default
	}

	built final
	{

	setstate allied ladder default

	setstate build1 invisible

	wm_announce "The Allied ladder has been constructed!"
	}

	decayed final
	{
	setstate allied ladder invisible

	setstate build1 default
	}

	death
	{
	setstate allied ladder invisible

	setstate build1 default

	wm_announce "Axis have destroyed the Allied ladder!"
}

try that :moo:


(chavo_one) #3

i see whats happend, the script is like layers, opend and closed by { and }

you have missed a few of these out

11 open parens != 8 close parens :bash:


(nUllSkillZ) #4

Ifurita has written a very good introduction into scripting:
http://planetwolfenstein.com/4newbies/Map_Scripting_4_Newbies.pdf


(=DaRk=CrAzY-NuTTeR) #5

dose it work?


(NavySeal) #6

Nope, still keeps crashing. :banghead:


(=DaRk=CrAzY-NuTTeR) #7

dose it just crash or dose it give an error


(NavySeal) #8

It just keeps awating connection forever.


(chavo_one) #9

Do you have a script_multiplayer entity in your map?

And if so, did you give it the key/value pair of “scriptname” “game_manager”?


(NavySeal) #10

I think i dont have that. Could u explain where to put it ?


(MadJack) #11

I haven’t read everything in the thread so It’s probably not that but check the mapscoordsmins and mapcoordsmaxs


(NavySeal) #12

I hope i got those right, do they have to be exact?


(chavo_one) #13

If you had bad min and max coordinates it would load your map and crash the first time you went to the limbo menu. If you aren’t even getting that far, then it’s not your coordinates causing this.

The script_multiplayer is an entity that you add to your map in Radiant. If you are not familiar with this, you really need to read Ifurita’s scripting guide (link provided above by nullskillz).


(NavySeal) #14

The map worked fine before i added the script and i dont have any spawns yet, i use info_player_start for testing the map. Also i played the map without any map coordinates before and it worked fine. I wanna get the constructible working and then ill have a look at the spawns.


(NavySeal) #15

I got the spawns working properly and i set the map coordinates, everything seems to work. But when i add the script the map wont load. :frowning:


(chavo_one) #16

spawns and script_multiplayer are two different things. Have you properly set up a script_multiplayer entity or not?


(NavySeal) #17

I put the script_multiplayer entity (the small pink cube) and put key-scriptname and value-game_manager, still keeps awaiting connection.


(nUllSkillZ) #18

Do you have a seperate installation for mapping?
If not may be there are to many “.pk3”-files in your etmain directory.


(=DaRk=CrAzY-NuTTeR) #19

delete all the campaign files


(MadJack) #20

Here’s the corrected script with indentation. Much easier to read. Also, as chavo_one pointed out, there were some braces missing and a one too many open brace.

I think the main problem was with the “allies ladder”. AFAIK you can’t have spaces in a routine/scriptblock so make sure you replace it elsewhere (if called directly from an ent).


game_manager 
{ 
	spawn 
	{ 
	   wm_axis_respawntime 5 
	   wm_allied_respawntime 5 
	   wm_number_of_objectives 0 
	   wm_set_round_timelimit 20 
	
	   wm_set_defending_team 0 

	   wm_setwinnner 0 
	} 
} 

allied_ladder 
{ 
	spawn 
	{ 
	   wait 200 
	   trigger self setup 
	   constructible_class 2 
	} 

	trigger setup 
	{ 
	   setstate allied_ladder invisible 
	
	   setstate build1 default 
	} 

	buildstart final 
   	{ 
	   setstate allied_ladder underconstruction 
	
	   setstate build1 default 
   	} 

	built final 
	{ 
	   setstate allied_ladder default 
	
	   setstate build1 invisible 
	
	   wm_announce "The Allied ladder has been constructed!" 
   } 

	decayed final 
	{ 
	   setstate allied_ladder invisible 
	
	   setstate build1 default 
	} 

	death 
	{ 
	   setstate allied_ladder invisible 
	
	   setstate build1 default 
	
	   wm_announce "Axis have destroyed the Allied ladder!" 
	}
}

That should work.