9
3

TalkTestSimple.lua 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. --[[
  2. Script Name : SpawnScripts/thunderdome/TalkTestSimple.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.05.12 03:05:13
  5. Script Purpose : Setup to demonstrate an easy nested dialogue setup. 3 Option Hail
  6. :
  7. --]]
  8. --HAILED function facilitiates the start of most conversations
  9. function hailed(NPC, Spawn)
  10. FaceTarget(NPC, Spawn) -- Forces NPC to face Spawn (player)
  11. conversation = CreateConversation() -- Designates diologue is created when referenced
  12. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1039.mp3", "", "hello", 0, 0, Spawn)
  13. --Plays Voiceover, emotes, and directs who the Voiceover is to.
  14. AddConversationOption(conversation, "Dance. [OPTION 1]", "Option1")
  15. AddConversationOption(conversation, "I don't know. [OPTION 2]","Option2") --Notice the "Option#" is the followup dialogue function
  16. AddConversationOption(conversation, "Say something. [OPTION 3]","Option3")
  17. AddConversationOption(conversation, "Do nothing.") --Notice NO followup function
  18. StartConversation(conversation, NPC, Spawn, "What would you like to do?") --Required to start a dialogue. Place it at the bottom of your dialogue.
  19. end
  20. -- OPTION 1 is a simple emote
  21. function Option1(NPC, Spawn)
  22. FaceTarget(NPC, Spawn)
  23. PlayFlavor(NPC, "", "You've selected OPTION1", "dance", 0, 0, Spawn)
  24. end
  25. -- OPTION 2 creates a conversation loop
  26. function Option2(NPC, Spawn)
  27. FaceTarget(NPC, Spawn)
  28. conversation = CreateConversation()
  29. PlayFlavor(NPC, "", "You've selected OPTION2", "shrug", 0, 0, Spawn)
  30. AddConversationOption(conversation, "Yes")
  31. AddConversationOption(conversation, "No","hailed") --Will call hailed function if used.
  32. StartConversation(conversation, NPC, Spawn, "Do you want to stop talking then?")
  33. end
  34. -- OPTION 3 uses a different language (14 at the end of Playflavor makes text Oggish. Players who understand will be able to read it. Even if you CAN read it, the Voiceover stays the same.)
  35. function Option3(NPC, Spawn)
  36. FaceTarget(NPC, Spawn)
  37. conversation = CreateConversation()
  38. PlayFlavor(NPC, "voiceover/english/ogre/ft/ogre/ogre_eco_garble_garbled_gm_5b81626f.mp3", "OPTION 3. Got any pickled dwarf?", "", 3514709231, 112583900, Spawn, 14)
  39. AddConversationOption(conversation, "Yes")
  40. AddConversationOption(conversation, "No")
  41. StartConversation(conversation, NPC, Spawn, "Understood me?")
  42. end
  43. --[[ Tips on PlayFlavor
  44. PlayFlavor(NPC, "voiceover/english/gubbo_chaley/enchanted/gubbo_chaley/gubbo_chaley006.mp3","If you see Fritz, would you tell him I'm looking for him?","nod", 4082962413, 3474255449, Spawn,8)
  45. --Each variable translated below--
  46. PlayFlavor(Source, "VoiceoverMP3", "TextAboveNPC'sHead", "Emote", MP3key1, MP3key2, Target, LanguageNPCuses)
  47. --No talking example--
  48. PlayFlavor(NPC,"","","shakefist",0,0,Spawn)
  49. ]]--