View Single Post
  #5  
Old 07-26-2008, 04:44 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
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 (objfuncOne();
}

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.530)) 
__________________
Follow my work on social media post-Graal:Updated august 2025.

Last edited by xXziroXx; 07-26-2008 at 04:46 AM.. Reason: Uncensor S T F U please, can't even type "test" followed by "func"...
Reply With Quote