Blockland Forums > Modification Help

Script Object Help

Pages: (1/1)

DYLANzzz:


--- Code: ---function createController()
{
return new ScriptObject()
{
class="Controller";
time=0;
status=0;
peopleQueue=new SimSet();
people=new SimSet();
              };
}
$RW::Controller=createController();
--- End code ---

For some reason it will return one of the new simSets I created and not the Script Object itself. Anyone know why this is happening?

otto-san:


--- Code: ---function createController()
{
%so = new ScriptObject()
{
class="Controller";
time=0;
status=0;
peopleQueue=new SimSet();
people=new SimSet();
        };
        return %so;
}
$RW::Controller=createController();
--- End code ---

try that instead

DYLANzzz:

Didn't work.

But I think I found the solution.

--- Code: ---function createController()
{
     %j = new ScriptObject()
     {
          class="Controller";
          time=0;
          status=0;
     };
     %j.peopleQueue=new SimSet();
     %j.people=new SimSet();             
     return %j;
}
$RW::Controller=createController();
--- End code ---


Pages: (1/1)

Go to full version