PDA

View Full Version : Rindogs Spawn Script (Spawning a Spawn Spot Guide for SH only )


rudedog
02-25-2005, 11:19 PM
I read somewhere that you couldn't spawn a spawn spot...or can you? I have!

Spawn a Spawn spot!
I read somewhere that you couldn't spawn a spawn spot...or can you?
I have! I have doubled the amount of spawn spots in Remagen and now get an effect similar to Algiers: When one team takes over an area, the opposing team will then spawn on the other side of the map. What I did is: Everywhere that there was a spawn spot, I spawned a new spawn spot for the opposing team. Now there is two at each spot, one for each team. But, that's the beauty of it, you don't have to swap them like I did. You can just add new ones. The possibilities are limitless!
Im not sure of the internals of the game engine, but it appears to disable spawns spots if an opponent is near one and will randomly spawn a player at one of the enabled spawns. I have yet to disable an original spawn spot, but if the mapper gave the spawn spot a targetname, you can disable it through script.

Here's a snippet to add an axis spawn spot:
*******************************
local.axis1 = spawn info_player_axis
local.axis1.origin = ( -456 -576 8 ) // use a space before a negative x value!
local.axis1.angle = 0 // the angle the player will face when spawned

(To add an Allied spot use.......info_player_allied.)

******************************
A word of caution! If you spawn a player outside of the map boundaries you could crash the server. So I recommend testing, before placing this script on a public server. Other know issues are, if a spawn spot is too close to a ladder, players could have a problem getting up and down the ladder*. And some terrains, will allow the player to fall through the map. You may have to increase the z coord and allow them to fall to the terrain, but be careful, you could spawn a player into a wall or object, which would prevent them from being able to move.

To obtain coordinates for your purposes, here are two ways to do it:

1. To add spawn spots wherever you want, you can load your map into the game, then go to the position you want, then enable your console and type "Coord". It'll show you where you are standing and which direction you are facing. You don't need the decimal, just round it off to the nearest integer.

2. To get the actual coords of the existing spawn spots, and a targetname(if it has targetname) you could use "Scorpios MohaaTools". Load Scorpios program, browse the .bsp file you want, then on the upper left is a window pane labeled "Total Entities" scroll through the list and find an info_player_xxxxx entity, and expand the tree. All the info is there, including the origin, the angle, and a targetname if it has one.

Next you will need to create a pk3 file that will contain an edited version of your map's scr file and your newly created Mapfix.scr:

1. Create a scr file using the coordinates and angles you want for your spawn spots, use a simple editor like Notepad. Name it something like MapFix.scr . (Use the correct map name so you know which map it is for, see the RemagenFix.scr sample below).
2. Create a pk3 file, name it something like zzzSpawnFix.pk3 . Place YOUR MapFix.scr file in a directory pathed Maps\DM\mapfixes.
3. Copy the map.scr for the map you are modding (i.e. Remagen = mohdm3.scr) from the pk3 (pak1.pk3 for SH, look in Maps/DM/), and edit it (using Notepad or any text editor).
4. When you edit, add the exec statement for your MapFix.scr file after the line: setcvar "g_scoreboardpic" "mp_bahnhof_dm".

It should look like this:

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

setcvar "g_scoreboardpic" "mohdm3"
exec maps/dm/mapfixes/mohdm3fix.scr

// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread

5. Save your edited map.scr (keep the original name of this file) in the Maps\DM\ folder of your new pk3.
6 . Copy your new zzzSpawnFix.pk3 to your Mainta folder and restart your server.

Here is what my RemagenFix.scr file looks like. What I have done is extracted all original spawn locations and created new Axis spawn points from the original Allied spawn points and vice versa. So now when the Axis overun the Allied spawn the Allies will spawn at the original Axis spawn points and vice versa, just like Algiers works.
************************

//Remagen spawn fix
local.axis1 = spawn info_player_axis
local.axis1.origin = ( -456 -576 8 )
local.axis1.angle = 0

local.axis2 = spawn info_player_axis
local.axis2.origin = ( -448 -328 16 )
local.axis2.angle = 0

local.axis3 = spawn info_player_axis
local.axis3.origin = ( 440 -144 -32 )
local.axis3.angle = 0

local.axis4 = spawn info_player_axis
local.axis4.origin = ( 432 -16 -32 )
local.axis4.angle = 0

local.axis5 = spawn info_player_axis
local.axis5.origin = ( 1256 352 -48 )
local.axis5.angle = 270

local.axis6 = spawn info_player_axis
local.axis6.origin = ( 504 176 -32 )
local.axis6.angle = 0

local.axis7 = spawn info_player_axis
local.axis7.origin = ( 472 -1256 -48 )
local.axis7.angle = 0

local.axis8 = spawn info_player_axis
local.axis8.origin = ( 1688 -2560 24 )
local.axis8.angle = 180

local.axis9 = spawn info_player_axis
local.axis9.origin = ( 1576 -1392 -48 )
local.axis9.angle = 180

local.axis10 = spawn info_player_axis
local.axis10.origin = ( 1768 -904 -48 )
local.axis10.angle = 270

local.axis11 = spawn info_player_axis
local.axis11.origin = ( 1720 -1864 160 )
local.axis11.angle = 90

local.axis12 = spawn info_player_axis
local.axis12.origin = ( 2096 -440 -48 )
local.axis12.angle = 315

//////////////////////////////////////////////////////////////////////

local.allied1 = spawn info_player_allied
local.allied1.origin = ( 3672 -968 32 )
local.allied1.angle = 270

local.allied2 = spawn info_player_allied
local.allied2.origin = ( 3920 -1408 32 )
local.allied2.angle = 180

local.allied3 = spawn info_player_allied
local.allied3.origin = ( 4544 -1512 24 )
local.allied3.angle = 270

local.allied4 = spawn info_player_allied
local.allied4.origin = ( 5984 -2552 32 )
local.allied4.angle = 180

local.allied5 = spawn info_player_allied
local.allied5.origin = ( 4728 -3560 56 )
local.allied5.angle = 90

local.allied6 = spawn info_player_allied
local.allied6.origin = ( 4448 -4288 24 )
local.allied6.angle = 90

local.allied7 = spawn info_player_allied
local.allied7.origin = ( 4232 -4264 16 )
local.allied7.angle = 90

local.allied8 = spawn info_player_allied
local.allied8.origin = ( 2880 -3840 32 )
local.allied8.angle = 45

local.allied9 = spawn info_player_allied
local.allied9.origin = ( 2752 -2096 24 )
local.allied9.angle = 270

local.allied10 = spawn info_player_allied
local.allied10.origin = ( 2392 -2000 24 )
local.allied10.angle = 270

local.allied11 = spawn info_player_allied
local.allied11.origin = ( 2792 -2224 216 )
local.allied11.angle = 270

/////////////////////////////////////////////////////
*...The ladder problem may have been caused by another issue,but the follow up results were not available at the time of this guide.
////////////////////////////////////////////////////

Thanks to: [OTD]SNYPE
It was his project, that we set out to make mods to protect the spawn areas. I think we succeeded. We both put a lot of work into the project, and I wouldn't have acheived my results without his help.

Thanks also to:
-=LB=-Sitting_Duck and [PMOH]Sgt.Pepper
For their initial interest and invaluable feedback once we went public at The Modding Theater.


Have Fun!
Rindog