Preventing multiple entries of the same item in a string list

I'm working on kinda dynamic conservations with NPCs.
There are multiple ways to get the new option for certain conversations and I need a way to check the list beforehand.
If a conversation option already exists it'll be listed twice like now. Adding something just for the first time doesn't help, because it could be triggered somewhere else.

My conversation options are retrieved from a string list for each step of the conversation. If the player gets certain knowledge, the option is added to a list.

For the adding step, I was hoping for something like: If list does not contain "BlaBla." then add "Blabla."

if (not ListContains (someobject.listattribute, "Some option")) {
  list add (someobject.listattribute, "Some option")

You might also find ListCompact() useful. The statement someList = ListCompact (someList) will remove all duplicates from a list.

Thanks, it seems the 'ListCompact' function is the most easiest way to implant into my already existing conversations.

This topic is now closed. Topics are closed after 60 days of inactivity.