Page 1 of 1

about scripts

Posted: Fri Feb 27, 2004 9:43 pm
by Marines
how do i make a script

Posted: Fri Feb 27, 2004 10:19 pm
by Axion

Posted: Tue Mar 02, 2004 3:29 pm
by Marines
do i have to make a precache and a scr file for my map

Posted: Tue Mar 02, 2004 3:36 pm
by bighoss
From what I have read you dont need a precache_dm.scr for tdm,ffa, or obj. But if your doing an SP map you will need it.

obj

Posted: Tue Mar 02, 2004 9:29 pm
by tltrude
An objective map, or a singleplayer map will not work with out a script. But you don't need one if you put your bsp file in main/maps/dm.

It is nice to have one for background sound. A precache script helps to make your map run faster when it is loaded for the first round. It pre loads all the models, so players don't get those little pauses when they look around.

If you want to try a simple script, copy and paste this to Notepad. Then name it "youmapname.scr" and place it in the dm folder with your bsp file. Both files must have the same name.

Code: Select all

// TEST MAP
// ARCHITECTURE: Marines
// SCRIPTING: Marines

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "My Test Map"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" ""


	level waittill prespawn

	//*** Precache Dm Stuff
	exec global/DMprecache.scr

	exec global/ambient.scr mohdm7 // background sound
	
	level waittill spawn

end