Page 1 of 2

how do you create a .scr file :S

Posted: Sun Sep 02, 2007 12:49 am
by Private_Ryan
im a complete no0b with scripting :oops: , and i can't even start, cuz i dont know how to create a scr file, been searching for the last hour on this and all i come up with is the following:


// Yourmapname title
// ARCHITECTURE: Who made the map
// SCRIPTING: Who did the scripting

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" "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/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


where do i put this information in :?: :(

anyone can help :?: :cry:

Posted: Sun Sep 02, 2007 1:17 am
by erick
You are making multiplayer I am assuming. I map SP so I dont know tons.
Here is a good site for different multiplayer objective scripting
http://gronnevik.se/rjukan

Here is an example script for a flak88 where the allies have to blow it up and the germans have to protect it.

main:
level waittill prespawn

exec global/DMprecache.scr //this loads up all of the stuff for multiplayer

level.script = maps/obj/objtest.scr //name of the level script
exec global/ambient.scr m4l1 //ambient sound in this case the sound from m4|1

exec global/door_locked.scr::lock //this is if you want some doors to be locked. (controlled by the player, he decides which doors)

setcvar "g_obj_alliedtext1" "Capture the gun"// <---These are the lines they will see! Like what they are suposed to do!
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "- Prevent Allies from" //little game message when the map loads
setcvar "g_obj_axistext2" "destroying the Flak88's"
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none"

level waittill spawn

level.bomb_damage = 200
level.bomb_explosion_radius = 640
level.defusing_team = "axis" //sets all the needed variables
level.planting_team = "allies"
level.targets_to_destroy = 1 //on flak88 to destroy
level.dmrespawning = 1 // 1 or 0
level.dmroundlimit = 15 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw

level waittill roundstart //waits until the round starts

$flak88_explosive1 thread global/obj_dm.scr::bomb_thinker


$flak88_explosive1 thread axis_win_timer
thread allies_win_bomb


end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer: //if the time runs out the axis wins

level waittill axiswin

end

//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------

allies_win_bomb: //if the allies plant a bomb before the time runs out then they win

while(level.targets_destroyed < level.targets_to_destroy)
waitframe

teamwin allies
end

Posted: Sun Sep 02, 2007 1:57 am
by PKM
if it's a MP map, put the .scr file (same name as your map) with your .bsp file in maps/dm .

script

Posted: Sun Sep 02, 2007 6:33 am
by tltrude
The script is just a text file with the extention changed from ".txt" to ".scr". So, you make it with Notepad and then rename the file, "yourmapname.scr".

Posted: Sun Sep 02, 2007 9:50 am
by Private_Ryan
thanks for all the help people!! :D :D :D woooooooooooot

ok....... time to script :shock:


erm.... its saving it as a.scr file yes... but its called screensaver 0o :shock:

Posted: Sun Sep 02, 2007 11:14 am
by jv_map
Then you did it right :)

Posted: Sun Sep 02, 2007 11:18 am
by Private_Ryan
so im guessing when u save the file to the bsp folder its uneditable?

that kinda sux, ud have to create .txt backups for everything u do :roll:

Posted: Sun Sep 02, 2007 11:40 am
by jv_map
Errm who said it was uneditable? :? . You can open it with notepad or whatever just like any other (small) file :)

Posted: Sun Sep 02, 2007 11:42 am
by Private_Ryan
it tells me its not a win32 application, cant even get the screen that lets me select a program for it :?

Posted: Sun Sep 02, 2007 12:16 pm
by Pistonsfan
I think you have to changed it to a txt file edit it with notepad then save it and change it back to your scr.

Thats the way I get it to work there may be another way tho.

Posted: Sun Sep 02, 2007 12:46 pm
by PsychoE
You can go into notepad, goto file, open. Point the directory to where your script is saved. In the bottom, type in *.scr or goto "Files of type" and select "All files". Now just choose your script and open.

Posted: Sun Sep 02, 2007 1:39 pm
by PKM
PsychoE wrote:You can go into notepad, goto file, open. Point the directory to where your script is saved. In the bottom, type in *.scr or goto "Files of type" and select "All files". Now just choose your script and open.
bingo:
1. open notepad
2. open
3. change file type to ''all files''
4. browse to .scr file

pain in the but that you can't associate that file type with notepade (like .pk3 files with pakscape) but .scr files are edible* .


*no you can't eat them .

Posted: Sun Sep 02, 2007 1:51 pm
by bdbodger
PKM wrote:
pain in the but that you can't associate that file type with notepade (like .pk3 files with pakscape) but .scr files are edible* .


*no you can't eat them .
We had this topic before it is possible to associate .scr files as text files . Open windows explorer and choose tools -> folder options . Select the file types tab and use the new button . Type scr into the extention box and click the advanced button , use the dropdown to select text document and press ok . double click a .scr file and it will open with your default text editor .

** edit

After you select text document and press ok you should see it in your list of file types select it and at the bottom you can use the change button to change what it opens with but it will probably already say the right program to use . I tried it a second time and for some reason scr was not in the extention list but it still works as a text document . If you need to you can enter it again as a new extention and the dropdown will automatically switch to text document and it will be in the list at least untill you close the dialog box .

Posted: Sun Sep 02, 2007 2:24 pm
by PKM
bdbodger wrote:
PKM wrote:
pain in the but that you can't associate that file type with notepade (like .pk3 files with pakscape) but .scr files are edible* .


*no you can't eat them .
We had this topic before....
dammit bd, how many hail mary's do i have to do now ? changed and working, thanks .

Posted: Sun Sep 02, 2007 2:44 pm
by Private_Ryan
thanks for the help :D

but alas i have a new problem (other than the fact im a no0b with scripting :P :lol: )

didnt wana spam up the forums with "Private_Ryan's" all over the place so im guna put it here:

ive followed the steps to making a vent fan onn the X axis but i have no idea y it wont work :cry:

here's the script:

// assaultcourse title
// ARCHITECTURE: privateryan
// SCRIPTING: privateryan

main:

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

setcvar "g_scoreboardpic" "none"

level waittill prespawn

exec global/DMprecache.scr

exec global/ambient.scr assaultcourse

level.script = "maps/dm/assaultcourse.scr"

level waittill spawn

level waittill spawn

thread fan1
end

fan1:
$blade1 bind $fan1
$blade2 bind $fan1
$blade3 bind $fan1
$blade4 bind $fan1
$fan1 rotatex 325
end


end


no idea what the problem is here but any help would be nice :wink: