Game Development Community

Is it possible to change datablock of a vehicle at runtime?

by Corin · in Torque Game Engine · 12/20/2005 (12:40 pm) · 2 replies


#1
12/20/2005 (12:40 pm)
2 - Yes, you can change vars set in the datablock at any time. %obj.var = newsetting.
#2
12/20/2005 (1:50 pm)
Yes, but you generally shouldn't. Datablocks provide a template for instances of an object. So you have your WheeledVehicleData (the datablock) and your WheeledVehicle (the object). Datablocks never exist in the game, your vehicle is always an object. If there will ever be more than one instance of your object, you never want to change the datablock values, because all instances of the object will change.

Weren't you the person trying to link a vehicle to a real input device like a bike? If that were the case, you would want to go into the engine, and directly link the vehicle values to the data you get to the device. The datablock values are settings for the acceleration, maxspeed, etc. I would figure you would want to have your vehicles mimic the bike input, instead of using it to operate the vehicles like a user. Of course I could just be remembering something crazy and that has nothing to do with what you want.