Added 'parachute' and 'camera' hitpoints to the HuntIR model:

* You can now shoot the parachute to make it fall faster
* And you can shoot the camera to kill the video feed
This commit is contained in:
ulteq 2015-06-14 12:25:56 +02:00
parent 55fa94ebc4
commit af2e2f71fd
7 changed files with 52 additions and 33 deletions

View File

@ -29,6 +29,26 @@ class CfgVehicles {
soundLandCrash[] = {"", db-30, 1 };
soundWaterCrash[] = {"", db10, 1 };
mapSize = 0;
class HitPoints {
class HitParachute {
armor = 0.0001;
material = -1;
name = "parachute";
visual = "";
radius = 0.2;
passThrough = 1;
explosionShielding = 0;
};
class HitCamera {
armor = 0.001;
material = -1;
name = "camera";
visual = "";
radius = 0.025;
passThrough = 1;
explosionShielding = 1;
};
};
};
class Item_Base_F;

View File

@ -3,7 +3,6 @@
ADDON = false;
PREP(cam);
PREP(handleDamage);
PREP(handleFired);
PREP(huntir);
PREP(huntirCompass);

Binary file not shown.

View File

@ -0,0 +1,26 @@
class CfgSkeletons {
class Default {
isDiscrete = 1;
skeletonInherit = "";
skeletonBones[] = {};
};
class ace_huntir_skeleton: Default {
isDiscrete = 1;
skeletonInherit = "Default";
skeletonBones[] = {
"parachute","",
"camera","",
};
};
};
class CfgModels {
class Default {
sectionsInherit = "";
sections[] = {};
skeletonName = "";
};
class huntir: Default {
skeletonName = "ace_huntir_skeleton";
sectionsInherit = "Default";
};
};

View File

@ -65,12 +65,12 @@ GVAR(no_cams) sort true;
[{
GVAR(nearHuntIRs) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE];
{
if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {damage _x < 0.5}) then {
if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {_x getHitPointDamage "HitCamera" < 0.25}) then {
GVAR(no_cams) pushBack _x;
};
} forEach GVAR(nearHuntIRs);
{
if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {damage _x >= 0.5}) then {
if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {_x getHitPointDamage "HitCamera" >= 0.25}) then {
GVAR(no_cams) deleteAt _forEachIndex;
if (_forEachIndex < GVAR(cur_cam)) then {
GVAR(cur_cam) = GVAR(cur_cam) - 1;

View File

@ -1,25 +0,0 @@
/*
* Author: Ruthberg
*
* Handles huntir damage
*
* Arguments:
* 0: huntir <OBJECT>
* 1: selectionName <STRING>
* 2: damage <NUMBER>
* 3: source <OBJECT>
* 4: projectile <STRING>
*
* Return Value:
* Nothing
*
* Return value:
* None
*/
#include "script_component.hpp"
PARAMS_5(_huntir,_selectionName,_damage,_source,_projectile);
systemChat format["Selection: %1; Damage: %2", _selectionName, _damage];
_damage

View File

@ -32,17 +32,16 @@ if (_ammo != "F_HuntIR") exitWith {};
_huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"];
_huntir setPosATL _position;
_huntir setVariable [QGVAR(startTime), ACE_time, true];
// TODO: Edit the .p3d to allow doing the following _huntir getHit "camera"; _huntir getHit "parachute";
//_huntir addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}];
[{
EXPLODE_1_PVT(_this select 0,_huntir);
if (isNull _huntir) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
if (damage _huntir > 0) then {
private ["_velocity"];
private ["_parachuteDamage", "_velocity"];
_parachuteDamage = _huntir getHitPointDamage "HitParachute";
if (_parachuteDamage > 0) then {
_velocity = velocity _huntir;
_velocity set [2, -1 min -20 * sqrt(damage _huntir)];
_velocity set [2, -1 min -20 * sqrt(_parachuteDamage)];
_huntir setVelocity _velocity;
_huntir setVectorUp [0, 0, 1];
};