X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fmapdef%2Fmapdef.txt;h=f2fcf7827b23237eda1e1f577b75221626614d78;hb=HEAD;hp=ed2f95d74f709b412fe5d864aec61204f6be759c;hpb=db9e913bebcfba6251351e97118db8ee01c76cc0;p=d2df-sdl.git diff --git a/src/mapdef/mapdef.txt b/src/mapdef/mapdef.txt index ed2f95d..25590cc 100644 --- a/src/mapdef/mapdef.txt +++ b/src/mapdef/mapdef.txt @@ -1,32 +1,33 @@ // yes, this file serves both as format description and as template for code generation -// the engine will use this description to populate the corresponding records from MAP*.pas -// also, the engine will keep the loaded map as a list of these structures +// the engine will use this description to parse legacy binary map format // notes: -// field without offset is not in binary format -// fields with `writedefault` won't be written when they contain default values -// fields with `internal` won't be written to any file ever (and won't be read) -// `ubyte` is unsigned byte, and `byte` is signed byte -// all strings are in utf-8 -// struct with `header` flag will contain all other structs and it's own fields -// as top-level entities -// in binary, `size` is two ushorts -// `as xy` will use `X` and `Y` for points -// `as txy` will use `tX` and `tY` for points -// `as wh` will use `Width` and `Height` for size -// `as twh` will use `tWidth` and `tHeight` for size -// `as monsterid`: special hack for triggers: monster record number+1 in binary (so 0 means "none") - +// * field without offset is not in binary format +// * fields with `writedefault` will be written even if they contain default values +// * fields with `internal` won't be written to any file ever (and won't be read) +// * `ubyte` is unsigned byte, and `byte` is signed byte +// * all strings are in utf-8 +// * struct with `header` flag will contain all other structs and it's own fields as top-level entities +// * in binary, `size` is two ushorts +// * `as xy` will use `X` and `Y` for points +// * `as txy` will use `tX` and `tY` for points +// * `as wh` will use `Width` and `Height` for size +// * `as twh` will use `tWidth` and `tHeight` for size +// * `as monsterid`: special hack for triggers: monster record number+1 in binary (so 0 means "none") +// * `binblock` and `offset` (and `[]` arrays) are used to parse legacy binary format //////////////////////////////////////////////////////////////////////////////// // main blocks "map" size 452 bytes header binblock 7 { - "name" type char[32] offset 0 writedefault; - "author" type char[32] offset 32 default ""; - "description" type char[256] offset 64 default ""; - "music" type char[64] offset 320 default 'Standart.wad:D2DMUS\ПРОСТОТА'; - "sky" type char[64] offset 384 default 'Standart.wad:D2DSKY\RSKY1'; + "name" type char[32] offset 0 writedefault tip "map name"; + "author" type char[32] offset 32 default "" writedefault tip "map author"; + "description" type char[256] offset 64 default "" writedefault tip "map description"; + "music" type char[64] offset 320 default 'Standart.wad:D2DMUS\ПРОСТОТА' writedefault tip "music resource"; + "sky" type char[64] offset 384 default 'Standart.wad:D2DSKY\RSKY1' writedefault tip "sky resource"; "size" type size offset 448 as wh writedefault; + // not in binary + // temporary, for lighting experiments + "light_ambient" type color default (0 0 0 255) tip "ambient light for the whole level"; } "texture" size 65 bytes binblock 1 { @@ -81,6 +82,11 @@ "keys" type ubyte offset 19 bitset Key default KEY_NONE; //WARNING: "trigdata" MUST be defined before "type", and "type" MUST be named "type" (for now, can be changed later) "triggerdata" type trigdata[128] offset 20; // the only special nested structure + //DO NOT USE! experimental feature! will be removed! + "exoma_init" type string default "" tip "will be called on trigger creation"; + "exoma_think" type string default "" tip "will be called on each think step"; + "exoma_check" type string default "" tip "will be called before activation"; + "exoma_action" type string default "" tip "will be called on activation"; } @@ -97,7 +103,8 @@ enum TextureSpecial { enum DirType { DIR_LEFT, // 0 DIR_RIGHT, // 1 - DIR_SOMETHING2, // 2 + DIR_PRESERVE, // 2 + DIR_REVERSE, // 3 } // triggers @@ -169,6 +176,7 @@ enum EffectAction { EFFECT_FIRE, // 3 } +//WARNING! max allowed items types is 127 enum Item { ITEM_NONE, // 0 ITEM_MEDKIT_SMALL, // 1 @@ -188,7 +196,7 @@ enum Item { ITEM_WEAPON_ROCKETLAUNCHER, // 15 ITEM_WEAPON_PLASMA, // 16 ITEM_WEAPON_BFG, // 17 - ITEM_WEAPON_SUPERPULEMET, // 18 + ITEM_WEAPON_SUPERCHAINGUN, // 18 ITEM_AMMO_BULLETS, // 19 ITEM_AMMO_BULLETS_BOX, // 20 ITEM_AMMO_SHELLS, // 21 @@ -201,7 +209,7 @@ enum Item { ITEM_KEY_RED, // 28 ITEM_KEY_GREEN, // 29 ITEM_KEY_BLUE, // 30 - ITEM_WEAPON_KASTET, // 31 + ITEM_WEAPON_IRONFIST, // 31 ITEM_WEAPON_PISTOL, // 32 ITEM_BOTTLE, // 33 ITEM_HELMET, // 34 @@ -209,6 +217,8 @@ enum Item { ITEM_INVIS, // 36 ITEM_WEAPON_FLAMETHROWER, // 37 ITEM_AMMO_FUELCAN, // 38 + // backward compatibility aliases + ITEM_WEAPON_SUPERPULEMET = 18, // ITEM_WEAPON_SUPERCHAINGUN // ITEM_MAX = MAX, // store the last item's id in here use this in for loops } @@ -282,6 +292,7 @@ enum TriggerShot { TRIGGER_SHOT_BFG, // 12 TRIGGER_SHOT_EXPL, // 13 TRIGGER_SHOT_BFGEXPL, // 14 + TRIGGER_SHOT_FLAME, // 15 // TRIGGER_SHOT_MAX = MAX, } @@ -369,6 +380,20 @@ bitset Key { KEY_BLUETEAM, // 16 } +enum HitType { + HIT_SOME, // 0 + HIT_ROCKET, // 1 + HIT_BFG, // 2 + HIT_TRAP, // 3 + HIT_FALL, // 4 + HIT_WATER, // 5 + HIT_ACID, // 6 + HIT_ELECTRO, // 7 + HIT_FLAME, // 8 + HIT_SELF, // 9 + HIT_DISCON, // 10 +} + //////////////////////////////////////////////////////////////////////////////// // various triggers @@ -398,6 +423,8 @@ TriggerData for (TRIGGER_PRESS, TRIGGER_ON, TRIGGER_OFF, TRIGGER_ONOFF) { "ext_random" type bool offset 20 default false; // this one is for moving platforms "panelid" panel default null; + "silent" type bool default true; + "sound" type string default ""; } enum TriggerScoreTeam { @@ -477,6 +504,7 @@ TriggerData for TRIGGER_MESSAGE { TriggerData for TRIGGER_DAMAGE { "amount" type ushort offset 0 writedefault; "interval" type ushort offset 2 writedefault; + "kind" type ubyte offset 4 enum HitType default HIT_SOME writedefault; } TriggerData for TRIGGER_HEALTH { @@ -490,7 +518,7 @@ TriggerData for TRIGGER_SHOT { "position" type point offset 0 as txy writedefault; "type" alias shotType type ubyte offset 8 enum TriggerShot writedefault; "target" alias shotTarget type ubyte offset 9 enum TriggerShotTarget writedefault; - "quiet" type negbool offset 10; // negbool! + "sound" alias shotSound type negbool offset 10; // negbool! "aim" type byte offset 11 enum TriggerShotAim default TRIGGER_SHOT_AIM_DEFAULT; "panelid" type int offset 12 panel default null writedefault; "sight" type ushort offset 16;