Author Topic: Script Object Help  (Read 433 times)

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

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?

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

try that instead

Didn't work.

But I think I found the solution.
Code: [Select]
function createController()
{
     %j = new ScriptObject()
     {
          class="Controller";
          time=0;
          status=0;
     };
     %j.peopleQueue=new SimSet();
     %j.people=new SimSet();             
     return %j;
}
$RW::Controller=createController();