Jump to content
Sign in to follow this  
Karrr

Custom Vehicle Does Not Take Damage

Recommended Posts

	class Damage
	{
		tex[]={};
		mat[]={
			"ca\wheeled\data\detailmapy\coyota_trup1.rvmat",
			"ca\wheeled\data\detailmapy\coyota_trup1.rvmat",
			"ca\wheeled\data\detailmapy\coyota_trup1_destruct.rvmat",
			"ca\wheeled\data\detailmapy\coyota_addons.rvmat",
			"ca\wheeled\data\detailmapy\coyota_addons.rvmat",
			"ca\wheeled\data\detailmapy\coyota_addons_destruct.rvmat",
			"ca\wheeled\data\detailmapy\coyota_kola.rvmat",
			"ca\wheeled\data\detailmapy\coyota_kola.rvmat",
			"ca\wheeled\data\detailmapy\coyota_kola_destruct.rvmat",
			"ca\wheeled\data\detailmapy\coyota_interier.rvmat",
			"ca\wheeled\data\detailmapy\coyota_interier.rvmat",
			"ca\wheeled\data\detailmapy\coyota_interier_destruct.rvmat"
			};
		};

That's the code I have as of now and it doesn't work, I'm using Bohemia's .rvmat's and destruct.rvmats. I don't see how it wouldn't work.

Entire config.cpp:

#include "basicdefines.hpp"
#include "model.cfg"
class CfgPatches
{
class 4_Seat_Hilux
{
units[] = {"4_Seat_Hilux"};
weapons[] = {};
requiredVersion = 1.0;
requiredAddons[] = {};
};
};
class CfgVehicles {
class HMMWV;
class 4_Seat_Hilux: HMMWV

{
	scope = public;
	hasGunner = 0;
	maxSpeed=125;
	acceleration = 9;
	side=TCivilian;
	model="\4_Seat_Hilux\Model\4_Seat_Hilux.p3d";
	picture="\Ca\wheeled\data\ico\hilux1_civil_3_open_CA.paa";
	Icon="\Ca\wheeled\data\map_ico\icomap_hilux_CA.paa";
	mapSize = 7;
	nameSound="offroad";
	displayName= "4 Seat Hilux";
	transportSoldier = 3;
	typicalCargo[]={Civilian};
	driverAction= Hilux_Driver;

	soundEngine[]={\ca\wheeled\Data\Sound\Hilux_engine1,db-20,0.8};
	soundGear[]={\ca\wheeled\Data\Sound\shifter_v3,db-65,1};
	SoundGetIn[]={\ca\wheeled\Data\Sound\Humvee_DoorOpenClose,db-45,1};
	SoundGetOut[]={\ca\wheeled\Data\Sound\Humvee_DoorOpenClose,db-50,1};

	class hitpoints
	{
//		class PlateInfos {name="spz"; /*font<=fontPlate;*/ color[]={0,0,0,0.75};}
	class HitEngine {armor=0.4;material=60;name="motor";visual="motor";passThrough=1;};

	class HitRGlass {armor=0.3;material=-1;name="sklo predni P";passThrough=0;};
	class HitLGlass {armor=0.3;material=-1;name="sklo predni L";passThrough=0;};

	class HitBody {armor=1;material=51;name="NEkaroserie";visual="karoserie";passThrough=1;}; //disabled points from models
	class HitFuel {armor=0.3;material=51;name="palivo";passThrough=1;};

	class HitLFWheel {armor=0.15;material=-1;name="levy predni tlumic";visual="Levy predni";passThrough=0;};
	class HitRFWheel {armor=0.15;material=-1;name="pravy predni tlumic";visual="Pravy predni";passThrough=0;};


	class HitLBWheel {armor=0.15;material=-1;name="levy zadni tlumic";visual="Levy zadni";passThrough=0;};
	class HitRBWheel {armor=0.15;material=-1;name="pravy zadni tlumic";visual="Pravy zadni";passThrough=0;};

	dammageHalf[]=
	{
		\ca\wheeled\data\coyota_skla.paa, \ca\wheeled\data\coyota_sklabr1_CA.paa,
		\ca\wheeled\data\coyota_skla.paa, \ca\wheeled\data\coyota_sklabr1_CA.paa
	};
	dammageFull[]=
	{
		\ca\wheeled\data\coyota_skla.paa, \ca\wheeled\data\coyota_sklabr2_CA.paa,
		\ca\wheeled\data\coyota_skla.paa, \ca\wheeled\data\coyota_sklabr2_CA.paa
	};
	class Damage
	{
		tex[]={};
		mat[]={
			"ca\wheeled\data\detailmapy\coyota_trup1.rvmat",
			"ca\wheeled\data\detailmapy\coyota_trup1.rvmat",
			"ca\wheeled\data\detailmapy\coyota_trup1_destruct.rvmat",
			"ca\wheeled\data\detailmapy\coyota_addons.rvmat",
			"ca\wheeled\data\detailmapy\coyota_addons.rvmat",
			"ca\wheeled\data\detailmapy\coyota_addons_destruct.rvmat",
			"ca\wheeled\data\detailmapy\coyota_kola.rvmat",
			"ca\wheeled\data\detailmapy\coyota_kola.rvmat",
			"ca\wheeled\data\detailmapy\coyota_kola_destruct.rvmat",
			"ca\wheeled\data\detailmapy\coyota_interier.rvmat",
			"ca\wheeled\data\detailmapy\coyota_interier.rvmat",
			"ca\wheeled\data\detailmapy\coyota_interier_destruct.rvmat"
			};
		};
	};
};
};

Share this post


Link to post
Share on other sites

class damage shouldn't be in class hitpoints, and neither should the damagex arrays. Put them in your hilux vehicle class. You can get rid of the damage arrays. The damage class supplanted them, I think.

Share this post


Link to post
Share on other sites

Hi,

I am also taking another crack at this having given up in the past.

The part I can't make sense of is how to map the Model Animation classes to the proxy in oxygen?

For example, I have the following wheel hide / unhide animations:

class Animations

{

class damageHide

{

type="hide";

source="damage";

selection="damageHide";

};

class wheel_1_1_destruct

{

type="hide";

source="HitLFWheel";

selection="wheel_1_1_hide";

minValue=0;

maxValue=1;

minPhase=0;

maxPhase=1;

hideValue=0.99000001;

};

class wheel_1_2_destruct

{

type="hide";

source="HitLBWheel";

selection="wheel_1_2_hide";

minValue=0;

maxValue=1;

minPhase=0;

maxPhase=1;

hideValue=0.99000001;

};

class wheel_2_1_destruct

{

type="hide";

source="HitRFWheel";

selection="wheel_2_1_hide";

minValue=0;

maxValue=1;

minPhase=0;

maxPhase=1;

hideValue=0.99000001;

};

class wheel_2_2_destruct

{

type="hide";

source="HitRBWheel";

selection="wheel_2_2_hide";

minValue=0;

maxValue=1;

minPhase=0;

maxPhase=1;

hideValue=0.99000001;

};

class wheel_1_1_destruct_unhide

{

type="hide";

source="HitLFWheel";

selection="wheel_1_1_unhide";

minValue=-1;

maxValue=0;

minPhase=-1;

maxPhase=0;

hideValue=0.0099999998;

};

class wheel_1_2_destruct_unhide

{

type="hide";

source="HitLBWheel";

selection="wheel_1_2_unhide";

minValue=-1;

maxValue=0;

minPhase=-1;

maxPhase=0;

hideValue=0.0099999998;

};

class wheel_2_1_destruct_unhide

{

type="hide";

source="HitRFWheel";

selection="wheel_2_1_unhide";

minValue=-1;

maxValue=0;

minPhase=-1;

maxPhase=0;

hideValue=0.0099999998;

};

class wheel_2_2_destruct_unhide

{

type="hide";

source="HitRBWheel";

selection="wheel_2_2_unhide";

minValue=-1;

maxValue=0;

minPhase=-1;

maxPhase=0;

hideValue=0.0099999998;

};

How do I map those to my damaged wheel proxies.

For example I have my proxies in place:

ZAUzl.jpg

And the animation named selections:

Egg43.jpg

But I have no idea if that's correct at all as its difficult to understand without visual reference.

Thanks in advance for anyone that can help. I awoke this thread, rather then start a new one.

---------- Post added at 15:07 ---------- Previous post was at 15:02 ----------

Also, does anyone know of an MLOD I can look at to see how this is all done.

There are the BI example models, but they have all the damage selections stripped out :(

Share this post


Link to post
Share on other sites

You will need to make new selections with the proxies selected and name them whatever so you can reference them in the code. I made a selection: pravy zadni unhide and that selection is selecting the proxy and is referenced within the code.

class 4_Seat_Hilux_DestroyRB
{
Type = "hide";
Source = "HitRBWheel";
Selection = "pravy zadni";
MinValue = 0.00;
MaxValue = 1.00;
SourceAddress = "clamp";
hideValue = 0.98;
};

class 4_Seat_Hilux_unhideRB
{
Type = "hide";
Source = "HitRBWheel";
Selection = "pravy zadni unhide";
MinValue = -1.00;
MaxValue = 0.00;
SourceAddress = "mirror";
hideValue = 0.02;
};

So once the damage 0.98 is reached it will hide my wheel model, and the destroyed wheel proxy will display. Then once the damage goes below 0.98 the wheel will display and the destroyed wheel proxy will hide.

Edited by Karrr

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  

×