Try changing the Sequence to:
Code: Select all
WalkToPoint(Owen, 1, 4, true);
SetDialoguePanel(false);
required SetDialoguePanel(true)@Message(FinishedWalking);
Continue()@Message(FinishedWalking)
Code: Select all
WalkToPoint(Owen, 1, 4, true);
SetDialoguePanel(false);
required SetDialoguePanel(true)@Message(FinishedWalking);
Continue()@Message(FinishedWalking)
Code: Select all
foreach (InventoryObjectTemplate item in inventory.inventoryList) //look through the player inventory
{
if (item != null && item.objectID == itemToFind) //if there is an item that this quest needs
{
if (item.numberOfObjects >= amountRequired)
{
XXXXX
Stop();
}
}
}
Stop();
Code: Select all
Actor["Perisher"].HasSpoken = true
In the Dialogue Editor, the actor variables are in the Actors tab, inside the actor's All Fields foldout.Mackerel_Sky wrote: ↑Thu Jan 09, 2020 4:40 amOn another note, I've somehow forgotten where the Actor variables are and can't seem to find them again. Do you know where I could access them? They look like this:
Code: Select all
Actor["Perisher"].HasSpoken = true
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class MyLuaFunctions : MonoBehaviour
{
PlayerInventory inventory;
// double itemToFind; //Lua refers to ints as doubles
// double amountRequired;
void OnEnable()
{
Lua.RegisterFunction("CheckForItem", this, SymbolExtensions.GetMethodInfo(() => CheckForItem(0,0)));
}
void OnDisable()
{
// Note: If this script is on your Dialogue Manager & the Dialogue Manager is configured
// as Don't Destroy On Load (on by default), don't unregister Lua functions.
// Lua.UnregisterFunction("GameObjectExists"); // <-- Only if not on Dialogue Manager.
}
public bool CheckForItem(double itemToFind, double amountRequired)
{
foreach (InventoryObjectTemplate item in inventory.inventoryList) //look through the player inventory
{
if (item ~= null && item.objectID == itemToFind) //if there is an item that this quest needs
{
if (item.numberOfObjects >= amountRequired)
{
return true;
}
}
}
return false;
}
}
Code: Select all
CheckForItem(0,0))
Code: Select all
CheckForItem((double)0,(double)0))
It should look like a normal script, albeit one without any fields in the inspector since there aren't any public variables in the script. Make sure the class name (MyLuaFunctions) exactly matches the script filename.Mackerel_Sky wrote: ↑Fri Jan 10, 2020 7:08 amWhen I try to drag it onto the dialogue manager game object it doesn't get added like a normal script.