Updating Dialogue Text by retrieving Variables from a Scriptable Object Database
Posted: Mon Feb 08, 2016 1:57 pm
Here's what I'd like to do:
Problem 1:
I have a text that reads: "You seem to have X gold coins with you. Did you talk to your associates A, B, C and D about getting a loan?"
Now what I want to do is fill in X, A, B, C and D with respective variables from my Scriptable Object Database. I don't want to use any of the Quest, Item, Location etc. stuff that comes with the system because they don't seem like what I need and I can't seem to find a comfortable way of editing them through code(Maybe I'm missing info on this? help!). My database is of a certain shape and is accessible by code since it's a singleton but I don't know how to access it via the Lua commands.
I just need a method that says: UpdatePartOfText(string remove, string replace).
Problem 2:
I want to present replies depending on my database as well. For example let's say after asking "You seem to have X gold coins with you. Did you talk to your associates A, B, C and D about getting a loan?" I want to put possible answers as the following:
- I talked to A.
- I talked to B.
- I talked to C.
- I talked to D.
So if there was a 5th guy in my database I would add -I talked to E as another option.
Could someone kindly guide me in the right direction?
TL;DR
-How do I update Dialogue Text in a Node of a Conversation of a Dialogue Database (Jesus...)?
-How do I update the aforementioned text with a database of my own making or through variables I save in other instances of classes?\
-Heeeeeeeeeeeeeeeeeeeeeeelp!
Problem 1:
I have a text that reads: "You seem to have X gold coins with you. Did you talk to your associates A, B, C and D about getting a loan?"
Now what I want to do is fill in X, A, B, C and D with respective variables from my Scriptable Object Database. I don't want to use any of the Quest, Item, Location etc. stuff that comes with the system because they don't seem like what I need and I can't seem to find a comfortable way of editing them through code(Maybe I'm missing info on this? help!). My database is of a certain shape and is accessible by code since it's a singleton but I don't know how to access it via the Lua commands.
I just need a method that says: UpdatePartOfText(string remove, string replace).
Problem 2:
I want to present replies depending on my database as well. For example let's say after asking "You seem to have X gold coins with you. Did you talk to your associates A, B, C and D about getting a loan?" I want to put possible answers as the following:
- I talked to A.
- I talked to B.
- I talked to C.
- I talked to D.
So if there was a 5th guy in my database I would add -I talked to E as another option.
Could someone kindly guide me in the right direction?
TL;DR
-How do I update Dialogue Text in a Node of a Conversation of a Dialogue Database (Jesus...)?
-How do I update the aforementioned text with a database of my own making or through variables I save in other instances of classes?\
-Heeeeeeeeeeeeeeeeeeeeeeelp!