Author Topic: Tampering with Vehicle Speed  (Read 876 times)

Is there a way that I can adjust the speed of vehicles without messing with their datablocks? I want to be able to change their speeds based on a couple variables. I tried redefining WheeledVehicle::setVelocity, but I found out that that function is not called when a player is driving a vehicle. What function is called when a player drives a vehicle?

There is no such function. All of that is handled in the engine. The best way is definitely through the datablock. Why don't you want to do that? What are you trying to do?

There is no such function. All of that is handled in the engine. The best way is definitely through the datablock. Why don't you want to do that? What are you trying to do?
I want to multiply the speed of a vehicle by a variable that changes throughout gameplay. I don't want to change the data blocks, because I want it to work with all vehicles without any extra modification. I guess that this is impossible, though. Thanks for your reply.

Welcome to Torque.

There is no support for this.

The only way to do this sort of thing would be to change the datablock, then transmitDatablocks(), however this can crash some clients.

The other solution is to have a group of datablocks that you rotate through players, but it really bloats the datablock pool and should only be used in private mods.

The only way to do this sort of thing would be to change the datablock, then transmitDatablocks(), however this can crash some clients.
this only depends on the value of the datablock you're changing, i think