Game Development Community

Override ItemData dynamic variables?

by Mike Stoddart · in Torque Game Engine · 06/05/2002 (10:34 am) · 1 replies

I have a new object in my world that will serve as a mission objective, of which there will be up to 5. I have defined the ItemData in objective.cs as:

datablock ItemData(Objective)
{
   category = "Objective";
   shapeFile = "~/data/shapes/objectives/flag2.dts";
   mass = 1;
   friction = 1;
   elasticity = 0.3;
   // Dynamic properties defined by the scripts
   objectiveName = "Flag";
   objectiveNumber = 0;
   ownedBy = 0;
};

I've added two such objectives into my mission file. I want to override the dynamic variables in the mission file to give something like the following:

objectiveName = "the Red Teams flag";
objectiveNumber = "2";

But this doesn't work; the defaults of "Flag" and "0" are used instead.

Is what I'm trying to do possible? This gives me the greatest flexibility and involves no code changes, which makes it even more attractive.

Thanks

#1
06/05/2002 (10:50 am)
Yet again I answer my own question: the %obj variable in the onCollision function inside objective.cs contains the overridden variables.