I've encountered a similar issue.
PHP Code:
function onCreated()
{
funcOne();
}
public function funcOne()
{
temp.foo = new TStaticVar();
temp.foo.funcTwo = function() {
echo("bar");
};
temp.foo.funcTwo();
}
Echoes "bar" successfully.
However, if I want to trigger the function in this NPC on another object using with (obj)...
PHP Code:
function onCreated()
{
// Replace 'obj' with one of the following:
// findPlayer("accountname")
// findNPC("npcname")
with (obj) funcOne();
}
public function funcOne()
{
temp.foo = new TStaticVar();
temp.foo.funcTwo = function() {
echo("bar");
};
temp.foo.funcTwo();
}
I get this error message on RC instead:
PHP Code:
Script: Function unknown_object.funcTwo not found at line 71 in script of DEBUG (in level onlinestartlocal.nw at pos (30.5, 30))