Game Development Community

Changing variables in datablocks

by Jeff Trier · in Torque Game Engine · 03/22/2003 (9:49 pm) · 2 replies

Hi all,

I have created a variable in DataBlock PlayerData called "IsSelected". How can I change this variable?

In the code below, %obj is defined from "%obj = ContainerRayCast (%startPoint, %endPoint, %searchMasks, %player);", and is working great, but IsSelected always echo's "0".

%obj.IsSelected = 1; // Tag Object as selected
echo(%obj.getDataBlock().IsSelected);

Is this the method I should use to change a variable that lies within an objects DataBlock?


Thanks,
-Jeff

About the author

Originally a Classical/Metal musician, I've always been attracted to anything involving computers, including: Networking, PC Building and Repair, software design and coding. I've been involved with game design and development for over 10 years.


#1
03/23/2003 (12:30 am)
Welll you're changing the value of IsSelected on an instance of a datablock, then checking the value of the base datablock....

%obj.IsSelected = 1; // Tag Object as 
selectedecho(%obj.IsSelected);

Should be the correct way to check
#2
03/23/2003 (5:29 am)
Ahh, thanks Harold!


-Jeff