Page 1 of 1
Script
Posted: Sun Nov 20, 2005 5:48 pm
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
Posted: Sun Nov 20, 2005 6:01 pm
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.
Posted: Sun Nov 20, 2005 7:14 pm
by ViPER
This topic should be a sticky. It comes up alot.
Posted: Fri Nov 25, 2005 3:14 pm
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
Posted: Fri Nov 25, 2005 4:52 pm
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
Posted: Fri Nov 25, 2005 5:55 pm
by Herr_Kruger
Hello Hal, you write too much
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.
Posted: Fri Nov 25, 2005 6:09 pm
by @(...:.:...)@
Hehe hi Kruger
I can't help it. :S If I don't try to help people I might get withdrawal symptoms.
Thanks for pointing that out.

Posted: Fri Nov 25, 2005 7:03 pm
by snajperu
THX a lot MAN!!

Posted: Fri Nov 25, 2005 7:57 pm
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.
Posted: Fri Nov 25, 2005 8:25 pm
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.