View Single Post
  #5  
Old 07-26-2008, 04:44 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
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
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
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)) 
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto

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