Scripting/Spawning MP Map?


(demoneye) #1

Help… Can anyone help or point me to useful tutorials on setting up a game_manager and necessary spawn points, entities etc. in my map.

The map will have 5 objectives, two primary func_explosives for both side to target and destroy to win. Two secondary objectives of func_explosive “break throughs” to expland access for both sides. A central spawn point flag.

Spawning - how can I set up 32 primary spawn points for each side (intended as 32 v 32 map), and then on touching the central flag, 16 of the original spawns will shift to the central point. Would also like to allow players to choose their spawn point, of either central flag (if captured) and original one!

Anyone?

DeMoNeye


(SCDS_reyalP) #2

If you want to control the spawnpoints from script it is very easy. Set a targetname on the spawnpoints and use alertentity (triggered from the axis_capture and allied_capture triggers of the checkpoint script) in the script to switch it’s state. Note that this toggles the state rather than explicitly setting it to on or off. The tram script has examples of this.

Setting spawn locations is fairly simple as well. Place team_WOLF_objective entities, and people can choose to spawn ‘near’ them. Assuming the flag is near the middle, it would make sense to do it like depot, where you have ‘allied side’ and ‘axis side’ options.

I posted this description http://www.collectivecomputing.com/rfm/wolf/spawning.html
a while back, that goes into more details of how everything works. There are still a few points that aren’t completely clear.


(demoneye) #3

So… Is it possible to have a 32 v 32 map without any special considertions?

I’m having trouble getting a forward spawn working and I wonder if the number of spawn points is causing trouble. There are 64 initial spawns, and 128 respawns (64 at original location and 64 at forward spawn)!

DeMoNeye


(nib) #4

There is a hard-coded limit of 32 potential spawn points that will be used for spawning after death. It looks like you can have more than 32 but there will never be more than 32 potential spawn points in the list that the engine will choose from. That means that if more than 32 people are awaiting respawn, only 32 of them will respawn (if I understand the code correctly).


(SCDS_reyalP) #5

Nib, not exactly. If more people need to spawn than there are available spawnpoints, they seem to show up in the same one, stacked or stuck together. Anyone who has played on HP/HP2 should be familiar with that.

If you have more than 32 active at one time (for a team), then the spawn selection may not work correctly. (i.e. someone could choose the forward spawn and still spawn at the initial point, even though there are forward spawnpoints available.)

So it sounds like your plan of having 32 spawnpoints for teams initial spawn and 16 at the forward will work if you disable 16 of the original spawns when you enable the forward ones. In the unlikely event that more than 16 people are respawning at the same time, some of them will not get the spawnpoint they picked.

If you are having trouble with autopick, that’s another whole can of worms.

<font size=-1>[ This Message was edited by: SCDS_reyalP on 2002-11-01 01:36 ]</font>


(nib) #6

I’m looking at this code right here:


	while ((spot = G_Find (spot, FOFS(classname), classname)) != NULL) {
		if ( SpotWouldTelefrag( spot ) ) {
			continue;
		}
// JPW NERVE
		if (g_gametype.integer >= GT_WOLF)
			if (!(spot->spawnflags & 2)  && !initialSpawn )
				continue;
// jpw
		spots[ count ] = spot;
		if (++count == MAX_TEAM_SPAWN_POINTS)
			break;
	}

You can see that it is building a list of valid spawn “spots” and the list is defined as gentity_t *spots[MAX_TEAM_SPAWN_POINTS]; on line 774, then you’ll notice that the loob breaks out at MAX_TEAM_SPAWN_POINTS, which is defined as 32.


(digibob) #7

And isnt there something like this right after that? :smile:


if ( !count ) {	// no spots that won't telefrag
		return G_Find( NULL, FOFS(classname), classname);
	}


(nib) #8

Yes, but all that doesn’t change the length of the spots array does it?

Added: Wait, I just realized that that code actually returns out of that routine. I missed that.

<font size=-1>[ This Message was edited by: nib on 2002-11-01 18:34 ]</font>