Page 1 of 1

teleporters on random map

Posted: Thu Nov 18, 2010 6:44 pm
by mdskpr
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

Re: teleporters on random map

Posted: Thu Nov 18, 2010 6:58 pm
by Cobra_Fast
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.

Re: teleporters on random map

Posted: Thu Nov 18, 2010 7:05 pm
by mdskpr
do you know where this random map script is?

Re: teleporters on random map

Posted: Thu Nov 18, 2010 7:13 pm
by Cobra_Fast
There are several around but you probably need to write your own for this particular purpose.

Re: teleporters on random map

Posted: Fri Nov 19, 2010 12:15 am
by blast
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?).

Re: teleporters on random map

Posted: Fri Nov 19, 2010 1:48 am
by mdskpr
awesome! thanks blast *digs into the code*

Re: teleporters on random map

Posted: Fri Nov 19, 2010 2:29 am
by mdskpr
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?

Re: teleporters on random map

Posted: Fri Nov 19, 2010 2:46 am
by blast
Almost anything is "possible". ;)