about scripts

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Marines
Corporal
Posts: 46
Joined: Wed Dec 31, 2003 10:16 pm
Location: Mi
Contact:

about scripts

Post by Marines »

how do i make a script
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

Post by Axion »

"The work of a thousand years is nothing but rubble."
- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9
Image
Marines
Corporal
Posts: 46
Joined: Wed Dec 31, 2003 10:16 pm
Location: Mi
Contact:

Post by Marines »

do i have to make a precache and a scr file for my map
bighoss
Major
Posts: 276
Joined: Fri Jan 09, 2004 3:34 pm
Location: USA, Ohio

Post 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.
Image
Strive to accomplish great things!!
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

obj

Post 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
Tom Trude,

Image
Post Reply