setspawnpt


(Vio) #1

Posted this on the tramdesign forum with no luck.

Hey !
I’m not a mapper, having tried gtkradiant only a couple of times. I thought this might be the right place to ask. My question is how the command setspawnpt works. If i for instance play on beach and enter /sepspawnpt 100 i will spawn on sniper hill and /setspawnpt 50 makes me spawn in axis barracks. So how does this relate to the map, i’ve looked through the map and script file for mp_beach but i can’t find any kind of identifier for the different spawn locations. Some ctf_team_bluespawn seem to be grouped together with a ID property but others are not. So if anyone could explain how the setspawnpt command works I’d be very happy :slight_smile:


(pack) #2

bump :slight_smile:


(SCDS_reyalP) #3

I was hoping someone from SD would answer this, but as far as I can tell, the fact that 101 works on beach is a bug. When you select a spawn point, wolf tries to spawn you as close as possible to the specified team_WOLF_objective entity. Normally, the number given to setspawnpt comes from the ui, so the number will be in the range 0 (autopick) to whatever the number of team_WOLF_objective entities there are. If you give a number outside that range, you get some semi-random values out of memory. Wolf doesn’t check that the number is in range, or that the thing selected is actually a team_WOLF_objective.

As far as I can tell from the code, the id property is not used at all, perhaps it is a leftover from some previous implementation. If I remember right, beach is the only official map that has it.

The spawn picking code is mostly in src/game/g_team.c, starting around line 770.


(RR2DO2) #4

You should never need to use that command directly, it’s funtionality is provided through the UI. There is no real logic for it between maps.

The ID thing is indeed an ancient leftover of some other system.

  • Arnout ‘RR2DO2’

(pack) #5

Most players use binds for this, because this way they can communicate to their teammates where they will spawn and it’s just faster then the UI.

bind Ins “setspawnpt 2; say_team spawning allied side”
bind Home “setspawnpt 0; say_team spawning autopick”
bind PgUp “setspawnpt 1; say_team spawnin axis side”

//beach
bind F12 “setspawnpt 100; echo ^6sniperspawn”
bind F11 “setspawnpt 3; echo ^6Axis barracks”

Spawnpt 2 was always allied side in standard maps but for the goty maps it is often the other way around (cfr Ice). It’s also too bad that spawnsides can not be chosen at start, which increases factor of luck in some maps.


(SCDS_reyalP) #6

It’s nice to be able to switch quickly, for example, when you need to switch to engineer, set spawn point and /kill all in a couple of seconds :eek: . The ‘side effect’ when you use out-of-range values also sometimes useful, as is a bind that says where you are spawning.

Something to think about for ET, maybe :fiesta:

edit:
There is another minor nit with spawn setting (doesn’t matter if you use the ui or setspawnpt). If you set your spawn in one map, that setting is remembered on the next. Just because you wanted to spawn on the allied side on beach doesn’t mean that you want to do so on village…


(Fusen) #7

blast from the past but

just wondering how this works in ET and how for example on oasis if your axis you can set the spawnpt to 1-4 which will work fine but trying to select the spawn above the final axis spawn doesn’t seem to work… so how do you find out which number is set to which spawn?


(Ragnar_40k) #8

As for ET the numbers for the setspwnpt command seem to reflect the order of the spawn points as they are defined inside the corresponding bsp (e.g. open the bsp with wordpad and search for the the string “team_WOLF_objective” - in the corresponding descripton part the names of the spawnlocations come up in the setspwnpt-order).

My guess is, that numbers that are outside the range of valid values are either random (somewhere from the memory) or they are taken modulo the number of team_WOLF_objective entities the get a valid value.


(SCDS_reyalP) #9

In ET, /setspawnpt values outside of 0-16 are forced to 0 (default spawn). If you select a value that is in that range, but has no corresponding team_WOLF_objective (eg, 15 on a map with 5 team_WOLF_objectives) it looks like it will be the same as a team_WOLF_objective at 0,0,0 in the map.

Note, this is different from RTCW, which would give you semi-random values for out of range spawnpoints.

Relevant functions:
src/game/
g_team.c:SelectRandomTeamSpawnPoint
g_team.c:objective_Register
g_client.c:ClientSpawn
g_cmds.c:SetPlayerSpawn