From 883510efe2eb5dabc2de06338d6e625edf387bcf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 22 Aug 2010 17:18:46 +0000 Subject: [PATCH] - added UMDF property to assign conversation dialogues to mapthings. SVN r2567 (trunk) --- specs/udmf_zdoom.txt | 5 +++++ src/doomdata.h | 1 + src/namedef.h | 1 + src/p_mobj.cpp | 11 +++++++++++ src/p_udmf.cpp | 5 +++++ 5 files changed, 23 insertions(+) diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 5ceb573aa..9f91c748e 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/doomdata.h b/src/doomdata.h index 859246261..9c22b22a6 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/namedef.h b/src/namedef.h index b91781b86..cb3e78ea2 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_mobj.cpp b/src/p_mobj.cpp index c6011d4ea..2b9da7a54 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 ef7f991ff..e75d324df 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);