Two small questions.
1. How output Lua variable name and value in Dialogue text field?
2. On what event it is possible to make something for certain Dialogue Entry ID? Something like OnConversationStart.
For an example to receive a variable from C#, to process it in Lua and to return back to C#.
[SOLVED]How output variable value in Dialogue text field?
[SOLVED]How output variable value in Dialogue text field?
Last edited by Evgeny on Fri Apr 08, 2016 12:59 pm, edited 1 time in total.
Re: How output variable value in Dialogue text field?
Hi,
Another way is to add a script that has an OnConversationLine method.
For a Dialogue System variable -- that is, defined on the Variables tab of the Dialogue Editor and as Variable["varName"] in Lua -- use the [var=varName] markup tag:Evgeny wrote:1. How output Lua variable name and value in Dialogue text field?
- Dialogue Text: "Hi, my name is [var=Conversant]."
- Dialogue Text: "Next year I will be [lua( Actor["Fred"].Age + 1 )] years old."
Register your C# function with Lua. Then you can use it anywhere in Lua, such as the Dialogue Text or Script fields of your dialogue entry. For example:Evgeny wrote:2. On what event it is possible to make something for certain Dialogue Entry ID? Something like OnConversationStart.
For an example to receive a variable from C#, to process it in Lua and to return back to C#.
- Dialogue Text: "Take this gold."
- Script: GivePlayerGold(50)
Code: Select all
Lua.RegisterFunction("GivePlayerGold", this, typeof(MyLuaFunctions).GetMethod("GivePlayerGold"));
public void GivePlayerGold(double amount) {
playerInventory.gold += (int) amount;
}
Re: [SOLVED]How output variable value in Dialogue text field?
BiG ThNX!!
All works fine!
All works fine!
Re: [SOLVED]How output variable value in Dialogue text field?
Great! Glad I could help.