Situation is this:
I'm making a game which starts as a text adventure and sort of morphs into a graphical adventure. As such, it would be really nice to have all kind of shortcut functions to throw into the script, as text adventures naturally have many repeating elements.
Global script has this before the game start function:
function repeat1()
{
Lbox1.AddItem("");
aDoorbell.Play(eAudioPriorityHigh, eOnce);
Lbox1.AddItem("The doorbell rings again.");
Lbox1.AddItem("What did you do?");
}
Room code has this:
else if (Parser.Said("look television"))
{
Lbox1.Clear();
Lbox1.AddItem("Your eyes begin to glaze over...");
repeat1();
}
Getting undefined token error when trying to call this function in the room. I know this must be something incredibly basic, but I'm completely stumped. This is the exact syntax I've used in other games without any issue.
You need to declare the functions you want to use in other modules in the script header:
import function repeat1();
*Facepalm* -- of course I do.
Too much Lua, eh? :tongue:
Thank you very much for the help. I appreciate it.