Removing topic from conversation
TinynanamiTest
05 Jan 2022, 18:00So I have a conversation like this
topics = Split ("About him...;About magic...;Request help...;Nevermind.", ";")
ShowMenu ("What do you want to inquire about?", topics, false)
Followed by a switch menu with results and cases.
So my question is, say, I want to remove 'request help' after the player uses that option (aka it would be non-repeatable) then how would I go about removing that topic? Or making it hidden?
mrangel
05 Jan 2022, 20:57You'd probably want to make the list of topics an attribute rather than a local variable, so it's saved. So then you only create the list the first time you use it.
For example:
firsttime {
someobject.topics = Split ("About him...;About magic...;Request help...;Nevermind.")
}
ShowMenu ("What do you want to inquire about?", someobject.topics, false)
(replacing someobject with the name of an object; the NPC is probably a good choice)
Then later, you can do
list remove (someobject.topics, "About him...")
to remove an item from the list. Similarly, you can use list add
if you want to add more options later.