Map config
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
Contents
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"]]
in fact, that's just an example of what you can do with triggers, there are plenty more possibilities, the next one would be a type 12, a triggered once only.
level_trigger_2 = [setfullscreenshader bloom - 200; echo "it becomes hard to see"]
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
- 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
- colorworld
- decalworld
- 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) (val4)
All the bump variations have the same vertex and pixel params, just the majority goes unused.
Shader params
- bump*world
- The available params for the bump*world shader differs as they're all created with a bumpshader alias.
- pixelparam 0 affects the glowmap colour, pixelparam 5 and vertexparam 4 the pulse colour frequency respectively
- pixelparam 1 affects the brightness of the specularity map
- pixelparam 2 affects the strength of the depth map
- pixelparam 3 affects the strength of a loaded envmap, higher RGB values means it'll show less of the texture and more of the reflection. it'll also effect normal reflections with a texture e supplement
- The available params for the bump*world shader differs as they're all created with a bumpshader alias.
- colorworld
- Very simple Shader to modify the diffuse texture's RGB values. pixelparam 0 is the colour controller
- envworld
- pixelparam 0 sets the strength of the reflection
- pulseworld
- vertexparam 0 sets the flickering frequency
- pulseglowworld
- vertexparam 0 Affects the initial glow of the glowmap
- vertexparam 1 sets the flicker frequency (how many times a second)
- vertexparam 2 after the full pulse takes effect, this'll be the RGB of the glowmap