Need some guidance...

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
luftwaffetf
Private
Posts: 4
Joined: Sat Sep 18, 2004 1:38 pm
Contact:

Need some guidance...

Post by luftwaffetf »

I have made a map and I've never scripted b 4, so I looked up some tut's for stuff I wanted to add to it. My map runs fine on my local machine as a server to test it, but when I add the .scr file to it I get this error and it crashes back to the war room. ERROR: CL_ParseGamestate:bad command byte:-1
I have no idea what this means or how to fix it...can someone help?
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

I got the same error recently when trying to convert a sp map into an mp version. I can't really pin point what was causing the error but I did fix it by removing these lines from the original scr.

// $rubblesmoke anim start
// $new_fire anim stop
// $new_fire_1 anim stop

The error stopped once these lines were commented.
Dosn't really help you I spose seeing as yours is your own creation.
An ambiguous question will get a similar answer...
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

almost looks like an input error :S

-1 is a returned Unicode value after input is finished, dunno if MoH uses Unicode (stupid) or ASCII (good)
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

-1 is just a number :P

Anyway, luftwaffetf, that error sounds only remotely familiar... could you maybe post the script so that we can have a look at it?
Image
luftwaffetf
Private
Posts: 4
Joined: Sat Sep 18, 2004 1:38 pm
Contact:

Post by luftwaffetf »

well...here it is! I made a small box map that works fine...but when I put the explosions in my larger map...it crashes.

Code: Select all

// Test
// ARCHITECTURE: :{bbf}:LuftWaffe|TF|
// SCRIPTING: :{bbf}:LuftWaffe|TF|

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Allied Objective:"
setcvar "g_obj_alliedtext2" "Storm the V2 Complex"
setcvar "g_obj_alliedtext3" "Axis Objective:"
setcvar "g_obj_axistext1" "Defend the Complex"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" "Map by :{bbf}:LuftWaffe|TF|"

setcvar "g_scoreboardpic" "none" // your score board picture

level waittill prespawn

exec global/DMprecache.scr

exec global/ambient.scr    //yourmapname 
// may want to make your own ambient sounds, read the tut

level.script = "maps/dm/test.scr" 
// remember to put in your map name

level waittill spawn
thread boom1
thread boom2
thread boom3
thread boom4

end


//add more codes here after you add more features to your maps




boom1:

	wait (randomfloat 5 + 10)
	$boom1 anim start
	radiusdamage $boom1 128 256
	goto boom1
end

boom2:

	wait (randomfloat 5 + 10)
	$boom2 anim start
	radiusdamage $boom2 128 256
	goto boom2
end

boom3:

	wait (randomfloat 5 + 10)
	$boom3 anim start
	radiusdamage $boom3 128 256
	goto boom3
end

boom4:

	wait (randomfloat 5 + 10)
	$boom4 anim start
	radiusdamage $boom4 128 256
	goto boom4
end
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Try this script. I gave a parameter to exec global/ambient.scr, you had not done that... either give it a music to play (like m6l1a), or comment out the entire line.

I also removed the code repetitions by doing a small change. And goto is the devil, so I replaced it with a while loop thar runs forever ( or at least until the map restarts :) )

Code: Select all

// Test
// ARCHITECTURE: :{bbf}:LuftWaffe|TF|
// SCRIPTING: :{bbf}:LuftWaffe|TF|

main:

	// set scoreboard messages
	setcvar "g_obj_alliedtext1" "Allied Objective:"
	setcvar "g_obj_alliedtext2" "Storm the V2 Complex"
	setcvar "g_obj_alliedtext3" "Axis Objective:"
	setcvar "g_obj_axistext1"   "Defend the Complex"
	setcvar "g_obj_axistext2"   " "
	setcvar "g_obj_axistext3"   "Map by :{bbf}:LuftWaffe|TF|"

	setcvar "g_scoreboardpic" "none" // your score board picture

	level waittill prespawn

	exec global/DMprecache.scr

	exec global/ambient.scr m6l1a
	// may want to make your own ambient sounds
	// or use existing ones, read the tut

	level.script = "maps/dm/test.scr"
	// remember to put in your map name

	level waittill spawn
	thread boom $boom1
	thread boom $boom2
	thread boom $boom3
	thread boom $boom4

end

//add more codes here after you add more features to your maps
boom local.bomber:
	while(1)
	{
		wait (randomfloat 5 + 10)
		local.bomber anim start
		radiusdamage local.bomber 128 256
	}
end
... try it, hope it works better.
Admin .MAP Forums
Image
Head above heels.
luftwaffetf
Private
Posts: 4
Joined: Sat Sep 18, 2004 1:38 pm
Contact:

Post by luftwaffetf »

thanks...I'll give it a try tomorrow...I gotta get to work :(
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

I dunno, I still recon it's something to do with the anim command or model used, as I said above, once those lines were commented, I got the exact same error and crash back to desktop.
Grassy
An ambiguous question will get a similar answer...
luftwaffetf
Private
Posts: 4
Joined: Sat Sep 18, 2004 1:38 pm
Contact:

Post by luftwaffetf »

Thanks Bjarne...works like a charm now
Post Reply