Removing topic from conversation

So 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?

You'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.

Log in to post a reply.