Generic Damagemodel

included in root/data/ as a module so theres a generic folks can riff off of
additionally, includes a physcs based damage option inspector exposed augment for velicity based collisions, as well as utilities for applying damage to the object a given thing is mounted to
further. also fixes a lack of vehicles being able to use thier mvTriggerCount4 and 5 for the additional 2 mountpoints allowed
This commit is contained in:
AzaezelX 2025-04-06 16:09:14 -05:00
parent a996c09b04
commit 5cf54580e6
27 changed files with 1552 additions and 0 deletions

View file

@ -0,0 +1,53 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// PlayGui is the main TSControl through which the game is viewed.
// The PlayGui also contains the hud controls.
//-----------------------------------------------------------------------------
function DamageModel::Playgui_onWake(%this)
{
Canvas.pushDialog(DamageGuiOverlay);
}
function DamageModel::Playgui_onSleep(%this)
{
Canvas.popDialog(DamageGuiOverlay);
}
function DamageModel::Playgui_clearHud( %this )
{
Canvas.popDialog(DamageGuiOverlay);
}
function clientCmdSetDamageDirection(%direction)
{
%ctrl = DamageHUD.findObjectByInternalName("damage[" @ %direction@"]");
if (isObject(%ctrl))
{
// Show the indicator, and schedule an event to hide it again
cancelAll(%ctrl);
%ctrl.setVisible(true);
%ctrl.schedule(1500, setVisible, false);
}
}