Page 1 of 1

Random level picking

Posted: Thu Mar 25, 2010 4:10 pm
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?

Re: Random level picking

Posted: Thu Mar 25, 2010 4:33 pm
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.

Posted: Sat Mar 27, 2010 12:38 pm
by JasonX
I searched for a while but wasn't able to find anything. Maybe some open-source mod has a similar feature?

Posted: Sun Mar 28, 2010 8:20 am
by r00k
I smell a func_random and a tie into QuakeC :O

Posted: Sun Mar 28, 2010 9:27 am
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.

Posted: Sun Mar 28, 2010 10:43 pm
by Lardarse
Hold on to this thought. Something coming before the end of the month...