View previous topic :: View next topic |
Author |
Message |
JasonX
Joined: 21 Apr 2009 Posts: 89
|
Posted: Thu Mar 25, 2010 4:10 pm Post subject: Random level picking |
|
|
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? |
|
Back to top |
|
 |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Thu Mar 25, 2010 4:33 pm Post subject: Re: Random level picking |
|
|
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. |
|
Back to top |
|
 |
JasonX
Joined: 21 Apr 2009 Posts: 89
|
Posted: Sat Mar 27, 2010 12:38 pm Post subject: |
|
|
I searched for a while but wasn't able to find anything. Maybe some open-source mod has a similar feature? |
|
Back to top |
|
 |
r00k
Joined: 13 Nov 2004 Posts: 483
|
Posted: Sun Mar 28, 2010 8:20 am Post subject: |
|
|
I smell a func_random and a tie into QuakeC :O |
|
Back to top |
|
 |
negke
Joined: 16 Apr 2008 Posts: 56
|
Posted: Sun Mar 28, 2010 9:27 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
Lardarse

Joined: 05 Nov 2005 Posts: 243 Location: Bristol, UK
|
Posted: Sun Mar 28, 2010 10:43 pm Post subject: |
|
|
Hold on to this thought. Something coming before the end of the month... _________________ <ekiM> Son, you're writing data structures your CPU can't cache. |
|
Back to top |
|
 |
|