I would like to be able to do several things:
(a) limit the maximum responses a player has to three from a pool of x questions which are randomized (preferably defined in Conversations tab);
(b) remove questions from the pool if certain conditions are met (e.g., don't populate the potential questions with something if learnedTrait = true); and,
(c) add new things to the pool if certain conditions are met (e.g., do have the partner ask new things about the learnedTrait if it is true).
Current Setup:
We have Database variables to hold information about various traits. For example, strings: Job, Sign, and Season (with values of "Dancer", "Aries" and "Summer"). In our Database, we also have corresponding bools such as LearnedJob, LearnedSign, LearnedSeason.
Here is our example code to feed "Job" over to the TextMeshProUGUI string:
Code: Select all
public void UpdateStatSheetUI()
{
// Check if the "learnedJob" boolean is true
if (DialogueLua.GetVariable("LearnedJob").AsBool)
{
// Retrieve the "Job" string variable and update the jobText
string learnedJob = DialogueLua.GetVariable("Job").AsString;
jobText.text = $"Job: {learnedJob}";
}
else
{
// Default text if the job is not learned
jobText.text = "Job: ???";
}
// ... rest of the variables below
Code: Select all
x = math.random(2)
What Works: The text variables display the conversant's assigned traits in-game, and we are successfully keeping track of if the player has learned them and populating our stat sheet. Minimal randomization through coin flip math.random method.
Objective: We'd like to make it so that all 6 of these response entries are pooled (if a trait is not yet learned) to be among only 3 responses that the player will be presented with (and introduce therefore greater randomization). If the trait has been learned, remove the corresponding response option from pool. If the trait has been learned, potentially populate with some other response option.