Hello all!
My question is regarding when the player revisits an NPC. We would like the NPC to say something different the second time the player visits her. (Sidenote: I'm very new to DS. Answers that simplify and break down the process would be most helpful).
Below you can see an image of what we are trying to do. Ideal, when the player comes back to the NPC, I would like to trigger the second string of text on the right without repeating what was already said (in the first string on the left). Thank you in advance for your help
How to trigger a new dialogue sequence when the player revisits an NPC?
How to trigger a new dialogue sequence when the player revisits an NPC?
- Attachments
-
- image.png (44.38 KiB) Viewed 527 times
Re: How to trigger a new dialogue sequence when the player revisits an NPC?
You can do it by using variable.
In the Script field of "Stay if you..." entry, put something like Variable["visited_weaver_once"] = true
Then in the Condition field of "Perhaps I can...", put Variable["visited_weaver_once"] == true
And in Condition field of "May this be...", put Variable["visited_weaver_once"] == false
In the Script field of "Stay if you..." entry, put something like Variable["visited_weaver_once"] = true
Then in the Condition field of "Perhaps I can...", put Variable["visited_weaver_once"] == true
And in Condition field of "May this be...", put Variable["visited_weaver_once"] == false
Re: How to trigger a new dialogue sequence when the player revisits an NPC?
DragoonHP said it perfectly. I wish this forum software had a "like" button.
If you're a visual learner, you can watch the related tutorial.
BTW, use the "..." button to choose variables from dropdown menus. You don't have to manually type Variable["visited_weaver_once"] = true, although you can if you prefer.
In a big project, variables can pile up quickly. One way to organize them is to put some identifying info at the front of the name, such as "Weaver.visited". (Example: Variable["Weaver.visited"] = true) This way you can have variables such as:
Alternatively, you can add these as custom fields to each actor. So the Weaver actor could have custom fields "visited", "insulted", etc. It keeps the variables list shorter. But personally I like to be able to see all of the variables in one place for a clear overview of the whole game.
If you're a visual learner, you can watch the related tutorial.
BTW, use the "..." button to choose variables from dropdown menus. You don't have to manually type Variable["visited_weaver_once"] = true, although you can if you prefer.
In a big project, variables can pile up quickly. One way to organize them is to put some identifying info at the front of the name, such as "Weaver.visited". (Example: Variable["Weaver.visited"] = true) This way you can have variables such as:
- Weaver.visited
- Baker.visited
- Farmer.visited, etc.
Alternatively, you can add these as custom fields to each actor. So the Weaver actor could have custom fields "visited", "insulted", etc. It keeps the variables list shorter. But personally I like to be able to see all of the variables in one place for a clear overview of the whole game.