Random level picking

Discuss the construction of maps and the tools to create maps for 3D games.
Post Reply
JasonX
Posts: 422
Joined: Tue Apr 21, 2009 2:08 pm

Random level picking

Post by JasonX »

Hey guys,

I would like to know how to create an map entity that randomly sends the player to another map from a list. For example, the button. If the player shoots at it or gets close to it, he will be transported to another level.

I would make a list of levels (e1m1, e1m2, etc.) and the game would choose from those randomly, each time that button is activated in any map.

Is it too difficult?
Teiman
Posts: 311
Joined: Sun Jun 03, 2007 9:39 am

Re: Random level picking

Post by Teiman »

JasonX wrote:Hey guys,

I would like to know how to create an map entity that randomly sends the player to another map from a list. For example, the button. If the player shoots at it or gets close to it, he will be transported to another level.

I would make a list of levels (e1m1, e1m2, etc.) and the game would choose from those randomly, each time that button is activated in any map.

Is it too difficult?
Nah, is very doable, methinks.

You could star reading the tutorial to make "hub levels". Has to be somewhere.

You could just make a "mission_end" or whatever is called the clip that trigger a end mission and map change, to load some hardcoded different maps. But that would be lame.
A better idea would be to have some invisible entities (that have a empty spawn function in the progs.dat) with the names of potential new maps in "netname", and let that "mission_end_random" entitie pick one of these entities at random and use his netname has the name for the next map to load.

There could be even better ways to do it, maybe even code that already do that.
JasonX
Posts: 422
Joined: Tue Apr 21, 2009 2:08 pm

Post by JasonX »

I searched for a while but wasn't able to find anything. Maybe some open-source mod has a similar feature?
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Post by r00k »

I smell a func_random and a tie into QuakeC :O
negke
Posts: 150
Joined: Wed Apr 16, 2008 5:53 pm
Contact:

Post by negke »

Are you looking for a QC solution or a way to do with id1 progs? The latter is possible with logic gates and hacks, but it's a complicated setup. Adding randomize code to an existing (or new) entity is much cleaner and easier.
Lardarse
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Post by Lardarse »

Hold on to this thought. Something coming before the end of the month...
Roaming status: Testing and documentation
Post Reply