Script

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
snajperu
Colour Sergeant
Posts: 75
Joined: Sun Nov 20, 2005 5:44 pm

Script

Post by snajperu »

Hi all,

I can make a nice map i think, but one what i do not know how to make is script, I have readed a lot of scripting tuts but when I save my script as test_mapname.scr, and compile my map the script doesn't work :(
All is ok but script is not! Why, plx help me.

Cheers, snajperu

P.S I'm not from UK or USA, so sorry for my english. I'm learning english
Sojuz nieruszymyj riespublik swobodnych,
Splotila nawieki Wielikaja Rus'
Da zdrawstwujet sozdannyj wolej norodow,
Jedinyj, moguczij Sowitskij Sojuz!

Slaw'sia Otieczestwo nasze swobodnoje,
Druzby narodow nadioznyj oplot!
Znamia sowietskoje, znamia narodnoje
Pust' ot pobiedy k pobiedie wiediot!
PKM
General
Posts: 1888
Joined: Tue Aug 09, 2005 4:43 pm
Location: Philadelpia but stuck in San Antonio TX (hell)

Post by PKM »

put it in a .pk3 file.

get pakscape. open and run. create the following directories...

maps/dm <---put yourmap.bsp & .scr in here


save as yourmap.pk3, place in main, run mohaa.

the above is assuming your .scr file has no errors. might want to post your .scr file with code tags in this thread.
i'm not f****** angry, i'm from philadelphia .
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

This topic should be a sticky. It comes up alot.
snajperu
Colour Sergeant
Posts: 75
Joined: Sun Nov 20, 2005 5:44 pm

Post by snajperu »

So, should I name my script as mymapname.pk3? or mymapname.scr and put it in my maps directory or in main?

Thx a lot

and please reply
Sojuz nieruszymyj riespublik swobodnych,
Splotila nawieki Wielikaja Rus'
Da zdrawstwujet sozdannyj wolej norodow,
Jedinyj, moguczij Sowitskij Sojuz!

Slaw'sia Otieczestwo nasze swobodnoje,
Druzby narodow nadioznyj oplot!
Znamia sowietskoje, znamia narodnoje
Pust' ot pobiedy k pobiedie wiediot!
@(...:.:...)@
Corporal
Posts: 37
Joined: Wed Nov 23, 2005 3:42 pm
Location: Cambridge UK

Post by @(...:.:...)@ »

Hi :)

You just need to name your script as your .bsp is.

Eg, if your map is dm_rathunt.bsp then your script must be named dm_rathunt.scr.

It must be in the same folder as the bsp.

Eg, if your map is a dm map, it would be

maps/dm/dm_rathunt.scr

if it was an obj map, it would be

maps/obj/dm_rathunt.scr

If it was a single player map it would be:

maps/dm_rathunt.scr

Here is an example basic map script you can use. Paste this into wordpad or notepad and save it as as I instucted above.

Code: Select all

// Rat Hunt
// ARCHITECTURE: snajperu
// SCRIPTING: snajperu

// -------------------------------------------------------------------------------------
main:
// -------------------------------------------------------------------------------------

		setcvar "g_obj_alliedtext1" "- Find and destroy" 
		setcvar "g_obj_alliedtext2" "the nest of evil"
		setcvar "g_obj_alliedtext3" "Man-Eating Rats"

		setcvar "g_obj_axistext1" "- Defend the evil rats,"
		setcvar "g_obj_axistext2" "and possibly get eaten by them"
		setcvar "g_obj_axistext3" "By snajperu"

	setcvar "g_scoreboardpic" "dmrathunt"	//need to make a shader for this, or you can use a texture path, eg "textures/rathunt/rathuntscoreboard.tga"

	///////////////////////
	level waittill prespawn
	///////////////////////

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

	level.script = maps/dm/dm_rathunt.scr
	exec global/ambient.scr obj_team1	//you can change the ambiant sounds here...

	////////////////////
	level waittill spawn
	////////////////////
	
	$world farclipoverride -1	//change depending on your map
//also setup fog here
end
Image

<3 arrays.
User avatar
Herr_Kruger
Private
Posts: 7
Joined: Thu Mar 31, 2005 4:35 pm
Location: Mallorca Island, Spain

Post by Herr_Kruger »

Hello Hal, you write too much :P

What Hal posted seems fine, but i will not use the
$world farclipoverride -1
just in case you are doing this for AA, since that a variable for SH and BT.
Image
@(...:.:...)@
Corporal
Posts: 37
Joined: Wed Nov 23, 2005 3:42 pm
Location: Cambridge UK

Post by @(...:.:...)@ »

Hehe hi Kruger :D

I can't help it. :S If I don't try to help people I might get withdrawal symptoms. :shock:

Thanks for pointing that out. :)
Image

<3 arrays.
snajperu
Colour Sergeant
Posts: 75
Joined: Sun Nov 20, 2005 5:44 pm

Post by snajperu »

THX a lot MAN!! :D
Sojuz nieruszymyj riespublik swobodnych,
Splotila nawieki Wielikaja Rus'
Da zdrawstwujet sozdannyj wolej norodow,
Jedinyj, moguczij Sowitskij Sojuz!

Slaw'sia Otieczestwo nasze swobodnoje,
Druzby narodow nadioznyj oplot!
Znamia sowietskoje, znamia narodnoje
Pust' ot pobiedy k pobiedie wiediot!
PKM
General
Posts: 1888
Joined: Tue Aug 09, 2005 4:43 pm
Location: Philadelpia but stuck in San Antonio TX (hell)

Post by PKM »

here is the very generic script i use, no frills but gets the job done.
you may just want to compare this one and @(...:.:...)@'s to fit what you need in yours.

// yourmapname
// ARCHITECTURE: you
// SCRIPTING: you

main:

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

setcvar "g_scoreboardpic" "your loading image name (delete the word 'loading'*) " // your score board picture

level waittill prespawn

exec global/DMprecache.scr

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

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

level waittill spawn

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

end

* meaning if your load screen image is named "loading_marlborocigarettes.tga" only use the text 'marlborocigarettes' for the script portion.
i'm not f****** angry, i'm from philadelphia .
Image
neillomax
Lieutenant General
Posts: 880
Joined: Thu Jun 23, 2005 6:57 am

Post by neillomax »

setcvar "g_scoreboardpic" "your loading image name (delete the word 'loading'*) " // your score board picture ..............................................if you do not have a picture, put "none" between the "........
I usually copy one of the original scripts and change the name to reflect my project. Instead of mohdm1.scr, I would "save as", ( my mapname ), .scr ----- and save it in the folder my map is in......no pk3 file needed until you wrap up everything.
Post Reply