mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
add a controlmap entry
for players, vehicles, and turret datablocks add a client command to setMovemap(%object.getDatablock().controlMap)
This commit is contained in:
parent
a996c09b04
commit
5b2c0c7703
8 changed files with 32 additions and 3 deletions
|
|
@ -460,6 +460,7 @@ PlayerData::PlayerData()
|
||||||
jumpTowardsNormal = true;
|
jumpTowardsNormal = true;
|
||||||
|
|
||||||
physicsPlayerType = StringTable->EmptyString();
|
physicsPlayerType = StringTable->EmptyString();
|
||||||
|
mControlMap = StringTable->EmptyString();
|
||||||
|
|
||||||
dMemset( actionList, 0, sizeof(actionList) );
|
dMemset( actionList, 0, sizeof(actionList) );
|
||||||
}
|
}
|
||||||
|
|
@ -739,6 +740,8 @@ void PlayerData::initPersistFields()
|
||||||
endGroup( "Camera" );
|
endGroup( "Camera" );
|
||||||
|
|
||||||
addGroup( "Movement" );
|
addGroup( "Movement" );
|
||||||
|
addField("controlMap", TypeString, Offset(mControlMap, PlayerData),
|
||||||
|
"@brief movemap used by these types of objects.\n\n");
|
||||||
|
|
||||||
addFieldV( "maxStepHeight", TypeRangedF32, Offset(maxStepHeight, PlayerData), &CommonValidators::PositiveFloat,
|
addFieldV( "maxStepHeight", TypeRangedF32, Offset(maxStepHeight, PlayerData), &CommonValidators::PositiveFloat,
|
||||||
"@brief Maximum height the player can step up.\n\n"
|
"@brief Maximum height the player can step up.\n\n"
|
||||||
|
|
|
||||||
|
|
@ -346,7 +346,7 @@ struct PlayerData: public ShapeBaseData {
|
||||||
|
|
||||||
// Jump off surfaces at their normal rather than straight up
|
// Jump off surfaces at their normal rather than straight up
|
||||||
bool jumpTowardsNormal;
|
bool jumpTowardsNormal;
|
||||||
|
StringTableEntry mControlMap;
|
||||||
// For use if/when mPhysicsPlayer is created
|
// For use if/when mPhysicsPlayer is created
|
||||||
StringTableEntry physicsPlayerType;
|
StringTableEntry physicsPlayerType;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ TurretShapeData::TurretShapeData()
|
||||||
recoilSequence[i] = -1;
|
recoilSequence[i] = -1;
|
||||||
pitchSequence = -1;
|
pitchSequence = -1;
|
||||||
headingSequence = -1;
|
headingSequence = -1;
|
||||||
|
mControlMap = StringTable->EmptyString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TurretShapeData::initPersistFields()
|
void TurretShapeData::initPersistFields()
|
||||||
|
|
@ -134,6 +135,8 @@ void TurretShapeData::initPersistFields()
|
||||||
docsURL;
|
docsURL;
|
||||||
Parent::initPersistFields();
|
Parent::initPersistFields();
|
||||||
addGroup("Steering");
|
addGroup("Steering");
|
||||||
|
addField("controlMap", TypeString, Offset(mControlMap, TurretShapeData),
|
||||||
|
"@brief movemap used by these types of objects.\n\n");
|
||||||
addField("zRotOnly", TypeBool, Offset(zRotOnly, TurretShapeData),
|
addField("zRotOnly", TypeBool, Offset(zRotOnly, TurretShapeData),
|
||||||
"@brief Should the turret allow only z rotations.\n\n"
|
"@brief Should the turret allow only z rotations.\n\n"
|
||||||
"True indicates that the turret may only be rotated on its z axis, just like the Item class. "
|
"True indicates that the turret may only be rotated on its z axis, just like the Item class. "
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@ public:
|
||||||
bool startLoaded; ///< Should the turret's mounted weapon(s) start in a loaded state?
|
bool startLoaded; ///< Should the turret's mounted weapon(s) start in a loaded state?
|
||||||
|
|
||||||
bool zRotOnly; ///< Should the turret allow only z rotations (like an item)?
|
bool zRotOnly; ///< Should the turret allow only z rotations (like an item)?
|
||||||
|
StringTableEntry mControlMap;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TurretShapeData();
|
TurretShapeData();
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,7 @@ VehicleData::VehicleData()
|
||||||
dMemset( damageEmitterOffset, 0, sizeof( damageEmitterOffset ) );
|
dMemset( damageEmitterOffset, 0, sizeof( damageEmitterOffset ) );
|
||||||
dMemset( damageEmitterIDList, 0, sizeof( damageEmitterIDList ) );
|
dMemset( damageEmitterIDList, 0, sizeof( damageEmitterIDList ) );
|
||||||
dMemset( damageLevelTolerance, 0, sizeof( damageLevelTolerance ) );
|
dMemset( damageLevelTolerance, 0, sizeof( damageLevelTolerance ) );
|
||||||
|
mControlMap = StringTable->EmptyString();
|
||||||
|
|
||||||
numDmgEmitterAreas = 0;
|
numDmgEmitterAreas = 0;
|
||||||
|
|
||||||
|
|
@ -321,6 +322,8 @@ void VehicleData::initPersistFields()
|
||||||
endGroup("Collision");
|
endGroup("Collision");
|
||||||
|
|
||||||
addGroup("Steering");
|
addGroup("Steering");
|
||||||
|
addField("controlMap", TypeString, Offset(mControlMap, VehicleData),
|
||||||
|
"@brief movemap used by these types of objects.\n\n");
|
||||||
addFieldV( "jetForce", TypeRangedF32, Offset(jetForce, VehicleData), &CommonValidators::PositiveFloat,
|
addFieldV( "jetForce", TypeRangedF32, Offset(jetForce, VehicleData), &CommonValidators::PositiveFloat,
|
||||||
"@brief Additional force applied to the vehicle when it is jetting.\n\n"
|
"@brief Additional force applied to the vehicle when it is jetting.\n\n"
|
||||||
"For WheeledVehicles, the force is applied in the forward direction. For "
|
"For WheeledVehicles, the force is applied in the forward direction. For "
|
||||||
|
|
@ -726,6 +729,9 @@ void Vehicle::updateMove(const Move* move)
|
||||||
if (mDamageState == Enabled) {
|
if (mDamageState == Enabled) {
|
||||||
setImageTriggerState(0,move->trigger[0]);
|
setImageTriggerState(0,move->trigger[0]);
|
||||||
setImageTriggerState(1,move->trigger[1]);
|
setImageTriggerState(1,move->trigger[1]);
|
||||||
|
//legacy code has trigger 2 and 3 reserved
|
||||||
|
setImageTriggerState(2, move->trigger[4]);
|
||||||
|
setImageTriggerState(3, move->trigger[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Throttle
|
// Throttle
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ struct VehicleData : public RigidShapeData
|
||||||
F32 damageLevelTolerance[ VC_NUM_DAMAGE_LEVELS ];
|
F32 damageLevelTolerance[ VC_NUM_DAMAGE_LEVELS ];
|
||||||
F32 numDmgEmitterAreas;
|
F32 numDmgEmitterAreas;
|
||||||
|
|
||||||
|
StringTableEntry mControlMap;
|
||||||
bool enablePhysicsRep;
|
bool enablePhysicsRep;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -158,3 +158,16 @@ function disconnectedCleanup()
|
||||||
|
|
||||||
moduleExec("onDestroyClientConnection", "Game");
|
moduleExec("onDestroyClientConnection", "Game");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clientCmdsetMoveMap(%movemap)
|
||||||
|
{
|
||||||
|
if (!isObject(%movemap)) return;
|
||||||
|
if(isObject(ServerConnection) && isObject(ServerConnection.curMoveMap))
|
||||||
|
ServerConnection.curMoveMap.pop();
|
||||||
|
|
||||||
|
// clear movement
|
||||||
|
$mvForwardAction = 0;
|
||||||
|
$mvBackwardAction = 0;
|
||||||
|
%movemap.push();
|
||||||
|
ServerConnection.curMoveMap = %movemap;
|
||||||
|
}
|
||||||
|
|
@ -276,6 +276,8 @@ function GameConnection::onPostSpawn( %this )
|
||||||
callOnObjectList("onPostSpawn", %modulesIdList, %this);
|
callOnObjectList("onPostSpawn", %modulesIdList, %this);
|
||||||
else
|
else
|
||||||
%this.listener.onPostSpawnComplete(%this);
|
%this.listener.onPostSpawnComplete(%this);
|
||||||
|
if (isObject(%this.player.getDatablock().controlMap))
|
||||||
|
commandToClient(%this, 'setMoveMap', %this.player.getDatablock().controlMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
function GameConnectionListener::onPostSpawnComplete(%this, %client)
|
function GameConnectionListener::onPostSpawnComplete(%this, %client)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue