Still new so I'm mostly looking for guidance to get me pointed in the right direction.
Scenario is the NPC has random greetings setup with sequence command RandomizeNextEntry()
Next level I've added multiple greetings, the random method works well.
I merge those random greetings into a single node with sequence command Next() to act as a no-delay passthrough.
One response the player has is asking the NPC to repeat themselves.
That links back to the opening node with the RandomizeNextEntry().
Setup like this so far as a simple example:
(my onedrive) https://1drv.ms/u/s!AjLMZMLArtRQ_CWdTVX ... B?e=sdvsK7
This all works as expected, but there are a couple of scenarios I'm not clear on.
I would like the random greetings to be weighted, and likely never repeat the same greeting twice in a row.
I would like priorities to shift based on how many times the player asks to repeat
The idea is the player can be a jerk and keep asking the NPC to repeat. Like most people this will make the NPC annoyed, so I would have additional greeting nodes that only get used when "annoyed > 5" for example. And eventually the dialogue would change to a new branch where the player no longer gets a chance to respond.
Maybe I have groups of greetings, like "Friendly, annoyed < 2", "Annoyed, annoyed between 2-5", "Mad, annoyed > 5" that I branch into based on a condition check of the annoyed var which increments each time the player repeats?
While I believe I can handle all of this with conditions and LUA variables directly in the conversation nodes, I'm thinking it might be easier to just push this all to code to get more sophisticated with it and/or record history/logs etc.
Or, are there built in functions that do most or all of that?
Random Weights and Repeating Levels
Re: Random Weights and Repeating Levels
You could certainly do it with Lua variables and conditions. I think there are some examples floating around in forum threads here. But if you're comfortable scripting, you might prefer to do that for the more complex logic. To prevent repeats, I recommend just handling that in Lua conditions and variables -- or actor fields instead of variables, if you want to make them specific to each actor. Ex: Actor["Bob"].annoyanceLevel < 5 versus Variable["annoyanceLevel"] < 5.
If you go with scripting, it'll probably be easiest if you register your C# methods with Lua. This way you can use them in dialogue entry nodes' Conditions fields.
If you go with scripting, it'll probably be easiest if you register your C# methods with Lua. This way you can use them in dialogue entry nodes' Conditions fields.