Hi. I was able to randomize the nodes based on the other threads posted here. (Thanks to that!)
But what I want to do is avoid repetition of a node.
For example: The player talked to NPC, NPC chooses node 1 dialogue. Then, whenever I talk to NPC again, NPC will not choose node 1 anymore.
I was thinking of placing a boolean variable in each of the nodes, then when a node is chosen, the variable will become true in that node but not in other nodes. Is this possible? If not, is there any other methods?
Random Node and avoid repetition
Re: Random Node and avoid repetition
Hi,
Variables (and/or quest states) are a good solution if you want to check only at specific branches. Use the Script field to set variables, and the Conditions field to check them. I'll sometimes include the actor's name in the variable name to help distinguish them, such as "Dancer_GaveAlibi", "Widow_AcceptedJob", "Bookie_GotNumbers", etc. Then you can use them like this:
Dancer conversation:
Dancer conversation:
If you decide to use SimStatus, on the Dialogue Manager's Input Settings there's a dropdown Em Tag for Old Responses. You can change this from None to apply an emphasis tag to player response entries that the player has already selected. Some games use this to remind players what responses they've already tried.
Variables (and/or quest states) are a good solution if you want to check only at specific branches. Use the Script field to set variables, and the Conditions field to check them. I'll sometimes include the actor's name in the variable name to help distinguish them, such as "Dancer_GaveAlibi", "Widow_AcceptedJob", "Bookie_GotNumbers", etc. Then you can use them like this:
Dancer conversation:
- Dancer: "What can I do for ya, detective?"
- Player: "Where were you on Saturday night?"
Conditions: Variable["Dancer_GaveAlibi"] == false- Dancer: "Right here on this stage until dawn." [END]
Script: Variable["Dancer_GaveAlibi"] = true
- Dancer: "Right here on this stage until dawn." [END]
- Player: "You said you were here until dawn. Then who made a call from your apartment at 9PM?"
Conditions: Variable["Dancer_GaveAlibi"] == true- Dancer: "My cousin's staying with me for the week. What's it to ya?"
- Player: "Where were you on Saturday night?"
- "Untouched": Entry has never been spoken or shown in a player response menu.
- "WasOffered": Shown in a player response menu but not selected by player.
- "WasDisplayed": Spoken (by a player or NPC).
Dancer conversation:
- [1] Dancer: "What can I do for ya, detective?"
- [2] Player: "Where were you on Saturday night?"
Conditions: Dialog[3].SimStatus == "Untouched"- [3] Dancer: "Right here on this stage until dawn." [END]
- [4] Player: "You said you were here until dawn. Then who made a call from your apartment at 9PM?"
Conditions: Dialog[3].SimStatus == "WasDisplayed"- [5] Dancer: "My cousin's staying with me for the week. What's it to ya?"
- [2] Player: "Where were you on Saturday night?"
If you decide to use SimStatus, on the Dialogue Manager's Input Settings there's a dropdown Em Tag for Old Responses. You can change this from None to apply an emphasis tag to player response entries that the player has already selected. Some games use this to remind players what responses they've already tried.
-
- Posts: 45
- Joined: Sat Jul 30, 2016 8:37 am
Re: Random Node and avoid repetition
The first method cannot be applied on my case, because I'm having a quiz type dialogue, if I used it, once I set the variable to true, all of the nodes with the condition of variable=false will be affected, resulting for the conversation to end.
The second one does work(thanks!), but another problem came up. Once a dialogue was shown, its simstatus became WasDisplayed? I have a condition in a node like this (randomValue==0) and (Dialog[14].SimStatus=="Untouched"). And when it finishes randomizing, the conversation ends. I interpret this as the result of randomizing is 0, and the only conversation with randomvalue==0 is dialog[14].
I just can't create a node with a condition of (randomValue==0) and (Dialog[14].SimStatus=="WasDisplayed") and a dialogue text of "This question is already shown. Try again" because it ruins the quiz concept.
Currently I'm looking for a workaround by means of trial and error, but so far I think there is no workaround. If there is one, I would be glad, if there is none, I have no choice to stick with the solution I came up above this paragraph.
The second one does work(thanks!), but another problem came up. Once a dialogue was shown, its simstatus became WasDisplayed? I have a condition in a node like this (randomValue==0) and (Dialog[14].SimStatus=="Untouched"). And when it finishes randomizing, the conversation ends. I interpret this as the result of randomizing is 0, and the only conversation with randomvalue==0 is dialog[14].
I just can't create a node with a condition of (randomValue==0) and (Dialog[14].SimStatus=="WasDisplayed") and a dialogue text of "This question is already shown. Try again" because it ruins the quiz concept.
Currently I'm looking for a workaround by means of trial and error, but so far I think there is no workaround. If there is one, I would be glad, if there is none, I have no choice to stick with the solution I came up above this paragraph.
-
- Posts: 45
- Joined: Sat Jul 30, 2016 8:37 am
Re: Random Node and avoid repetition
Found a solution. I just have to create an empty node with a sequence of None() and a condition of (randomNum==0) and (Dialog[14].SimStatus=="WasDisplayed") and put a script randomNum=math.random(0,3) to it.
Basically, this solution randomizes a number again if randomNum=0, it keeps randomizing until it gets a number that isn't 0. That's all, thank you
Basically, this solution randomizes a number again if randomNum=0, it keeps randomizing until it gets a number that isn't 0. That's all, thank you