Game Development Community

Need Help Changing Armor DataBlock

by Hunter Luisi · in Torque Game Engine · 08/29/2001 (6:27 pm) · 3 replies

I'm trying to change the way a player moves when entering water, but when I change the armor datablock the player movement gets jerky when jetting. It looks like the jet direction is doing a 180 every 1 or 2 seconds.

Heres what I'm trying:

function Armor::onEnterLiquid(%data, %obj, %coverage, %type)
{
   %test = %obj.getDataBlock();
   %obj.oldHRF = %test.horizResistFactor;
   %test.horizResistFactor = ( 0.3 );
   %obj.setDataBlock( %test ); // is this even needed???
   echo ( "Test to see if changed horizResistFactor: " @ %obj.getDataBlock().horizResistFactor );

................

About the author

Recent Threads


#1
08/29/2001 (8:42 pm)
The datablocks are not designed to be updated on the fly. Datablocks properties are only synchonized between client and server at connect time and between missions. If you change a value on the server the client won't be notified until the next mission load. If the change affects the motion of the player, then the client and server will get out of sync which will cause jerking motion you mention.

The simplest way to make the player's behavior change in the water would be to extend the player's movement code to support it directly.
#2
08/29/2001 (8:45 pm)
Tim,
Thanks for your help. Umm... Where might I find the player movement code? :D
#3
08/30/2001 (1:19 am)
engine/game/player.cc

Starting at line 1528 -

void Player::updateMove(const Move* move)