World

Map objects

Everything a map can place - start points, portals, triggers, NPCs, monsters, spawners, chests, props and lights - their parameters, the built-in Planar Gateway, Shop and Level door, and inline actions that work without a script.

Objects are what you place on a map with the Level Editor's Place tool. Each is a kind (the class the game builds), a position, a facing, and key=value parameters. Every kind the disc's levels place works in a map, with the same parameters. The port adds placed lights, three ready-made objects (Planar Gateway, Shop, Level door) and inline actions, so a map works without writing a level script at all.

In the Level Editor you set parameters in Details > Selection; the list of each class's known keys adds one. In the map file an object looks like this:

[object.12]
kind = "PushTrigger"           # the class (case doesn't matter)
pos = [3520, -3560, 2]         # x, y, z in world units; z is the floor height
yaw = 90                       # degrees
p0 = "radius=79"               # parameters in order: p0, p1, ... each "key=value"
p1 = "action=@missionmap"

The objects a map usually needs

Kind Parameters What it is
Player1 default=1, name=, from=<level> A start point. A map needs one with default=1. Named ones are entrances for @level:<map>:<name>; from= picks the one used when arriving from that level.
Portal lump=jumpgate The jump gate. In a new map it is the way out: using it completes the map and gates the party back to the hub. In a remaster it is the disc level's own gate.
Savepoint lump=savepnt A save crystal
PushTrigger radius=, icon=, message=, action= (repeatable), key= (repeatable), lockmessage= A use spot: the hero presses Use within radius and every action runs, if every key passes. Values may be inline actions.
Trigger w=, h=, t= An area: t runs when a hero walks into the rectangle (w by h).
MonsterTrigger radius=, monstername=, script=, name= Counts creatures in a box and runs script for each.
NPC name=, showname=, dialogscript=, shop=1 A character. Its dialog comes from the base level's files: on another base, use @message or @store.
Monster kinds name=, wait=1, Scale=, MiniBoss=1, HomeRange=, noloot=1, NoMagicWeapons=1, initscript=, deathscript=, path= Any creature kind or class, the mod's included. NoMagicWeapons=1 takes away the weapon enchant some creatures roll (fire, cold, exploding arrows...).
A spawner any monster kind with generator=<kind>, triggerable=1 Spawns up to 4 creatures of <kind> while a hero is within 600 units.
ScriptGenerator name=, creature parameters Spawns when a script (or @trigger) asks.
Chests lumpname=<archive>, autochest=1, gold=, item=, potions= Any chest model (orkbox, chest1...). A kind that starts with Chest (Chest, Chest3...) is the disc's older chest instead: always the large wooden chest, a quarter turn from its heading, whatever lumpname= says. For another model, give the chest another kind name.
Breakables lumpname=<archive>, autocontainer=1, item= Barrels, crates, pots.
ItemProp item=<item string> An item lying on the ground.
Animated props autoprop=1, lumpname=, states=, startstate=, loopinganimation=, triggerable=1, name=, key=, fullbright=1 Doors, levers, any animated model. fullbright=1 draws it at full brightness whatever the level's light, like Kelethin's lamps.
Blocker radius=, height= An invisible wall (a cylinder).
PointLight see Lights A placed light.
Prefab prefab=<id>, name=, <part>.<key>= One of the mod's prefabs.
Level records charAmbient_Light, charDirectional_Light, clearColor, customVars The level's light, colour and camera records.
Critters and traps bat, rat, raven, trap, webtrap, lever, catapult, boat... As on the disc.

Tip A map that doesn't keep the base level's objects starts from nothing, including the level's light and camera records. To keep the level's light and camera, copy them in: in a remaster, Copy the base level's objects into the map does it.

The quickest way to learn a kind's parameters is to see how the disc uses it: remaster a level, copy its objects into the map, and select one.

Ready-made objects

Three kinds the port adds, each turned into the disc's own objects when the map is played. Their parameters are added to (or replace) the built-in ones.

Kind Becomes Parameters
PlanarGateway The hub's gateway rings, glowing, with the use spot that opens the realm map any of the rings' keys
Shop A use spot that opens the store message=, icon=, radius=
LevelDoor A use spot that goes to another level or map to= (a disc level or a map key @mod/id), entrance= (a Player1 name there), message=, icon=, key=

With these, a map can be a hub of its own: a gateway to the realm map, a shop, and doors to the mod's other maps.

Cutting room floor

Some objects work in the original game's code but no level on the disc places them. They are kept, and the Level Editor's palette lists them under Cutting room floor, so a map can use them. Anything of this kind the port restores goes there.

Kind Parameters What it is
Portal with hurt=1 lump=jumpgate, hurt=1, destination=<level>, script= A hurt portal: a gate that takes the party by itself. When every player stands within 100 units it warps them to destination (without one, it opens the gate menu). A player within 215 who has not set it off yet is warned. While it is live it crackles with electric arcs and its blue light flickers; its warp shows arcs from each hero to the gate and blue glows on them, not the normal gate's beam. script= names a function that returns nonzero while the portal is live (checked every 32 frames); without one it is always live.
Candle A small flame and a dim light.
Candle2 A bigger candle: a larger flame and light.
Candle3 A small flame with no light.
Lamp Two sparks a frame, a glow and a light.
fireballShooter (or Shooter) An invisible turret. While a hero is within 720 units, every 100 frames it shoots a fireball along +x, -x, +y or -y at any hero in line (a strip 720 long and 96 to either side, within 60 of its height, with no wall in between). From the fourth realm on the fireball burns harder.
arrowShooter The same, with arrows: every 100 frames it readies a volley of five arrows in each direction and shoots them at a hero in line.
MissileTrap name=, mode= (0 fireball, 1 arrow), interval= (frames, default 60) An invisible trap that shoots along its facing every interval frames once a script calls trigger("<name>", 1); trigger("<name>", 0) stops it. The original's form, a first parameter 1,90 (mode, interval), works too.
MetalCrateLrg name= A pushable metal crate, 48 units across. Walk into it to shove it. It is a real tumbling box: friction at its base tips it over as it slides, it slides along walls, slides off a ledge and drops, and stacks on another crate. A crate pushed into another slides around it rather than shoving it. It settles and stops about three seconds after the last push. Players stand on it like any solid object. Its place and rotation are kept in the level memory and the save, and online every player sees it where the host has it.
MetalCrateSml name= The small pushable crate, 30 units across.

Lights

A PointLight is a light with nothing else: no model, no flame. It lights the level, creatures and heroes, and casts shadows with Remastered Weather's Torch Shadows setting. The palette's Lights & FX has ready ones (steady, fire, magic, beacon, darkness), and a selected light has its own panel.

Parameter Default Means
color 1,0.8,0.55 r,g,b (1.0 is full) or #rrggbb. Negative darkens.
intensity 1 Multiplies the colour
radius 220 World units, up to 1000
mode steady steady, flicker (a fire), pulse (a slow swell), blink, off (starts off)
radius2 80% of radius The other end of a flicker, pulse or blink
period the mode's Seconds: flicker 0.1, pulse 2, blink 1
height 0 Above the object's position
shadows 1 Casts shadows
on 1 How it starts
name What scripts turn it on and off by

@light:<name> (below) or trigger("<name>") in a script turns every light of that name on, off or over. The 16 lights nearest the camera are drawn.

Inline actions

A parameter that would name a level-script function (action=, key=, t=, script=, deathscript=...) can instead hold inline actions: a value starting with @, steps separated by ;, each @name or @name:arg. They run without any script.

Step Does
@missionmap Opens the realm map
@store Opens the store
@level:<name>[:<entrance>] Goes to a disc level or a map (@mod/id), arriving at the named start point
@message:<key or words> Shows a message (a text key, or words)
@sound:[<lump>:]<name>.anm Plays a sound (from fx.lmp unless a lump is named)
@setv:<var>:<n>, @addv:<var>[:<n>], @setpv:<var>:<n> Sets or adds to a save variable, or sets a profile variable
@grant:<mission> Completes a disc mission (1 to 12)
@gold:<n> Gives gold (negative takes it)
@item:<item string>[:<count>] Gives an item
@heal Full health
@save Opens the Save Game screen
@call:<function> Calls a level-script function (when the map has a script)
@dialog:<npc> Starts that NPC's dialog
@trigger:<name> Advances the named objects (doors, levers, spawners) and toggles lights of that name
@light:<name>[:on|off|toggle] Turns the named lights on, off or over
@need:var:<name>[:<n>], @need:item:<name>[:<n>], @need:gold:<n>, @need:mission:<n> Stops (and, as a key, refuses with lockmessage) unless it holds
@unless:var:<name>[:<n>], @unless:mission:<n> When it holds, skips the steps after it

As a key=, the value passes unless a @need step fails.

Example A sealed door that opens for a key and takes the party on. A PushTrigger with:

  • key=@need:item:rustykey
  • lockmessage=mydoorlocked (a text key the mod adds, see Text)
  • action=@sound:door_wd_open.anm;@level:@my-mod/cellar

Example A remaster without the disc's script completes its mission from a use spot: action=@grant:1;@level:hub.

For anything more, write a script: Scripting overview.