Scripting with Dialogue System Variables
Posted: Wed May 19, 2021 11:45 am
Hello <3
I just had a few clarification questions for using the Dialogue System classes/namespaces in scripting.
1) Do I need to/can I include something in the 'using' area of a script? Such as Using PixelCrushers.DialogueSystem.
2) When referring to a variable set up in the Dialogue Manager in a C# script, what's the best practice? Is it PixelCrushers.DialogueSystem.DialogueLua.GetVariable("variable"), and would I still need all of that if the pixelcrushers.dialguesystem is in the using scetion? Or could I just use DialogueLua.GetVariable("name")?
3) Do we need to clarify .asString or .asInt for each variable? What if it's a bool?
4) Are the actors listed in the manager a class? And can we call upon the class in scripts? Is there a way to assign a variable to an actor?
The process I'm trying to set up is an image appearing when certain variables are met.
I'm trying to, basically, build something like this:
Sorry for the long list of questions, hopefully they make sense and aren't super complicated to answer <3 Thank you for your time and help again!
I just had a few clarification questions for using the Dialogue System classes/namespaces in scripting.
1) Do I need to/can I include something in the 'using' area of a script? Such as Using PixelCrushers.DialogueSystem.
2) When referring to a variable set up in the Dialogue Manager in a C# script, what's the best practice? Is it PixelCrushers.DialogueSystem.DialogueLua.GetVariable("variable"), and would I still need all of that if the pixelcrushers.dialguesystem is in the using scetion? Or could I just use DialogueLua.GetVariable("name")?
3) Do we need to clarify .asString or .asInt for each variable? What if it's a bool?
4) Are the actors listed in the manager a class? And can we call upon the class in scripts? Is there a way to assign a variable to an actor?
The process I'm trying to set up is an image appearing when certain variables are met.
I'm trying to, basically, build something like this:
Code: Select all
public GameObject alertnotif;
int RelLvl;
int TalkLvl;
void Start()
{
//Not sure how to grab the class/list of actors
var NPC = (whatever I would put to grab the list of actors)
//not sure how to get the variable to relate to specific actors either
foreach (Actor in NPC)
{RelLvl = PixelCrushers.DialogueSystem.DialogueLua.GetVariable("npcnameRelLvl").asInt;
TalkLvl = PixelCrushers.DialogueSystem.DialogueLua.GetVariable("npcnameTalkLvl").asInt;
if(TalkLvl * 10 + 1 > RelLvl)
{alertnotif.SetActive(true);}
}
}