Page 1 of 1
Random dialogue in conversation
Posted: Thu Aug 08, 2019 2:33 pm
by lostmushroom
Hey, I'm trying something out in unity and I want to see if it can be done with dialogue system.
The idea is for the player to be in one continuous 'conversation', which will give them random dialogue prompts. They then respond to them by making choices. There will be multiple dialogue prompts such as 'go into the cave?', 'eat the mushroom?', etc. I would like it to pick them at random.
Basically it's a game where you have to avoid dying by making the right choices.
I also want to have some stats that have a random element of change each time you get a prompt. For example, with each prompt, you could lose between 1 and 3 points of hunger.
Does this sound like something dialogue system could do, or would it require some customizing?
Thanks
Re: Random dialogue in conversation
Posted: Thu Aug 08, 2019 4:25 pm
by Tony Li
Hi,
That's all pretty easy in the Dialogue System. No customization necessary.
lostmushroom wrote: ↑Thu Aug 08, 2019 2:33 pmThe idea is for the player to be in one continuous 'conversation', which will give them random dialogue prompts. They then respond to them by making choices. There will be multiple dialogue prompts such as 'go into the cave?', 'eat the mushroom?', etc. I would like it to pick them at random.
Keep looping the conversation back to a Group node whose Script field contains
RandomizeNextEntry().
lostmushroom wrote: ↑Thu Aug 08, 2019 2:33 pmI also want to have some stats that have a random element of change each time you get a prompt. For example, with each prompt, you could lose between 1 and 3 points of hunger.
Define a variable for each stat. In a node's Script field, do something like this:
Code: Select all
Variable["Hunger"] = Variable["Hunger"] - math.random(1,3)
Re: Random dialogue in conversation
Posted: Thu Aug 08, 2019 4:50 pm
by lostmushroom
Perfect, that's exactly what I need!
Is there a way to have it skip some dialogue entries? I have a couple of nodes that are only used for setting variables, or being used as Randomizers.
Re: Random dialogue in conversation
Posted: Thu Aug 08, 2019 5:04 pm
by Tony Li
Set a variable true after using those nodes, and set conditions on those nodes to require that the variable isn't true yet.
Re: Random dialogue in conversation
Posted: Thu Aug 08, 2019 5:10 pm
by lostmushroom
Sorry, I wasn't clear. I meant that I want the entry to be played, I just don't want any text to show. For example I have a dialogue entry that does nothing but check to see how many scenarios you've played so far. Even if I leave the text blank, it requires two clicks to progress. I want it to be an 'invisible' node, so to speak.
Re: Random dialogue in conversation
Posted: Thu Aug 08, 2019 5:24 pm
by Tony Li
If you're using continue buttons, then in that node leave the text blank and/or set the Sequence field to: Continue()
Re: Random dialogue in conversation
Posted: Thu Aug 08, 2019 5:33 pm
by lostmushroom
Nice, that seems to be working! Thanks.
One last thing - is it possible to show variables on screen? I'd like the player to be able to see their stats.
Re: Random dialogue in conversation
Posted: Thu Aug 08, 2019 5:41 pm
by Tony Li
Yup, use the [var=variable] tag in dialogue text or quest text. You can create a quest that starts active with both tracking checkboxes ticked. It will appear in the HUD. Whenever you change a variable, also put UpdateTracker() in the Script field to automatically update the HUD.
Re: Random dialogue in conversation
Posted: Thu Aug 08, 2019 5:55 pm
by lostmushroom
Okay, one last last thing
Can you also randomize player choices? Let's say I have a scenario where you are prompted to choose between two potions. I always want there to be only 2 choices, but for those choices to randomly pick from 4 or 5 options of potions.
Re: Random dialogue in conversation
Posted: Thu Aug 08, 2019 8:09 pm
by Tony Li
See
this post on randomizing player responses.