Help for making maps?
#4
Congratulations on finding yourself a man! :D
The random terrain generator was meant to help find ideas for mappers.
This script can be run with tools.cfg installed.
It will automatically add its menu into the "editing" in-game menu.
// rndmap -- Create a map and randomly edit height, solid, and lighting values -- by V-Man
// requires tools.cfg --
alias rndmap [
storeargs $arg1 $arg2 $arg3 $arg4
tmp_cubes = (pow 2 $arg1)
if (> $tmp3 30) [echo (c 3)Valid range for attenuation is 1..30
] [if (|| (> $tmp2 100) (< $tmp2 1)) [echo (c 3)Valid range for randomness level is 1..100
    ] [if (> $tmp4 64) [echo (c 3)Valid range for lighting rate is 0..64] [sleep 10 [
        echo (c 9)Generating random map
        echo (c 9)Map size level: (c 2)$tmp1
        echo (c 9)Number of cubes: (c 2)$tmp_cubes
        echo (c 9)Randomness level is (c 2)$tmp2
        echo (c 9)Attenuation rate is (c 2)$tmp3
        echo (c 9)Lighting rate is (c 2)$tmp4
        if $editing [] [edittoggle]
        newmap $tmp1
        sleep 100 [if $editing [] [edittoggle]
        loop rml (* (* $tmp1 $tmp2) 2) [rndsel; rndheight]
        loop rsl (* $tmp1 (+ (div $tmp2 10) 1)) [rndsel; solid 1]]
        loop rll (* (- (*f (divf 2 3) (square $tmp1)) (*f 3.6 $tmp1)) $tmp4) [rndsel; newent light (rnd 32) (rnd 196)]]]]]]
// rndmap (mapsize) (randomness) (attenuation) (lighting)
// rndmap 7 20 5 8 (creates a medium-sized map with good variety, dimly lit)
alias rndsel [select (+ (rnd (- $tmp_cubes 11)) 9) (+ (rnd (- $tmp_cubes 11)) 9) (+ (rnd (div $tmp_cubes $tmp3)) 2) (+ (rnd (div $tmp_cubes $tmp3)) 2)]
alias rndheight [editheight (rnd 2) (rndposneg (*f (divf (sqrt (* $tmp3 $tmp2)) 256) 128))]

newmenu "Generate a Random Map"
menuitemslider " 1Map size level: " 6 9 [] 1 [] [tmp1 = $arg1]
menuitemslider " 1Randomness level: " 1 100 [] 5 [] [tmp2 = $arg1]
menuitemslider " 1Attenuation rate: " 1 30 [] 1 [] [tmp3 = $arg1]
menuitemslider " 1Lighting rate: " 0 64 [] 4 [] [tmp4 = $arg1]
menuitem "" -1
menuitem " 2                       Generate" [rndmap $tmp1 $tmp2 $tmp3 $tmp4]
add2menu "editing" [menuitem " 2Generate a Random Map" [showmenu "Generate a Random Map"]]
docsection [Custom]

docident [rndmap] [Generates a random terrain in a new map];
docargument [S] [Size level of new map] [6..9];
docargument [R] [Randomness level] [1..100];
docargument [A] [Attenuation rate] [1..30];
docargument [L] [Lighting rate] [0..64];
docexample [rndmap 7 20 5 8] [Creates a medium-sized map with good variety, dimly lit];
docremark [View the readme for this script for further details.];

docident [rndsel] [Randomly makes a selection];
docremark ["rndmap" should be run first.];

docident [rndheight] [Randomly adjusts the height of a selection (floor or ceiling)];
docremark ["rndmap" should be run first.];
Thanks given by:


Messages In This Thread
Help for making maps? - by Leonidas - 26 Feb 11, 05:46PM
RE: Help for making maps? - by Nightmare - 26 Feb 11, 05:53PM
RE: Help for making maps? - by Leonidas - 26 Feb 11, 05:56PM
RE: Help for making maps? - by Nightmare - 26 Feb 11, 08:54PM
RE: Help for making maps? - by V-Man - 26 Feb 11, 06:47PM
RE: Help for making maps? - by Andrez - 26 Feb 11, 08:55PM
RE: Help for making maps? - by V-Man - 27 Feb 11, 07:59AM
RE: Help for making maps? - by Lantry - 26 Feb 11, 08:56PM
RE: Help for making maps? - by V-Man - 26 Feb 11, 09:47PM
RE: Help for making maps? - by Nightmare - 27 Feb 11, 01:02AM
RE: Help for making maps? - by Lantry - 27 Feb 11, 05:10AM
RE: Help for making maps? - by Lantry - 28 Feb 11, 01:49AM
RE: Help for making maps? - by Nightmare - 05 Mar 11, 12:21AM
RE: Help for making maps? - by MykeGregory - 26 Feb 11, 09:50PM
RE: Help for making maps? - by V-Man - 26 Feb 11, 09:59PM
RE: Help for making maps? - by Frogulis - 27 Feb 11, 05:10AM
RE: Help for making maps? - by Lantry - 27 Feb 11, 05:21AM
RE: Help for making maps? - by Viper - 27 Feb 11, 05:32AM
RE: Help for making maps? - by flowtron - 27 Feb 11, 06:21AM
RE: Help for making maps? - by Lantry - 27 Feb 11, 06:40AM
RE: Help for making maps? - by Frogulis - 27 Feb 11, 11:02AM
RE: Help for making maps? - by Lantry - 27 Feb 11, 11:29PM
RE: Help for making maps? - by V-Man - 28 Feb 11, 12:28AM
RE: Help for making maps? - by Waffles - 03 Mar 11, 08:13PM
RE: Help for making maps? - by V-Man - 03 Mar 11, 08:18PM
RE: Help for making maps? - by Waffles - 04 Mar 11, 01:14AM
RE: Help for making maps? - by V-Man - 04 Mar 11, 08:31AM
RE: Help for making maps? - by Ronald_Reagan - 04 Mar 11, 08:33AM
RE: Help for making maps? - by V-Man - 04 Mar 11, 08:47AM
RE: Help for making maps? - by Mikey - 04 Mar 11, 02:47PM
RE: Help for making maps? - by V-Man - 04 Mar 11, 07:04PM
RE: Help for making maps? - by Mikey - 05 Mar 11, 12:11AM
RE: Help for making maps? - by Lantry - 05 Mar 11, 09:04PM
RE: Help for making maps? - by StRaTo - 06 Mar 11, 12:45AM
RE: Help for making maps? - by Lantry - 06 Mar 11, 01:16AM
RE: Help for making maps? - by StRaTo - 06 Mar 11, 09:58AM
RE: Help for making maps? - by Lantry - 06 Mar 11, 10:03PM
RE: Help for making maps? - by StRaTo - 06 Mar 11, 10:07PM
RE: Help for making maps? - by Lantry - 06 Mar 11, 10:14PM
RE: Help for making maps? - by Nightmare - 06 Mar 11, 10:23PM
RE: Help for making maps? - by Lantry - 06 Mar 11, 11:09PM
RE: Help for making maps? - by V-Man - 07 Mar 11, 04:34AM
RE: Help for making maps? - by Orynge - 07 Mar 11, 06:03AM
RE: Help for making maps? - by Frogulis - 07 Mar 11, 06:54AM
RE: Help for making maps? - by Leonidas - 07 Mar 11, 11:59PM
RE: Help for making maps? - by Lantry - 08 Mar 11, 03:29AM