teleporters on random map

Questions and answers about the how and why of making maps.
Post Reply
mdskpr
Private First Class
Private First Class
Posts: 95
Joined: Sat Jan 28, 2006 4:17 pm

teleporters on random map

Post by mdskpr » Thu Nov 18, 2010 6:44 pm

Hello, is there any way to set the density of teleporters on a random map? I have tried the bzfs option '-density' but it does not apply to teleporters. The list of Server Variables on the wiki has no way of doing it either. Is it possible? thanks in advance --MDSKPR

User avatar
Cobra_Fast
Dev Monkey
Dev Monkey
Posts: 321
Joined: Sat Oct 07, 2006 11:51 am
Location: Germany
Contact:

Re: teleporters on random map

Post by Cobra_Fast » Thu Nov 18, 2010 6:58 pm

I could only think of a custom random-map-script which applies different density settings for boxes, pyramids and teleporters.
As far as I know there is no specific option to set the teleporter density.

mdskpr
Private First Class
Private First Class
Posts: 95
Joined: Sat Jan 28, 2006 4:17 pm

Re: teleporters on random map

Post by mdskpr » Thu Nov 18, 2010 7:05 pm

do you know where this random map script is?

User avatar
Cobra_Fast
Dev Monkey
Dev Monkey
Posts: 321
Joined: Sat Oct 07, 2006 11:51 am
Location: Germany
Contact:

Re: teleporters on random map

Post by Cobra_Fast » Thu Nov 18, 2010 7:13 pm

There are several around but you probably need to write your own for this particular purpose.

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: teleporters on random map

Post by blast » Fri Nov 19, 2010 12:15 am

If you're comfortable tweaking and recompiling bzfs, you could just edit src/bzfs/WorldGenerators.cxx to increase/decrease the minimum amount of teleporters.

Code: Select all

  float worldfactor = worldSize / (float)DEFAULT_WORLD;
...
  int numTeleporters = 8 + int(8 * (float)bzfrand() * worldfactor);
So as you can see, there is a minimum of 8, then a random amount of extra flags based on the world size (or perhaps less if the world size is smaller than normal?).
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

mdskpr
Private First Class
Private First Class
Posts: 95
Joined: Sat Jan 28, 2006 4:17 pm

Re: teleporters on random map

Post by mdskpr » Fri Nov 19, 2010 1:48 am

awesome! thanks blast *digs into the code*

mdskpr
Private First Class
Private First Class
Posts: 95
Joined: Sat Jan 28, 2006 4:17 pm

Re: teleporters on random map

Post by mdskpr » Fri Nov 19, 2010 2:29 am

blast, would it be possible in the next version to make -t have an argument, lets say -t 13 to make thirteen teleporters on the map?

User avatar
blast
General
General
Posts: 4746
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: teleporters on random map

Post by blast » Fri Nov 19, 2010 2:46 am

Almost anything is "possible". ;)
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

Post Reply