Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by fr0zi

  1. WOW! That's amazing :D Can't wait to test it :) It looks awesomely.
  2. Ok, thanks guys :) I tried with the serverCmd() and it worked. Therefore I think I will use that. Thanks for help!
  3. Thanks, chriscalef. I will give it a try.
  4. Hello guys, I'd like to use Torque 3D to some vehicle simulation game. For that I need to add some new functions to Wheeled Vehicle class, for example - gearbox. I'm thinking to add new datablock with gearbox parameters and new methods to WheeledVehicle class in C++ source code. So I have created this in wheeledVehicle.h: struct WheeledVehicleGearbox: public SimDataBlock { typedef SimDataBlock Parent; U32 gearCount; // number of gears in gearbox ... WheeledVehicleGearbox(); DECLARE_CONOBJECT(WheeledVehicleGearbox); static void initPersistFields(); virtual void packData(BitStream* stream); virtual void unpackData(BitStream* stream); }; and in wheeledVehicle.cpp I have added: IMPLEMENT_CO_DATABLOCK_V1(WheeledVehicleGearbox); ConsoleDocClass( WheeledVehicleGearbox, "@brief Defines the properties of a WheeledVehicle gearbox.\n\n" "@ingroup Vehicles\n" ); void WheeledVehicleGearbox::initPersistFields() { addField( "gearCount", TypeS32, Offset(gearCount, WheeledVehicleGearbox), "@brief Number of gears in the gearbox.\n\n" "Number of gears in the gearbox." ); Parent::initPersistFields(); } in WheeledVehicle class implementation I have added void shiftUp(); void shiftDown(); and at the end of the wheeledVehicle.cpp DefineEngineMethod( WheeledVehicle, shiftUp, bool, (),, "@brief Shift gear up.\n" "@return true if successful, false if failed\n\n" ) { object->shiftUp(); return true; } DefineEngineMethod( WheeledVehicle, shiftDown, bool, (),, "@brief Shift gear down.\n" "@return true if successful, false if failed\n\n" ) { object->shiftDown(); return true; } Now my question is - how can I bind those functions to a key in default.bind.cs so I can switch gears with keyboard? Should I create "serverCmd..." for them in scripts? But I think shifting gear in a vehicle is irrelevant for server and should be done only on client. Isn't it? I'm little confused here :) Maybe someone can give me some advise here?
  • Create New...