Item spawning and gametypes

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
dONKEY
Posts: 566
Joined: Mon Oct 15, 2001 7:00 am

Item spawning and gametypes

Post by dONKEY »

I have a really dumb question, but I cant remember if you can do this.
I know I can set items to notffa, but then they don't spawn in FFA and Tourney. Can I set items to spawn in FFA or Tourney games? If so what are the keys I need to set?
I am getting old and befuddled.
AEon
Posts: 1816
Joined: Sun Apr 20, 2003 7:00 am

Re: Item spawning and gametypes

Post by AEon »

No, you are not ;)... I recently had the same problem... it seems you simply cannot differentiate item spawning between tourney and FFA. At least that is what I "learned" when I asked the last time.

Very strange...
dONKEY
Posts: 566
Joined: Mon Oct 15, 2001 7:00 am

Re: Item spawning and gametypes

Post by dONKEY »

Hmm, so I would have to add two bsp and aas files to my pk3...that's a bit annoying, ho hum. Thanks AEon
AEon
Posts: 1816
Joined: Sun Apr 20, 2003 7:00 am

Re: Item spawning and gametypes

Post by AEon »

I still hope I am wrong... e.g. in SolarAE I'd want the Quad to only show in FFA. But from the in-editor documentation of GTKradiant 1.2.13, there did *not* seem to be a "notourney" or so parameter.

Two bsp files indeed are *very* annoying to manage as a mapper and also for distribution. Tabun has been very brave in this respect :).
dONKEY
Posts: 566
Joined: Mon Oct 15, 2001 7:00 am

Re: Item spawning and gametypes

Post by dONKEY »

OK, noted thanks. Slightly off my own topic...I need some advice on item loading for a tourney map. For FFA my small to medium sized level has Quad, Holdable Teleport, RA, RL, LG, PG, SSG, RG and GL. There is ammo for all weapons except the RG. I have 6 Armour Shards, 3x25 health bubbles and 7 small health bubbles. I think I've spread items around sensibly. For Tourney game type, what would you suggest? Drop the Quad for sure, but what should I put in it's place? Maybe a 50 health bubble? What about weapon balance and numbers of health? Is it considered OK to leave in the holdable teleport?
v1l3
Posts: 822
Joined: Wed Apr 02, 2003 8:00 am

Re: Item spawning and gametypes

Post by v1l3 »

..I dunno if you care about Cpma, but you can make different weapon layouts using .map files. Let's say the .map file in your map .pk3 is named "dk_m2.map", all you have to do is:

\callvote map !dk_m2

The "!" makes it read the .map file instead of the .bsp file. You can make them using the ICE or Diablo mod's also..just using the item set-ups without all of the other stuff that is in a .bsp". Quicker than making a bunch of bsp's, and easier for testing..

..unless you don't like Cpma? =/
AEon
Posts: 1816
Joined: Sun Apr 20, 2003 7:00 am

Re: Item spawning and gametypes

Post by AEon »

I think I found a solution for non-tourney items... found in Sock's POM map:
  • Key: gametype
    Value: ffa team
This was used on a item_regen. So by explicitly setting the gametypes you *want* the item to show, you exclude everything else. Ha!

Just noted, or you can simply set the item explicitly for tourney mode via:
  • Key: gametype
    Value: tournament
dONKEY
Posts: 566
Joined: Mon Oct 15, 2001 7:00 am

Re: Item spawning and gametypes

Post by dONKEY »

I tried that earlier and couldn't get it to work. My Quad still spawned in FFA. Will try later again, knowing me I typed something wrong!!! Getting late here, so I wont try tonight. Thanks. :)
Anthem
Posts: 399
Joined: Wed Oct 21, 2009 12:34 am

Re: Item spawning and gametypes

Post by Anthem »

If this is for your NoGhost map you are able to replace certain items with a script. If you were to set g_gametype to execute: 'set_replace_item_quad item_health_mega' it would replace quad with mega.
[url=http://www.xfire.com/profile/vlnoheaven/][img]http://i105.photobucket.com/albums/m231/Lowerboy444/xfire.png[/img][/url]

[url=http://teameventhorizon.com/]Team Event -O- Horizon[/url]

[url=http://mapping.maverickservers.com/]NoGhost Map Making Competition 2 (June 2010)[/url]
sock
Posts: 424
Joined: Sat Sep 09, 2000 7:00 am

Re: Item spawning and gametypes

Post by sock »

Sorry I thought most people knew about this key/value. It only really works with the latest patch release 1.32. Just specify the gametype's you want and violia it works. Just add more to the key field if you want items to appear in different game types.

key: gametype
value: ffa team tournament

The Q3 source code is also awesome for finding this stuff. Here is the spawn routine, a list of gametype's you can specify and the 'gametype' key being read and processed later on in the routine.

Code: Select all

void G_SpawnGEntityFromSpawnVars( void ) {
	int			i;
	gentity_t	*ent;
	char		*s, *value, *gametypeName;
	static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"};

...

	if( G_SpawnString( "gametype", NULL, &value ) ) {
		if( g_gametype.integer >= GT_FFA && g_gametype.integer < GT_MAX_GAME_TYPE ) {
			gametypeName = gametypeNames[g_gametype.integer];

			s = strstr( value, gametypeName );
			if( !s ) {
				G_FreeEntity( ent );
				return;
			}
		}
	}
Well he was evil, but he did build alot of roads. - Gogglor
My [url=http://www.simonoc.com/]Website[/url] & [url=http://twitter.com/SimsOCallaghan]Twitter[/url]
Pat Howard
Posts: 494
Joined: Tue Mar 31, 2009 11:14 am

Re: Item spawning and gametypes

Post by Pat Howard »

Oh man, I wish I would've known about this for Q. Oh well, at least I can have my own local version the way I want it. :rolleyes:
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Item spawning and gametypes

Post by obsidian »

Just to be clear, this works for all weapons, armour, health and powerups? I suppose this won't work for stuff like func_ entities.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Item spawning and gametypes

Post by ^misantropia^ »

It's applicable for all entities that remain after compilation (open up the BSP in an editor and you'll find the entities lump somewhere in it, it's just one long string of text). Stuff like doors, moving platforms, etc. should all work. I suppose some creative use of func_statics could even get you different map layouts for different game types.
AEon
Posts: 1816
Joined: Sun Apr 20, 2003 7:00 am

Re: Item spawning and gametypes

Post by AEon »

In the other thread Sock suggested updating the scripts\entities.def in the case of misc_model, I updated that .def file some more (possibly I am just using a too old version from GTKradiant v1.2.13), but here goes anyway...

I replaced all lines containing:

Code: Select all

notbot : used to make an item invisible for bot attraction.
with

Code: Select all

notbot : used to make an item invisible for bot attraction.
gametype : defines the gametype(s) that will spawn this item, valid values: "ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", and "teamtournament"; e.g. ffa team.
This updates the items like weapons, ammo, etc. Though it probably misses those func_ entries (i.e. doors etc.).
sock
Posts: 424
Joined: Sat Sep 09, 2000 7:00 am

Re: Item spawning and gametypes

Post by sock »

@Aeon, you should create a new thread (sticky hopefully) for all the entity.def additions. I can think of a couple more that are missing from the original def file. The latest stuff is suppose to be in the GTK SVN tree but I don't know many mappers who check that stuff. (Mostly coders tbh) It certainly would be good to have a central location for mappers to grab the latest and discuss the changes.
Well he was evil, but he did build alot of roads. - Gogglor
My [url=http://www.simonoc.com/]Website[/url] & [url=http://twitter.com/SimsOCallaghan]Twitter[/url]
User avatar
monaster
Posts: 532
Joined: Mon Apr 28, 2008 1:52 pm

Re: Item spawning and gametypes

Post by monaster »

^misantropia^ wrote:[...] Stuff like doors, moving platforms, etc. should all work. I suppose some creative use of func_statics could even get you different map layouts for different game types.
Confirmed, I tried that on my second map or so to seal of the flag room so people wouldn't stumple upon that damn flag if they are battling in ffa team or tourney, really seems out of place in these modes.
If you are caught on a golf course during a storm and are afraid of lightning, hold up a 1-iron. Not even God can hit a 1-iron.
-Lee Trevino, golfer who actually has been struck by lightning.
Post Reply