I've been working with the Pixel Crushers Dialogue System and am having trouble integrating it with other scripts in my project. Specifically, I need to have a Dialogue Condition based on what a variable in a C# script is set to. This is so I may have the Dialogue System work with my inventory code.
Example: A dialogue option only being available if the booleon "KnifeObtained" is set to true.
Alternatively, if there was a way for me to change the variables in the Dialogue Database via a script, that would also work
Interaction with other scripts
Re: Interaction with other scripts
Hi,
Then register it with Lua (tutorial) so you can check it in your dialogue entry nodes' Conditions fields.
Write a C# method to get the valud of KnifeObtained:CaseyJarmes wrote: ↑Fri Feb 11, 2022 3:49 pmI've been working with the Pixel Crushers Dialogue System and am having trouble integrating it with other scripts in my project. Specifically, I need to have a Dialogue Condition based on what a variable in a C# script is set to. This is so I may have the Dialogue System work with my inventory code.
Example: A dialogue option only being available if the booleon "KnifeObtained" is set to true.
Code: Select all
bool IsKnifeObtained() { return KnifeObtained; }
Use DialogueLua:CaseyJarmes wrote: ↑Fri Feb 11, 2022 3:49 pmAlternatively, if there was a way for me to change the variables in the Dialogue Database via a script, that would also work
Code: Select all
DialogueLua.SetVariable("KnifeObtained", true);
-
- Posts: 4
- Joined: Fri Feb 11, 2022 3:41 pm
Re: Interaction with other scripts
Thanks, this'll help a lot
Re: Interaction with other scripts
Happy to help!