diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 5ceb573a..9f91c748 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -180,6 +180,8 @@ Note: All fields default to false unless mentioned otherwise. class# = // Unlike the base spec, # can range from 1-8. // 8 is the maximum amount of classes the class // menu can display. + conversation = // Assigns a conversation dialogue to this thing. + // Parameter is the conversation ID, 0 meaning none. } @@ -268,6 +270,9 @@ Added 'playeruseback' line trigger flag. 1.11 07.08.2010 Added 'soundsequnce' sector property. +1.12 22.08.2010 +Added 'conversation' thing property. + =============================================================================== EOF =============================================================================== diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index 0d443bb6..cdac2590 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -317,7 +317,6 @@ PClass *PClass::CreateDerivedClass (FName name, unsigned int size) info->DamageFactors = NULL; info->PainChances = NULL; info->ColorSets = NULL; - info->ConversationID = -1; m_RuntimeActors.Push (type); } return type; @@ -412,7 +411,6 @@ void PClass::InitializeActorInfo () info->DamageFactors = NULL; info->PainChances = NULL; info->ColorSets = NULL; - info->ConversationID = -1; m_RuntimeActors.Push (this); } diff --git a/src/doomdata.h b/src/doomdata.h index 85924626..9c22b22a 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -340,6 +340,7 @@ struct FMapThing DWORD flags; int special; int args[5]; + int Conversation; void Serialize (FArchive &); }; diff --git a/src/info.h b/src/info.h index d7d939c0..9480f5f5 100644 --- a/src/info.h +++ b/src/info.h @@ -203,7 +203,6 @@ struct FActorInfo BYTE GameFilter; BYTE SpawnID; SWORD DoomEdNum; - int ConversationID; FStateLabels *StateList; DmgFactors *DamageFactors; PainChanceList *PainChances; diff --git a/src/namedef.h b/src/namedef.h index b91781b8..cb3e78ea 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -383,6 +383,7 @@ xx(Firstsideonly) xx(Transparent) xx(Passuse) xx(Repeatspecial) +xx(Conversation) xx(Playercross) xx(Playeruse) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index 37739a43..96b00b1a 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -266,7 +266,7 @@ static bool LoadScriptFile(int lumpnum, FileReader *lump, int numnodes, bool inc char buffer[4]; lump->Read(buffer, 4); - lump->Seek(0, SEEK_SET); + lump->Seek(-4, SEEK_CUR); // The binary format is so primitive that this check is enough to detect it. bool isbinary = (buffer[0] == 0 || buffer[1] == 0 || buffer[2] == 0 || buffer[3] == 0); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index c6011d4e..2b9da7a5 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -4394,6 +4394,17 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) mobj->AddToHash (); mobj->PrevAngle = mobj->angle = (DWORD)((mthing->angle * UCONST64(0x100000000)) / 360); + + // Check if this actor's mapthing has a conversation defined + if (mthing->Conversation > 0) + { + mobj->ConversationRoot = GetConversation(mthing->Conversation); + if (mobj->ConversationRoot != -1) + { + mobj->Conversation = StrifeDialogues[mobj->ConversationRoot]; + } + } + mobj->BeginPlay (); if (!(mobj->ObjectFlags & OF_EuthanizeMe)) { diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index ef7f991f..e75d324d 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -493,6 +493,11 @@ public: th->type = (short)CheckInt(key); break; + case NAME_Conversation: + CHECK_N(Zd | Zdt) + th->Conversation = CheckInt(key); + break; + case NAME_Special: CHECK_N(Hx | Zd | Zdt | Va) th->special = CheckInt(key); diff --git a/src/p_usdf.cpp b/src/p_usdf.cpp index 21bd8eeb..7bcca220 100644 --- a/src/p_usdf.cpp +++ b/src/p_usdf.cpp @@ -71,6 +71,7 @@ class USDFParser : public UDMFParserBase sc.ScriptMessage("'%s' is not an actor type", key); return NULL; } + return cls; } return NULL; } diff --git a/src/svnrevision.h b/src/svnrevision.h index 2c20b5c6..1b2d981e 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -3,5 +3,5 @@ // This file was automatically generated by the // updaterevision tool. Do not edit by hand. -#define ZD_SVN_REVISION_STRING "2563" -#define ZD_SVN_REVISION_NUMBER 2563 +#define ZD_SVN_REVISION_STRING "2569" +#define ZD_SVN_REVISION_NUMBER 2569 diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 1e8f51f9..1e47dfd8 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -257,7 +257,6 @@ DEFINE_INFO_PROPERTY(conversationid, IiI, Actor) } - bag.Info->ConversationID = convid; if (convid <= 0) return; // 0 is not usable because the dialogue scripts use it as 'no object'. SetStrifeType(convid, info->Class); }