Map config

From Platinum Arts Sandbox Free 3D Game Maker
Revision as of 22:21, 29 January 2008 by Hirato (Talk | contribs)

Jump to: navigation, search

Normally the defaults will suffice, but for that occasion when you wish to perhaps use a specific set of textures, play some music, write some cubescript triggers etc, you can use a map configuration file. Pretty much anything placed in a regular cfg file can be placed in one of these. But take note these can't overwrite persistent variables and overwrite binds without some special tinkering. it's a safety thing

Things to do

level_triggers

level triggers are the 4th mapmodel tag, you can assign a specific level trigger action. and don't forget the special aliases that're trigger specific. The following is for a type 11 and some sort of a switch combo

level_trigger_1 = [if (= $triggerstate -1) [echo "The door is locked"] [echo "The doors screeches violently as it flies open"]]

Loading Skyboxes

The two commands useful in loading a skybox is /skybox, and /spinsky. /loadsky was removed and turned into an alias. the change allowed /skybox to echo the current skybox

To even consider loading a skybox. there have to be _dn, _up, _ft, _rt, _lf and _bk versions of it. those are down, up, front, right, left and back

an example of such a command is /skybox skyboxes/dunes

Playing Background Music

The music command is /music (file) [ondone]

The file is a song you specify to play, if an ondone isn't specified, it'll just loop over and over. if an ondone is specified, a script will be executed once it's done

eg /music music/sample.ogg [echo "finished playing"]

Loading textures

There are 6 key commands in loading textures.

  • materialreset
  • setshader
  • setpixelparam
  • setvertexparam
  • texturereset
  • texture

They all perform different functions, texturereset will clear the texture list, meaning it has to be populated from, the begining. Materialreset will do the same, but only for materials (as texturereset leaves materials unaffected). setshader is used to set a shader for the textures, so they can take advantage of bump, glow, parallax and specular mapping. the setparam commands are used to set variables on a per texture basis. this is to intensify an effect or speed it up.

texture will add textures obviously, you have to specify the type of texture as well. valid arguements are 0, 1, n, z, g, d, water, lava, s, e

the full syntax is texture T F (R) (X) (Y) (S)

they each stand for type, file, rotation, x offset, y offset and scale, the ones in () are optional.

Note the first texture you specify as texture 0 must be a skybox one.

0 is a new texture slot. 1 loads an additional texture to use with the current texture slot, n loads a normalmap for the current texture, z loads a depth map (also called a bump map), g loads a glow map, d loads a decal to place over the texture (use 32 bit pngs WITH transparency for this. TGA will also suffice). water will load the water texture if material reset was used, and likewise for lava. s loads a specular map, and e loads an environment map (it uses the envmap entities or just reflects the skybox if one isn't specified).

Materials

water takes a surface texture, and has use for 3 additional slots. Note the below, and their order especially.

texture water golgotha/water2.jpg
texture 1 textures/waterfall.jpg
texture 1 textures/watern.jpg
texture 1 textures/waterdudv.jpg

For lava, there's only room for 1 additional slot. mostly as there's no need for a normal map, or a dudv one. As you can notice there's no specularity on the lava, and no distorted reflections either.

texture lava hirato/lava.jpg texture 1 hirato/lava.jpg

setshader

setshader is used to set the used shader of any following texture slots. The available list is

  • colorworld
  • bumpenvglowworld
  • bumpenvglowworldalt
  • bumpenvparallaxglowworld
  • bumpenvparallaxglowworldalt
  • bumpenvparallaxworld
  • bumpenvparallaxworldalt
  • bumpenvparallaxpulseglowworld
  • bumpenvparallaxpulseglowworldalt
  • bumpenvpulseglowworld
  • bumpenvpulseglowworldalt
  • bumpenvspecmapglowworld
  • bumpenvspecmapparallaxglowworld
  • bumpenvspecmapparallaxpulseglowworld
  • bumpenvspecmapparallaxworld
  • bumpenvspecmappulseglowworld
  • bumpenvspecmapworld
  • bumpenvspecglowworld
  • bumpenvspecparallaxglowworld
  • bumpenvspecparallaxpulseglowworld
  • bumpenvspecparallaxworld
  • bumpenvspecpulseglowworld
  • bumpenvspecworld
  • bumpenvworld
  • bumpenvworldalt
  • bumpglowworld
  • bumpparallaxworld
  • bumpparallaxflowworld
  • bumpparallaxpulseglowworld
  • bumppulseglowworld
  • bumpspecworld
  • bumpspecglowworld
  • bumpspecmapglowworld
  • bumpspecmapparallaxglowworld
  • bumpspecmapparallaxpulseglowworld
  • bumpspecmapparallaxworld
  • bumpspecmappulseglowworld
  • bumpspecparallaxpulseglowworld
  • bumpspecparallaxglowworld
  • bumpspecparallaxworld
  • bumpspecpulseglowworld
  • bumpworld
  • envworld
  • envworldfast
  • glowworld
  • pulseworld
  • pulseglowworld
  • stdworld

if they have any attributes to set, use /setpixelparam and /setvertexparam to do it, the syntax is set*param (ID) (val1) (val2) (val3)

all the bump* variations increase in a hierarchy, for example bumpenvglowworld, the bumpworld variations will be first, the envworld variations will follow, and be followed by the glow ones.

Shader params

Specifying Shaders

Overwriting the menu

Setting special binds

Base messages

See Also