Game Development Community

SimSet Problem

by Paul Drust · in Torque Game Builder · 11/18/2008 (7:35 am) · 2 replies

I am trying to use a SimSet to track all the objects I create using CloneWithBehavior.

I create the SimSet in StartGame like this...

function startGame(%level)
{
...
$GameLevel = %level;
...
$GameLevel.BubbleList = new SimSet();
...
}


When I try and manipulate the SimSet using the "Add" method, "ListObject", etc. from other methods I get funky errors that it is trying to execute the method on a WAV file!

EX: %tempCount = $GameLevel.BubbleList.GetCount();

Maybe referencing the level as a global variable like I'm doing is the problem, but I have no idea.

Help Mr. Wizard!

#1
11/18/2008 (3:49 pm)
Do you ever close that level? If so, the object is destroyed. You can just have "$GameLevel" as it's own global variable that never disappears. I do that myself for the level, the player, objects that I need to be globabl during the game.

So, just have:

$GameLevel = new ScriptObject();

$GameLevel.BubbleList = new SimSet();

And see what happens.
#2
11/18/2008 (4:05 pm)
Nikos,

Thanks for the reply. And no, I never close the level.

I will try assigning $GameLevel as you suggest.

Thanks alot!