Random dialogue in conversation
-
- Posts: 194
- Joined: Mon Jul 01, 2019 1:21 pm
Random dialogue in conversation
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
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
Hi,
That's all pretty easy in the Dialogue System. No customization necessary.
That's all pretty easy in the Dialogue System. No customization necessary.
Keep looping the conversation back to a Group node whose Script field contains RandomizeNextEntry().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.
Define a variable for each stat. In a node's Script field, do something like this: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.
Code: Select all
Variable["Hunger"] = Variable["Hunger"] - math.random(1,3)
-
- Posts: 194
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Random dialogue in conversation
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.
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
Set a variable true after using those nodes, and set conditions on those nodes to require that the variable isn't true yet.
-
- Posts: 194
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Random dialogue in conversation
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
If you're using continue buttons, then in that node leave the text blank and/or set the Sequence field to: Continue()
-
- Posts: 194
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Random dialogue in conversation
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.
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
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.
-
- Posts: 194
- Joined: Mon Jul 01, 2019 1:21 pm
Re: Random dialogue in conversation
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.
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
See this post on randomizing player responses.