Jump to content
Sign in to follow this  
-TG-Irr-Nixon

Vehicle Damage in A3

Recommended Posts

Hi,

I am currently working on 3 damaged states for are CH146. I have done the confing and the rvmats (bassed on the ones in A3), but I am cluess for what I need to do in O2. I found this tut (http://community.bistudio.com/wiki/Vehicle_Damage), but it is not very clear. Can someone shed some light on this?

Here is my code for the config:

		class Damage
	{
		tex[] = {};
		mat[] = {
		"caf_griffon\data\rvmat\ch146_rotor.rvmat",
		"caf_griffon\data\rvmat\ch146_rotor_damage.rvmat",
		"caf_griffon\data\rvmat\ch146_rotor_destruct.rvmat",
		"caf_griffon\data\rvmat\ch146_main.rvmat",
		"caf_griffon\data\rvmat\ch146_main_damage.rvmat",
		"caf_griffon\data\rvmat\ch146_main_destruct.rvmat",
		"caf_griffon\data\rvmat\ch146_in.rvmat",
		"caf_griffon\data\rvmat\ch146_in_damage.rvmat",
		"caf_griffon\data\rvmat\ch146_in_destruct.rvmat",
		"caf_griffon\data\rvmat\ch146_glass.rvmat",
		"caf_griffon\data\rvmat\ch146_glass_damage.rvmat",
		"caf_griffon\data\rvmat\ch146_glass_damage.rvmat",
		"caf_griffon\data\rvmat\ch146_ext1.rvmat",
		"caf_griffon\data\rvmat\ch146_ext1_damage.rvmat",
		"caf_griffon\data\rvmat\ch146_ext1_destruct.rvmat",
		"caf_griffon\data\rvmat\ch146_ext.rvmat",
		"caf_griffon\data\rvmat\ch146_ext_damage.rvmat",
		"caf_griffon\data\rvmat\ch146_ext_destruct.rvmat",
		"caf_griffon\data\rvmat\ch146_detail.rvmat",
		"caf_griffon\data\rvmat\ch146_detail_damage.rvmat",
		"caf_griffon\data\rvmat\ch146_detail_destruct.rvmat"};
	};

Rvmats are based off the ones of the Nato attack helo.

Cheers,

Nixon

Share this post


Link to post
Share on other sites

I have a zbytek in named selection in LODs 1000 to 5000 and also in the view geometry LOD.

However, I don't have a "sections" part of my model.cfg... how dose that work?

Share this post


Link to post
Share on other sites
...
...

class cfgModels
{
class Plane; //Inherit base class.
class GNT_C185: Plane
{
	skeletonName = "GNT_C185Bones";
	sectionsInherit="";
	sections[]=
	{
		"texFuse","texWing","texMisc","RPod","vrtule staticka","vrtule blur","clan","clan_sign","zbytek","floatwheels","floatGeo","Gearfront1","Gearrear1","gearfrontL","gearfrontL","rudder","tailwheel","elevator","aileronL","aileronR","flapL","flapR","rudderfloatL","rudderfloatR"

	};
class Animations
	{
		class RPod
		{
			type="hide";
			source="user";
			selection="RPod";
			hideValue = 0.1;
		};
...
...

Share this post


Link to post
Share on other sites

Thx for the info... Franze also helped me with this info:

Ok, so step by step:

model.cfg sections:

	sections[]=
	{
"velka vrtule staticka",
"velka vrtule blur",
"mala vrtule staticka",
"mala vrtule blur",
"pod1_m151_1",
//etc as many as needed//
//...///
		"skin_alq1",
		"skin_alq2",
		"skin_cockpit",
		"skin_cockpitglass",
		"skin_fuse",
		"skin_fuse_ld",
		"skin_lefab",
		"skin_lelight",
		"skin_leng",
		"skin_lgear",
//note that if you have a different texture for a part that it needs its own selection//
};

Sections just indicate which parts will have a texture change and will be hidden/unhidden at will.

Hiddenselections on the other hand:

	hiddenselections[]=
{
"pod1_m151_1",
"pod1_m151_2",
"pod1_m151_3",
"pod1_m151_4",
"pod1_m151_5",
"pod1_m151_6",
"pod1_m151_7",
"pod1_m151_8",
"pod1_m151_9",
"pod1_m151_10",
"pod1_m151_11",
"pod1_m151_12",
"pod1_m151_13",
"pod1_m151_14",
"pod1_m151_15",
"pod1_m151_16",
"pod1_m151_17",
"pod1_m151_18",
"pod1_m151_19",
"pod1_m229_1",
//etc as needed//

Determine which parts can be manipulated by setobjecttexture. It's an array format so the first item is 0, next item is 1, etc.

Next, damage textures/parts are shown/hidden by specific magazines added to the pilot's turret (as damage is local to him):

_mags = magazines _heli;
_magsp = _heli magazinesturret [-1];

if(damage _heli < 0.001) then
{
//////light//////
_heli setobjecttexture [1202,""];
_heli setobjecttexture [1203,""];
_heli setobjecttexture [1204,""];
_heli setobjecttexture [1205,""];
_heli setobjecttexture [1206,""];
_heli setobjecttexture [1207,""];
_heli setobjecttexture [1208,""];
_heli setobjecttexture [1209,""];
_heli setobjecttexture [1210,""];
_heli setobjecttexture [1211,""];
_heli setobjecttexture [1212,""];
_heli setobjecttexture [1213,""];
_heli setobjecttexture [1214,""];
_heli setobjecttexture [1215,""];
_heli setobjecttexture [1216,""];
_heli setobjecttexture [1217,""];
_heli setobjecttexture [1218,""];
_heli setobjecttexture [1219,""];
_heli setobjecttexture [1220,""];
_heli setobjecttexture [1221,""];
_heli setobjecttexture [1222,""];
///////medium//////////
_heli setobjecttexture [1223,""];
_heli setobjecttexture [1224,""];
_heli setobjecttexture [1225,""];
_heli setobjecttexture [1226,""];
_heli setobjecttexture [1227,""];
_heli setobjecttexture [1228,""];
_heli setobjecttexture [1229,""];
_heli setobjecttexture [1230,""];
_heli setobjecttexture [1231,""];
_heli setobjecttexture [1232,""];
_heli setobjecttexture [1233,""];
_heli setobjecttexture [1234,""];
_heli setobjecttexture [1235,""];
_heli setobjecttexture [1236,""];
_heli setobjecttexture [1237,""];
_heli setobjecttexture [1238,""];
_heli setobjecttexture [1239,""];
_heli setobjecttexture [1240,""];
_heli setobjecttexture [1241,""];
_heli setobjecttexture [1242,""];
_heli setobjecttexture [1243,""];
//////catastrophic/////
_heli setobjecttexture [1251,""];
if(_skinset == 0) then
{
_setskin = [_heli,"\fza_ah64_us\tex\ex\b2_co.paa"] execvm "\fza_ah64_controls\scripting\damage\skins.sqf";
_skinset = 1;
};
if(local _heli || player == gunner _heli) then
{
//////light////////
_heli removemagazinesturret ["fza_ah64_dam_fuse",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_nose",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_leng",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_reng",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_lfab",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_rfab",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_lwing",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_rwing",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_tailboom",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_vtail",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_hstab",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_pylon1",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_pylon2",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_pylon3",[-1]];
_heli removemagazinesturret ["fza_ah64_dam_pylon4",[-1]];
//////medium//////
_heli removemagazinesturret ["fza_ah64_mdam_fuse",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_nose",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_leng",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_reng",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_lfab",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_rfab",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_lwing",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_rwing",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_tailboom",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_vtail",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_hstab",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_pylon1",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_pylon2",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_pylon3",[-1]];
_heli removemagazinesturret ["fza_ah64_mdam_pylon4",[-1]];
//////catastrophic////
_heli removemagazinesturret ["fza_ah64_cdam_tailboom",[-1]];
//////systems/////
_heli removemagazinesturret ["fza_ah64_tailrotor_dam",[-1]];
_heli removemagazinesturret ["fza_ah64_tailrotor_fail",[-1]];
_heli removemagazinesturret ["fza_ah64_rotor_dam",[-1]];
_heli removemagazinesturret ["fza_ah64_rotor_fail",[-1]];
_heli removemagazinesturret ["fza_ah64_tads_dam",[-1]];
_heli removemagazinesturret ["fza_ah64_tads_fail",[-1]];
_heli removemagazinesturret ["fza_ah64_pnvs_fail",[-1]];
_heli removemagazinesturret ["fza_ah64_gun_jam",[-1]];
_heli removemagazinesturret ["fza_ah64_gun_fail",[-1]];
_heli removemagazinesturret ["fza_ah64_trans_dam",[-1]];
_heli removemagazinesturret ["fza_ah64_trans_fail",[-1]];
_heli removemagazinesturret ["fza_ah64_fcr_fail",[-1]];
_heli removemagazinesturret ["fza_ah64_fwd_leak",[-1]];
_heli removemagazinesturret ["fza_ah64_aft_leak",[-1]];
_heli removemagazinesturret ["fza_ah64_rdp_fail",[-1]];
_heli removemagazinesturret ["fza_ah64_ldp_fail",[-1]];
_heli removemagazinesturret ["fza_ah64_rwp_fail",[-1]];
_heli removemagazinesturret ["fza_ah64_lwp_fail",[-1]];
_heli removemagazinesturret ["fza_ah64_irjamfail",[-1]];
_heli removemagazinesturret ["fza_ah64_rfjamfail",[-1]];
_heli removemagazinesturret ["fza_ah64_firepdisch",[-1]];
_heli removemagazinesturret ["fza_ah64_firerdisch",[-1]];
};
};

if("fza_ah64_dam_fuse" in _magsp) then {_heli setobjecttexture [1202,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_nose" in _magsp) then {_heli setobjecttexture [1203,"\fza_ah64_us\tex\dam\ldam.paa"]; _heli setobjecttexture [1209,"\fza_ah64_us\tex\dam\ldam.paa"]; _heli setobjecttexture [1210,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_leng" in _magsp) then {_heli setobjecttexture [1206,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_reng" in _magsp) then {_heli setobjecttexture [1217,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_lfab" in _magsp) then {_heli setobjecttexture [1205,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_rfab" in _magsp) then {_heli setobjecttexture [1216,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_lwing" in _magsp) then {_heli setobjecttexture [1208,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_rwing" in _magsp) then {_heli setobjecttexture [1219,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_tailboom" in _magsp && !("fza_ah64_cdam_tailboom" in _magsp)) then {_heli setobjecttexture [1221,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_vtail" in _magsp && !("fza_ah64_cdam_tailboom" in _magsp)) then {_heli setobjecttexture [1222,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_hstab" in _magsp && !("fza_ah64_cdam_tailboom" in _magsp)) then {_heli setobjecttexture [1204,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_tads_dam" in _magsp) then {_heli setobjecttexture [1220,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_pylon1" in _magsp) then {_heli setobjecttexture [1212,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_pylon2" in _magsp) then {_heli setobjecttexture [1213,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_pylon3" in _magsp) then {_heli setobjecttexture [1214,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_dam_pylon4" in _magsp) then {_heli setobjecttexture [1215,"\fza_ah64_us\tex\dam\ldam.paa"];};
if("fza_ah64_pnvs_fail" in _magsp) then {_heli setobjecttexture [1211,"\fza_ah64_us\tex\dam\ldam.paa"];};

if("fza_ah64_mdam_fuse" in _magsp) then {_heli setobjecttexture [1223,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_nose" in _magsp) then {_heli setobjecttexture [1224,"\fza_ah64_us\tex\dam\mdam.paa"]; _heli setobjecttexture [1230,"\fza_ah64_us\tex\dam\mdam.paa"]; _heli setobjecttexture [1231,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_leng" in _magsp) then {_heli setobjecttexture [1227,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_reng" in _magsp) then {_heli setobjecttexture [1238,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_lfab" in _magsp) then {_heli setobjecttexture [1226,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_rfab" in _magsp) then {_heli setobjecttexture [1237,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_lwing" in _magsp) then {_heli setobjecttexture [1229,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_rwing" in _magsp) then {_heli setobjecttexture [1240,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_tailboom" in _magsp && !("fza_ah64_cdam_tailboom" in _magsp)) then {_heli setobjecttexture [1242,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_vtail" in _magsp && !("fza_ah64_cdam_tailboom" in _magsp)) then {_heli setobjecttexture [1243,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_hstab" in _magsp && !("fza_ah64_cdam_tailboom" in _magsp)) then {_heli setobjecttexture [1225,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_tads_fail" in _magsp) then {_heli setobjecttexture [1241,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_pylon1" in _magsp) then {_heli setobjecttexture [1233,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_pylon2" in _magsp) then {_heli setobjecttexture [1234,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_pylon3" in _magsp) then {_heli setobjecttexture [1235,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_mdam_pylon4" in _magsp) then {_heli setobjecttexture [1236,"\fza_ah64_us\tex\dam\mdam.paa"];};
if("fza_ah64_pnvs_fail" in _magsp) then {_heli setobjecttexture [1232,"\fza_ah64_us\tex\dam\mdam.paa"];};

if("fza_ah64_cdam_tailboom" in _magsp) then
{
_heli setobjecttexture [1221,""];
_heli setobjecttexture [1222,""];
_heli setobjecttexture [1204,""];
_heli setobjecttexture [1242,""];
_heli setobjecttexture [1243,""];
_heli setobjecttexture [1225,""];
//model//
_heli setobjecttexture [1153,""];
_heli setobjecttexture [1181,""];
_heli setobjecttexture [1183,""];
_heli setobjecttexture [1184,""];
_heli setobjecttexture [1251,"\fza_ah64_us\tex\dam\metdam_co.paa"];
_skinset = 0;
};

Now, magazines aren't absolutely necessary, but I used them because the data is shown across all clients in a network game.

Lastly, the handledamage script is a function that is called due to the rapid nature required:

private ["_heli","_system","_damage","_mags"];

_heli = _this select 0;
_system = _this select 1;
_damage = _this select 2;
_mags = _heli magazinesTurret [-1];
_usesound = false;

if(player == driver _heli || player == gunner _heli) then {_usesound = true;};

if(!(alive _heli)) exitwith {false};

if(_system == "mala vrtule") then
{
if(_damage > 0.4 && _damage < 0.8 && !("fza_ah64_tailrotor_dam" in _mags)) then {_heli addmagazineturret ["fza_ah64_tailrotor_dam",[-1]]; if(_usesound) then {["fza_ah64_tail_rotor_damaged_1",3] execvm "\fza_ah64_controls\scripting\damage\dam_bt_audio.sqf";};};
if(_damage >= 0.8 && !("fza_ah64_tailrotor_fail" in _mags)) then {_heli removemagazinesturret ["fza_ah64_tailrotor_dam",[-1]]; _heli addmagazineturret ["fza_ah64_tailrotor_fail",[-1]]; _heli sethit ["mala vrtule",1]; if(_usesound) then {["fza_ah64_tail_rotor_failure_1",3] execvm "\fza_ah64_controls\scripting\damage\dam_bt_audio.sqf";};};
};

if(_system == "velka vrtule") then
{
if(_damage > 0.4 && _damage < 0.8 && !("fza_ah64_rotor_dam" in _mags)) then {_heli addmagazineturret ["fza_ah64_rotor_dam",[-1]]; if(_usesound) then {["fza_ah64_main_rotor_damaged_1",4] execvm "\fza_ah64_controls\scripting\damage\dam_bt_audio.sqf";};};
if(_damage >= 0.8 && !("fza_ah64_rotor_fail" in _mags)) then {_heli removemagazinesturret ["fza_ah64_rotor_dam",[-1]]; _heli addmagazineturret ["fza_ah64_rotor_fail",[-1]]; if(_usesound) then {["fza_ah64_main_rotor_failure_1",4] execvm "\fza_ah64_controls\scripting\damage\dam_bt_audio.sqf";}; _heli removemagazinesturret ["fza_ah64_trans_dam",[-1]]; _heli addmagazineturret ["fza_ah64_trans_fail",[-1]]; _heli setHit ["trans", 1];};
};

if(_system == "tads_tur" || _system == "tads") then
{
if(_damage > 0.4 && _damage < 0.8 && !("fza_ah64_tads_dam" in _mags)) then {_heli addmagazineturret ["fza_ah64_tads_dam",[-1]];};
if(_damage >= 0.8 && !("fza_ah64_tads_fail" in _mags)) then {_heli removemagazinesturret ["fza_ah64_tads_dam",[-1]]; _heli addmagazineturret ["fza_ah64_tads_fail",[-1]]; _heli sethit ["tads",1]; _heli sethit ["tads_tur",1]; if(_usesound) then {["fza_ah64_tads_failure_1",5] execvm "\fza_ah64_controls\scripting\damage\dam_bt_audio.sqf";};};
};

if(_system == "pnvs") then
{
if(_damage >= 0.8 && !("fza_ah64_pnvs_fail" in _mags)) then {_heli addmagazineturret ["fza_ah64_pnvs_fail",[-1]]; if(_usesound) then {["fza_ah64_pnvs_fail_1",3] execvm "\fza_ah64_controls\scripting\damage\dam_bt_audio.sqf";};};
};

if(_system == "otochlaven") then
{
if(_damage >= 0.8 && !("fza_ah64_gun_jam" in _mags)) then {_heli addmagazineturret ["fza_ah64_gun_jam",[-1]]; _heli removemagazine "fza_m230_1200"; _heli removemagazine "fza_m230_350"; if(_usesound) then {["fza_ah64_bt_gun",0.5,"fza_ah64_bt_jammed",1] execvm "\fza_ah64_controls\scripting\damage\dam_bt_audio.sqf";};};
};

if(_system == "otocvez") then
{
if(_damage >= 0.8 && !("fza_ah64_gun_fail" in _mags)) then {_heli addmagazineturret ["fza_ah64_gun_fail",[-1]]; if(_usesound) then {["fza_ah64_bt_gun",0.5,"fza_ah64_bt_actuator",1,"fza_ah64_bt_failure",1] execvm "\fza_ah64_controls\scripting\damage\dam_bt_audio.sqf";};};
};

if(_system == "trans") then
{
if(_damage >= 0.4 && _damage < 0.9 && !("fza_ah64_trans_dam" in _mags)) then
{
	_heli addmagazineturret ["fza_ah64_trans_dam",[-1]];
	if(!("fza_ah64_apu_fire" in _mags)) then {[_heli,"apu"] execvm "\fza_ah64_controls\scripting\damage\enginefire.sqf";};
};
if(_damage >= 0.9 && !("fza_ah64_trans_fail" in _mags)) then {_heli removemagazinesturret ["fza_ah64_trans_dam",[-1]]; _heli addmagazineturret ["fza_ah64_trans_fail",[-1]];};
};

if(_system == "fuselage") then
{
if(_damage >= 0.5) then
{
	_rand = round(random 10);
	if(_rand == 1 && !("fza_ah64_irjamfail" in _mags)) then {_heli addmagazineturret ["fza_ah64_irjamfail",[-1]];};
	if(_rand == 5 && !("fza_ah64_fwd_leak" in _mags)) then {_heli addmagazineturret ["fza_ah64_fwd_leak",[-1]]; [_heli] execvm "\fza_ah64_controls\scripting\damage\fuel_leak.sqf";};
	if(_rand == 10 && !("fza_ah64_aft_leak" in _mags)) then {_heli addmagazineturret ["fza_ah64_aft_leak",[-1]]; [_heli] execvm "\fza_ah64_controls\scripting\damage\fuel_leak.sqf";};
};
if(_damage >= 0.8) then
{
	_rand = round(random 10);
	if(_rand > 3 && !("fza_ah64_irjamfail" in _mags)) then {_heli addmagazineturret ["fza_ah64_irjamfail",[-1]];};
	if(_rand > 6 && !("fza_ah64_fwd_leak" in _mags)) then {_heli addmagazineturret ["fza_ah64_fwd_leak",[-1]]; [_heli] execvm "\fza_ah64_controls\scripting\damage\fuel_leak.sqf";};
	if(_rand > 8 && !("fza_ah64_aft_leak" in _mags)) then {_heli addmagazineturret ["fza_ah64_aft_leak",[-1]]; [_heli] execvm "\fza_ah64_controls\scripting\damage\fuel_leak.sqf";};
};
if(_damage >= 0.2 && !("fza_ah64_dam_fuse" in _mags)) then {_heli addmagazineturret ["fza_ah64_dam_fuse",[-1]];};
if(_damage >= 0.4 && !("fza_ah64_mdam_fuse" in _mags)) then {_heli addmagazineturret ["fza_ah64_mdam_fuse",[-1]];};
};

if(_system == "radar" && typeOf _heli == "fza_ah64d_b2e") then
{
if(_damage >= 0.8 && !("fza_ah64_fcr_fail" in _mags)) then {_heli addmagazineturret ["fza_ah64_fcr_fail",[-1]];};
};

if(_system == "cockpit") then
{
if(_damage >= 0.2 && !("fza_ah64_dam_nose" in _mags)) then {_heli addmagazineturret ["fza_ah64_dam_nose",[-1]];};
if(_damage >= 0.4 && !("fza_ah64_mdam_nose" in _mags)) then {_heli addmagazineturret ["fza_ah64_mdam_nose",[-1]];};
if(_damage >= 0.5) then
{
	_rand = round(random 10);
	if(_rand == 1 && !("fza_ah64_rfjamfail" in _mags)) then {_heli addmagazineturret ["fza_ah64_rfjamfail",[-1]];};
};
if(_damage >= 0.8) then
{
	_rand = round(random 10);
	if(_rand > 3 && !("fza_ah64_rfjamfail" in _mags)) then {_heli addmagazineturret ["fza_ah64_rfjamfail",[-1]];};
};
};

if(_system == "leng") then
{
if(_damage >= 0.2 && !("fza_ah64_dam_leng" in _mags)) then {_heli addmagazineturret ["fza_ah64_dam_leng",[-1]];};
if(_damage >= 0.4 && !("fza_ah64_mdam_leng" in _mags)) then
{
	_heli addmagazineturret ["fza_ah64_mdam_leng",[-1]];
	if(!("fza_ah64_e1_fire" in _mags)) then {[_heli,"left"] execvm "\fza_ah64_controls\scripting\damage\enginefire.sqf";};
	_rand = round(random 10);
	if(_rand == 10 && !("fza_ah64_fwd_leak" in _mags)) then {_heli addmagazineturret ["fza_ah64_fwd_leak",[-1]]; [_heli] execvm "\fza_ah64_controls\scripting\damage\fuel_leak.sqf";};
	if(_rand == 10 && !("fza_ah64_aft_leak" in _mags)) then {_heli addmagazineturret ["fza_ah64_aft_leak",[-1]]; [_heli] execvm "\fza_ah64_controls\scripting\damage\fuel_leak.sqf";};
};
if(_damage >= 0.8 && !("fza_ah64_hdam_leng" in _mags)) then
{
	_heli addmagazineturret ["fza_ah64_hdam_leng",[-1]];
	if(!("fza_ah64_e1_fire" in _mags)) then {[_heli,"left"] execvm "\fza_ah64_controls\scripting\damage\enginefire.sqf";};
	_rand = round(random 10);
	if(_rand < 5 && !("fza_ah64_fwd_leak" in _mags)) then {_heli addmagazineturret ["fza_ah64_fwd_leak",[-1]]; [_heli] execvm "\fza_ah64_controls\scripting\damage\fuel_leak.sqf";};
	if(_rand > 5 && !("fza_ah64_aft_leak" in _mags)) then {_heli addmagazineturret ["fza_ah64_aft_leak",[-1]]; [_heli] execvm "\fza_ah64_controls\scripting\damage\fuel_leak.sqf";};
};
};

///more systems and stuff//

if(_system == "pylon4") then
{
if(_damage >= 0.2 && !("fza_ah64_dam_pylon4" in _mags)) then {_heli addmagazineturret ["fza_ah64_dam_pylon4",[-1]];};
if(_damage >= 0.4 && !("fza_ah64_mdam_pylon4" in _mags)) then {_heli addmagazineturret ["fza_ah64_mdam_pylon4",[-1]]; [_heli,_system] call fza_ah64_weapondamage;};
};

false

This script only finds out what was damaged and by how much, then adds appropriate magazines to the pilot's turret. It does have shortcomings such as setdamage will not trigger it nor damage added when placed in the editor, it only accounts for damage caused in real time. Gethitpointdamage could be used in place of it but I don't know if it works on the local or global level.

Hope this helps.

Share this post


Link to post
Share on other sites
Thx for the info... Franze also helped me with this info:

? No where in that post does it mention "zbytek"

If you are talking about creating a WHOLE NEW damage simulation .... fine, but "zbytek" relates to BI's provided automatic texture damage system.

Share this post


Link to post
Share on other sites

The example that Franze gave me is more complex (it is different from the BI way), but will do the job also. I wanted to show both ways to do this so if someone has the same question he/she can find the answer here.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×