Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Engine/source/T3D/shapeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ ShapeBaseData::ShapeBaseData()
density( 1.0f ),
maxEnergy( 0.0f ),
maxDamage( 1.0f ),
mCollisionMul(0.0f),
mImpactMul(0.0f),
repairRate( 0.0033f ),
disabledLevel( 1.0f ),
destroyedLevel( 1.0f ),
Expand Down Expand Up @@ -229,6 +231,8 @@ ShapeBaseData::ShapeBaseData(const ShapeBaseData& other, bool temp_clone) : Game
density = other.density;
maxEnergy = other.maxEnergy;
maxDamage = other.maxDamage;
mCollisionMul = other.mCollisionMul;
mImpactMul = other.mImpactMul;
repairRate = other.repairRate;
disabledLevel = other.disabledLevel;
destroyedLevel = other.destroyedLevel;
Expand Down Expand Up @@ -585,6 +589,10 @@ void ShapeBaseData::initPersistFields()
addField( "isInvincible", TypeBool, Offset(isInvincible, ShapeBaseData),
"Invincible flag; when invincible, the object cannot be damaged or "
"repaired." );
addFieldV("collisionMul", TypeRangedF32, Offset(mCollisionMul, ShapeBaseData), &CommonValidators::PositiveFloat,
"collision damage multiplier");
addFieldV("impactMul", TypeRangedF32, Offset(mImpactMul, ShapeBaseData), &CommonValidators::PositiveFloat,
"impact damage multiplier");
endGroup( "Damage/Energy" );

addGroup( "Camera", "The settings used by the shape when it is the camera." );
Expand Down
2 changes: 2 additions & 0 deletions Engine/source/T3D/shapeBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@ struct ShapeBaseData : public GameBaseData {
F32 density;
F32 maxEnergy;
F32 maxDamage;
F32 mCollisionMul;
F32 mImpactMul;
F32 repairRate; ///< Rate per tick.

F32 disabledLevel;
Expand Down
11 changes: 11 additions & 0 deletions Templates/BaseGame/game/data/DamageModel/DamageModel.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<ModuleDefinition
ModuleId="DamageModel"
VersionId="1"
Group="Game"
scriptFile="DamageModel.tscript"
CreateFunction="onCreate"
DestroyFunction="onDestroy">
<DeclaredAssets
Extension="asset.taml"
Recurse="true"/>
</ModuleDefinition>
48 changes: 48 additions & 0 deletions Templates/BaseGame/game/data/DamageModel/DamageModel.tscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
function DamageModel::onCreate(%this)
{
}

function DamageModel::onDestroy(%this)
{
}

//This is called when the server is initially set up by the game application
function DamageModel::initServer(%this)
{
}

//This is called when the server is created for an actual game/map to be played
function DamageModel::onCreateGameServer(%this)
{
%this.registerDatablock("./scripts/managedData/managedParticleData");
%this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
%this.queueExec("./scripts/server/utility");
%this.queueExec("./scripts/server/radiusDamage");
%this.queueExec("./scripts/server/projectile");
%this.queueExec("./scripts/server/weapon");
%this.queueExec("./scripts/server/shapeBase");
%this.queueExec("./scripts/server/vehicle");
%this.queueExec("./scripts/server/player");
}

//This is called when the server is shut down due to the game/map being exited
function DamageModel::onDestroyGameServer(%this)
{
}

//This is called when the client is initially set up by the game application
function DamageModel::initClient(%this)
{
%this.queueExec("./guis/damageGuiOverlay.gui");
%this.queueExec("./scripts/client/playGui");
}

//This is called when a client connects to a server
function DamageModel::onCreateClientConnection(%this)
{
}

//This is called when a client disconnects from a server
function DamageModel::onDestroyClientConnection(%this)
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<GUIAsset canSave="true" canSaveDynamicFields="true" AssetName="damageGuiOverlay" scriptFile="@assetFile=damageGuiOverlay.gui" GUIFile="@assetFile=damageGuiOverlay.gui" VersionId="1"/>
285 changes: 285 additions & 0 deletions Templates/BaseGame/game/data/DamageModel/guis/damageGuiOverlay.gui
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
//--- OBJECT WRITE BEGIN ---
$guiContent = new GuiContainer(DamageGuiOverlay) {
isContainer = "1";
Profile = "GuiContentProfile";
HorizSizing = "relative";
VertSizing = "relative";
position = "0 0";
Extent = "1024 768";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "1";
Enabled = "1";
helpTag = "0";
noCursor = "1";
new GuiShapeNameHud() {
fillColor = "0 0 0 0.25";
frameColor = "0 1 0 1";
textColor = "0 1 0 1";
showFill = "0";
showFrame = "0";
verticalOffset = "0.2";
distanceFade = "0.1";
isContainer = "0";
Profile = "GuiModelessDialogProfile";
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
Extent = "1024 768";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
new GuiCrossHairHud(Reticle) {
damageFillColor = "0 1 0 1";
damageFrameColor = "1 0.6 0 1";
damageRect = "50 4";
damageOffset = "0 10";
bitmapAsset = "FPSEquipment:blank_image";
wrap = "0";
isContainer = "0";
Profile = "GuiModelessDialogProfile";
HorizSizing = "center";
VertSizing = "center";
position = "496 368";
Extent = "32 32";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
new GuiCrossHairHud(ZoomReticle) {
damageFillColor = "0 1 0 1";
damageFrameColor = "1 0.6 0 1";
damageRect = "50 4";
damageOffset = "0 10";
bitmapAsset = "DamageModel:bino_image";
wrap = "0";
isContainer = "0";
Profile = "GuiModelessDialogProfile";
HorizSizing = "width";
VertSizing = "height";
position = "0 0";
Extent = "1024 768";
MinExtent = "8 8";
canSave = "1";
Visible = "0";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
new GuiBitmapBorderCtrl(WeaponHUD) {
isContainer = "0";
Profile = "ChatHudBorderProfile";
HorizSizing = "right";
VertSizing = "top";
position = "78 693";
Extent = "124 72";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";

new GuiBitmapCtrl() {
bitmap = "UI:hudfill_image";
wrap = "0";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "width";
VertSizing = "height";
position = "8 8";
Extent = "108 56";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
new GuiBitmapCtrl(PreviewImage) {
bitmapAsset = "UI:hudfill_image";
wrap = "0";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "width";
VertSizing = "height";
position = "8 8";
Extent = "108 56";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(AmmoAmount) {
maxLength = "255";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "0";
AnchorBottom = "0";
AnchorLeft = "0";
AnchorRight = "0";
isContainer = "0";
Profile = "HudTextItalicProfile";
HorizSizing = "right";
VertSizing = "top";
position = "40 8";
Extent = "120 16";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
};
new GuiHealthTextHud() {
fillColor = "0 0 0 0.65";
frameColor = "0 0 0 1";
textColor = "1 1 1 1";
warningColor = "1 0 0 1";
showFill = "1";
showFrame = "1";
showTrueValue = "0";
showEnergy = "0";
warnThreshold = "25";
pulseThreshold = "15";
pulseRate = "750";
position = "5 693";
extent = "72 72";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "top";
profile = "GuiBigTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiControl(DamageHUD) {
position = "384 256";
extent = "256 256";
minExtent = "8 2";
horizSizing = "center";
vertSizing = "center";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";

new GuiBitmapCtrl(DamageFront) {
bitmapAsset = "DamageModel:damageFront_image";
wrap = "0";
position = "0 0";
extent = "256 32";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "0";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "Damage[Front]";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapCtrl(DamageTop) {
bitmapAsset = "DamageModel:damageTop_image";
wrap = "0";
position = "0 0";
extent = "256 32";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "0";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "Damage[Top]";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapCtrl(DamageBottom) {
bitmapAsset = "DamageModel:damageBottom_image";
wrap = "0";
position = "0 224";
extent = "256 32";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "0";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "Damage[Bottom]";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapCtrl(DamageLeft) {
bitmapAsset = "DamageModel:damageLeft_image";
wrap = "0";
position = "0 0";
extent = "32 256";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "0";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "Damage[Left]";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapCtrl(DamageRight) {
bitmapAsset = "DamageModel:damageRight_image";
wrap = "0";
position = "224 0";
extent = "32 256";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "0";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "Damage[Right]";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ImageAsset
AssetName="crosshair_blue_image"
imageFile="@assetFile=crosshair_blue.png"/>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ImageAsset
AssetName="damageBottom_image"
imageFile="@assetFile=damageBottom.png"/>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ImageAsset
AssetName="damageFront_image"
imageFile="@assetFile=damageFront.png"/>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading