Hello!
As title says, i'd like to know a way to access the variables (numbers and booleans) set in the dialogue database.
My approach to branching dialogue that affects the world outside is to have the bulk of the checks and conditions happening within the comfy dialogue manager system, with a large, "End of day" C#script that checks some of the variables for more complex stuff such as spawning objects and altering variables outside of the database.
I know it has a simple solution, but as a very amateurish coder i still prefer to have a direct answer to avoid banging my head on a brick wall for hours.
Thanks a lot!
Noob question - accessing database variables with C# scripts
-
- Posts: 8
- Joined: Sun Jan 19, 2025 11:26 am
Re: Noob question - accessing database variables with C# scripts
Hi,
Use the DialogueLua class. Examples:
Use the DialogueLua class. Examples:
Code: Select all
using PixelCrushers.DialogueSystem;
...
DialogueLua.SetVariable("Score", 7);
DialogueLua.SetVariable("FoundSecretEntrance", true);
bool hasTheMaguffin = DialogueLua.GetVariable("HasMaguffin").asBool;
int health = DialogueLua.GetVariable("Health").asInt;