diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index f61096f69..5bac0bb4d 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -39,7 +39,7 @@ between the TEXTMAP and ENDMAP lumps: BEHAVIOR = contains compiled ACS code DIALOGUE = contains compiled Strife conversation scripts. ZNODES = Nodes (must be stored as extended GL nodes. Compression is allowed - but deprecated for portability reasons.) + but deprecated for portability reasons.) BLOCKMAP = blockmap. It is recommended not to include this lump in UDMF maps. REJECT = reject table. Recommended use is for special effects only. @@ -111,11 +111,16 @@ Note: All fields default to false unless mentioned otherwise. midtex3d = ; // Actors can walk on mid texture. checkswitchrange = ;// Switches can only be activated when vertically reachable. blockprojectiles = ;// Line blocks all projectiles - blockuse = ; // Line blocks all use actions - blocksight = ; // Line blocks monster line of sight - + blockuse = ; // Line blocks all use actions + blocksight = ; // Line blocks monster line of sight + arg0str = ; // Alternate string-based version of arg0 + + * Note about arg0str + + For lines with ACS specials (80-86 and 226), if arg0str is present and non-null, it + will be used as the name of the script to execute, and arg0 will be ignored. } - + sidedef { scalex_top = ; // X scale for upper texture, Default = 1.0. @@ -135,16 +140,16 @@ Note: All fields default to false unless mentioned otherwise. light = ; // This side's light level. Default is 0. lightabsolute = ; // true = 'light' is an absolute value. Default is // relative to the owning sector's light level. - nofakecontrast = ; // Disables use of fake contrast on this sidedef. - smoothlighting = ; // Use smooth fake contrast. + nofakecontrast = ; // Disables use of fake contrast on this sidedef. + smoothlighting = ; // Use smooth fake contrast. clipmidtex = ; // Side's mid textures are clipped to floor and ceiling. wrapmidtex = ; // Side's mid textures are wrapped. - nodecals = ; // Disables decals on the sidedef. + nodecals = ; // Disables decals on the sidedef. } - + sector { - xpanningfloor = ; // X texture offset of floor texture, Default = 0.0. + xpanningfloor = ; // X texture offset of floor texture, Default = 0.0. ypanningfloor = ; // Y texture offset of floor texture, Default = 0.0. xpanningceiling = ; // X texture offset of ceiling texture, Default = 0.0. ypanningceiling = ; // Y texture offset of ceiling texture, Default = 0.0. @@ -163,9 +168,9 @@ Note: All fields default to false unless mentioned otherwise. alphafloor = ; // translucency of floor plane (only has meaning with Sector_SetPortal) Default is 1.0. alphaceiling = ; // translucency of ceiling plane (only has meaning with Sector_SetPortal) Default is 1.0. renderstylefloor = ; // floor plane renderstyle (only has meaning with Sector_SetPortal); not implemented yet in software renderer - // can be "translucent" or "add", default is "translucent". + // can be "translucent" or "add", default is "translucent". renderstyleceiling = ; // ceiling plane renderstyle (only has meaning with Sector_SetPortal); not implemented yet in software renderer - // can be "translucent" or "add", default is "translucent". + // can be "translucent" or "add", default is "translucent". gravity = ; // Sector's gravity. Default is 1.0. lightcolor = ; // Sector's light color as RRGGBB value, default = 0xffffff. fadecolor = ; // Sector's fog color as RRGGBB value, default = 0x000000. @@ -173,29 +178,29 @@ Note: All fields default to false unless mentioned otherwise. silent = ; // Actors in this sector make no sound, nofallingdamage = ; // Falling damage is disabled in this sector dropactors = ; // Actors drop with instantly moving floors (*) - norespawn = ; // Players can not respawn in this sector - soundsequence = ; // The sound sequence to play when this sector moves. Placing a - // sound sequence thing in the sector will override this property. - hidden = ; // if true this sector will not be drawn on the textured automap. + norespawn = ; // Players can not respawn in this sector + soundsequence = ; // The sound sequence to play when this sector moves. Placing a + // sound sequence thing in the sector will override this property. + hidden = ; // if true this sector will not be drawn on the textured automap. * Note about dropactors The spec requires this to be false by default. Currently, however, ZDoom assumes this to be true for Doom format maps so any map converter converting to the ZDoomTranslated namespace should set this flag for each tagged sector. - + } - + thing { skill# = // Unlike the base spec, # can range from 1-16. class# = // Unlike the base spec, # can range from 1-16. - conversation = // Assigns a conversation dialogue to this thing. - // Parameter is the conversation ID, 0 meaning none. - countsecret = ; // Picking up this actor counts as a secret. + conversation = // Assigns a conversation dialogue to this thing. + // Parameter is the conversation ID, 0 meaning none. + countsecret = ; // Picking up this actor counts as a secret. } - - + + *** Special notes for map format conversions: @@ -204,7 +209,7 @@ Note: All fields default to false unless mentioned otherwise. Unless mentioned differently the arg being used to define the line ID should be set to 0. The following line specials are affected: - + 121: Line_SetIdentification, arg 0 208: TranslucentLine, arg0 (arg0 must be preserved) 1: Polyobj_StartLine, arg3 @@ -213,16 +218,16 @@ Note: All fields default to false unless mentioned otherwise. 215: Teleport_Line, arg0 222: Scroll_Texture_Model, arg0 (arg0 must be preserved) 160: Sector_3DFloor, arg4 (both uses as high-byte of tag and line ID are not supported in UDMF and must be remapped) - + Some specials also allow setting the extended flags. These must also be converted to explicitly setting the flags through the defined map fields. This affects the following specials: - + 121: Line_SetIdentification, arg1 208: TranslucentLine, arg3 - + These args are to be converted as follows to flags, bit by bit: - + Bit 0 (Value 1): zoneboundary Bit 1 (Value 2): jumpover Bit 2 (Value 4): blockfloaters @@ -231,13 +236,13 @@ Note: All fields default to false unless mentioned otherwise. Bit 5 (Value 32): midtex3d Bit 6 (Value 64): checkswitchrange Bit 7 (Value 128): firstsideonly - + When used in special 208 this arg should be cleared afterward. - + Special 121 is not being used by UDMF maps in ZDoom and should be completely deleted after conversion. - - + + ======================================= Changelog ======================================= @@ -303,6 +308,10 @@ Removed remarks of 8 being the maximum number of player classes/skill levels the Added renderstyleceiling and renderstylefloor sector properties Added Sector_Set3DFloor to list of specials that need to be handled for line ID remapping +1.18 17.02.2012 +Added arg0str linedef property. +Standardized whitespace. + =============================================================================== EOF =============================================================================== diff --git a/src/namedef.h b/src/namedef.h index 6cf7f322c..d9d71891e 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -292,6 +292,7 @@ xx(Arg1) xx(Arg2) xx(Arg3) xx(Arg4) +xx(Arg0Str) xx(Id) xx(V1) xx(V2) @@ -379,13 +380,13 @@ xx(Midtex3d) xx(Checkswitchrange) xx(Firstsideonly) xx(Transparent) -xx(Passuse) -xx(Repeatspecial) -xx(Conversation) -xx(Locknumber) - -xx(Playercross) -xx(Playeruse) +xx(Passuse) +xx(Repeatspecial) +xx(Conversation) +xx(Locknumber) + +xx(Playercross) +xx(Playeruse) xx(Playeruseback) xx(Monstercross) xx(Impact) diff --git a/src/p_lnspec.h b/src/p_lnspec.h index 1d6a21bd9..9fb4c17b3 100644 --- a/src/p_lnspec.h +++ b/src/p_lnspec.h @@ -198,6 +198,11 @@ typedef int (*lnSpecFunc)(struct line_t *line, extern lnSpecFunc LineSpecials[256]; extern BYTE NamedACSToNormalACS[7]; +static inline bool P_IsACSSpecial(int specnum) +{ + return (specnum >= ACS_Execute && specnum <= ACS_LockedExecuteDoor) || + specnum == ACS_ExecuteAlways; +} int P_FindLineSpecial (const char *string, int *min_args=NULL, int *max_args=NULL); bool P_ActivateThingSpecial(AActor * thing, AActor * trigger, bool death=false); diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index c65dfe66d..3b7533efc 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -396,8 +396,7 @@ void P_SerializeWorld (FArchive &arc) << li->special << li->Alpha << li->id; - if ((li->special >= ACS_Execute && li->special <= ACS_LockedExecuteDoor) || - li->special == ACS_ExecuteAlways) + if (P_IsACSSpecial(li->special)) { P_SerializeACSScriptNumber(arc, li->args[0], false); } diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 20ef4ffd2..cdf2562f1 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -651,6 +651,7 @@ public: { bool passuse = false; bool strifetrans = false; + FString arg0str; memset(ld, 0, sizeof(*ld)); ld->Alpha = FRACUNIT; @@ -706,6 +707,11 @@ public: ld->args[int(key)-int(NAME_Arg0)] = CheckInt(key); continue; + case NAME_Arg0Str: + CHECK_N(Zd); + arg0str = CheckString(key); + continue; + case NAME_Blocking: Flag(ld->flags, ML_BLOCKING, key); continue; @@ -877,17 +883,17 @@ public: Flag(ld->flags, ML_BLOCKUSE, key); continue; - case NAME_blocksight: - Flag(ld->flags, ML_BLOCKSIGHT, key); - continue; - - // [Dusk] lock number - case NAME_Locknumber: - ld->locknumber = CheckInt(key); - continue; - - default: - break; + case NAME_blocksight: + Flag(ld->flags, ML_BLOCKSIGHT, key); + continue; + + // [Dusk] lock number + case NAME_Locknumber: + ld->locknumber = CheckInt(key); + continue; + + default: + break; } if (!strnicmp("user_", key.GetChars(), 5)) @@ -920,6 +926,10 @@ public: ld->sidedef[0] = (side_t*)(intptr_t)(1); Printf("Line %d has no first side.\n", index); } + if (arg0str.IsNotEmpty() && P_IsACSSpecial(ld->special)) + { + ld->args[0] = -FName(arg0str); + } } //===========================================================================