Is the a pointer to an object in TorqueScript?
by Andy Hawkins · in Technical Issues · 09/02/2006 (6:39 pm) · 1 replies
I have a bunch of objects like this...
However I also have a bunch of objects like this...
I would like to retain this separation but sometimes I would like to access this data in a more generalised form.
I want to do something like this....
then I want to do this...
Torque doesn't like this because I would have to set %obj to an explicit memory address right, like %obj = MyObject$[value]? Or is there a way do it with out explicitely stating the array element when %obj is defined / assigned?
$MyObject[10]
However I also have a bunch of objects like this...
$MyOtherObject[10]
I would like to retain this separation but sometimes I would like to access this data in a more generalised form.
I want to do something like this....
switch(type)
{
case 1:
%obj = $MyOtherObject; // notice no array
case 2:
%obj = $MyObject; // no array again
}then I want to do this...
for (%i = 0; %i < 10; %i ++)
{
// do something
%obj[%i] += 1; // notice I am using the array this time
//- but this isn't legal right?
}Torque doesn't like this because I would have to set %obj to an explicit memory address right, like %obj = MyObject$[value]? Or is there a way do it with out explicitely stating the array element when %obj is defined / assigned?
Torque Owner Paul /*Wedge*/ DElia
Really you should probably just be using Simsets.