Jump to content
Sign in to follow this  
Karrr

Custom Vehicle Does Not Take Damage

Recommended Posts

K I'll start doing that now, is it only the resolution LOD's the proxies need to be in?

Yeah, I think they are only visual, but they are binarized so I don't know what the contents of the p3d are. You might put them in the firegeolod. You may or may not get weird behaviour if you put them in the geolod. If you want them to cast shadows, you can try putting them in the shadowlods. I don't really see any condition under which colliding with those models is vital. I usually put as little int he geolod as I think I can get away with. For instance, the rotors of a helicopter might be considered vital. Also the wheels of a rolling vehicle, so it can run people over. The broken wheel of a half-destroyed vehicle is probably not vital.

EDIT: How do I rename the proxy so I can reference it in the model config? When I hit rename it wants me to change the path to the model.

You have to put them in a named selection. Select the proxy, go to the named selection pane, right click, and choose 'new'.

edit: Oh! On the subject of wheels...

Do not have the wheel selection names in your geolod the same as the spinning parts of your reslod wheels. The wheel parts of your geolod should *never* spin. Name them after the dampers or something. If they spin, you will get really weird hopping problems when the thing crosses bridges or other things with a geolod. This problem was in some arma 1 models, so if your model is from arma 1, it would be best to double check it.

Edited by Max Power

Share this post


Link to post
Share on other sites
Yeah, I think they are only visual, but they are binarized so I don't know what the contents of the p3d are. You might put them in the firegeolod. You may or may not get weird behaviour if you put them in the geolod. If you want them to cast shadows, you can try putting them in the shadowlods. I don't really see any condition under which colliding with those models is vital. I usually put as little int he geolod as I think I can get away with. For instance, the rotors of a helicopter might be considered vital. Also the wheels of a rolling vehicle, so it can run people over. The broken wheel of a half-destroyed vehicle is probably not vital.

You have to put them in a named selection. Select the proxy, go to the named selection pane, right click, and choose 'new'.

edit: Oh! On the subject of wheels...

Do not have the wheel selection names in your geolod the same as the spinning parts of your reslod wheels. The wheel parts of your geolod should *never* spin. Name them after the dampers or something. If they spin, you will get really weird hopping problems when the thing crosses bridges or other things with a geolod. This problem was in some arma 1 models, so if your model is from arma 1, it would be best to double check it.

My proxies for the destroyed wheel models are the original wheel names with hide after it. Now would I have the destroyed proxies in the hide or the unhide? Currently I have them in the unhide class and when I pop the wheels in game the wheels will disappear after they are popped and no destroyed tire model appears. Found out that I had copied ca\wheeled\data\damagewheel\damagewheel_n.p3d instead of changing it I threw it in the proxy lol

---------- Post added at 01:40 ---------- Previous post was at 01:18 ----------

[/color]

edit: Oh! On the subject of wheels...

Do not have the wheel selection names in your geolod the same as the spinning parts of your reslod wheels. The wheel parts of your geolod should *never* spin. Name them after the dampers or something. If they spin, you will get really weird hopping problems when the thing crosses bridges or other things with a geolod. This problem was in some arma 1 models, so if your model is from arma 1, it would be best to double check it.

The geometry LOD has tlumic after every name for the wheels and I have hide after every name for the wheels, am I fine?

Example:

Geometry LOD wheel name: "levy predni tlumic"

Destroyed Wheel Proxy name: "levy predni hide"

EDIT: Now the broken wheel models show but they are showing without the tires being popped, they are showing through the original tires.

EDIT2: Going to bed, catch you tomorrow.

Edited by Karrr

Share this post


Link to post
Share on other sites

tlumic means damper so it's fine the way it is.

The destroyed wheel proxy is what you're unhiding so I think you would want to call it something_something_unhide.

Share this post


Link to post
Share on other sites
tlumic means damper so it's fine the way it is.

The destroyed wheel proxy is what you're unhiding so I think you would want to call it something_something_unhide.

Ok, well the tires broken wheel model still shows through my working wheel before I pop the wheel. As in the broken wheel model is showing before I pop the tire. How do I make it hidden at the beginning cause it doesn't look like it is if it's supposed to.

Edited by Karrr

Share this post


Link to post
Share on other sites

Make sure the named selection matches with the named selection in your animation, and all your definitions match up in your cfgs: hit points, animation sources, animations, etc.

Share this post


Link to post
Share on other sites
Make sure the named selection matches with the named selection in your animation, and all your definitions match up in your cfgs: hit points, animation sources, animations, etc.

I'm thinking I have everything in the model.cfg correct but what do I put in my config.cpp for the unhides to work?

Config.cpp

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

{
	scope = public;
	hasGunner = 0;
	maxSpeed=160;
	acceleration = 9;
	side=TCivilian;
	model="\Kars_Hilux\Model\Kars_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= "Kars 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[]={
			"kars_hilux\textures for hilux\coyota_trup1.rvmat",
			"kars_hilux\textures for hilux\coyota_trup1.rvmat",
			"kars_hilux\textures for hilux\coyota_trup1_destruct.rvmat",
			"kars_hilux\textures for hilux\coyota_kola.rvmat",
			"kars_hilux\textures for hilux\coyota_kola.rvmat",
			"kars_hilux\textures for hilux\coyota_kola_destruct.rvmat",
			"kars_hilux\textures for hilux\coyota_interier.rvmat",
			"kars_hilux\textures for hilux\coyota_interier.rvmat",
			"kars_hilux\textures for hilux\coyota_interier_destruct.rvmat"
			};
		};
	};
};
};

Model.cpp

class CfgSkeletons {
class Car; // External class reference

class Kars_HiluxBones : Car {
isDiscrete = 1;
skeletonInherit = "";
skeletonBones[] = {"pravy predni", "", "pravy dalsi", "", "pravy zadni", "", "pravy prostredni", "", "levy predni", "", "levy dalsi", "", "levy zadni", "", "levy prostredni", "", "dvere1", "", "ukaz_fuel", "", "ukaz_rpm", "", "ukaz_rychlo", "", "volant", ""};
};
};

class CfgModels {
class Car; // External class reference

class Kars_Hilux : Car {
sectionsInherit = "";
sections[] = {"n1", "n2", "n3", "n4", "n5", "n6", "pruh", "light_brake", "pravy predni", "pravy dalsi", "pravy zadni", "pravy prostredni", "levy predni", "levy dalsi", "levy zadni", "levy prostredni", "L svetlo", "P svetlo", "clan", "levy predni unhide", "levy zadni unhide", "pravy predni unhide", "pravy zadni unhide"};
skeletonName = "Kars_HiluxBones";

class Animations {

class Dvere1 {
type = "rotation";
source = "rpm";
selection = "dvere1";
axis = "osa_dvere1";
memory = 1;
//sourceAddress = "clamp";
minValue = 0;
maxValue = 0.1;
angle0 = 0;
angle1 = 0.58;
};

class Kars_HiluxFrontWheelR {
type = "rotationX";
source = "wheel";
selection = "pravy predni";
axis = "";
memory = 1;
sourceAddress = "loop";
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = "rad -360";
};

class Kars_HiluxFrontWheelL : Kars_HiluxFrontWheelR {
selection = "levy predni";
};

class Kars_Hilux2FrontWheelL : Kars_HiluxFrontWheelR {
selection = "levy dalsi";
};

class Kars_Hilux2FrontWheelR : Kars_HiluxFrontWheelR {
selection = "pravy dalsi";
};

class Kars_Hilux2RearWheelR : Kars_HiluxFrontWheelR {
selection = "pravy prostredni";
};

class Kars_Hilux2RearWheelL : Kars_HiluxFrontWheelR {
selection = "levy prostredni";
};

class Kars_HiluxRearWheelR : Kars_HiluxFrontWheelR {
selection = "pravy zadni";
};

class Kars_HiluxRearWheelL : Kars_HiluxFrontWheelR {
selection = "levy zadni";
};

class Kars_HiluxFrontWheelRTurn {
type = "rotationY";
source = "drivingWheel";
selection = "pravy predni";
axis = "";
memory = 1;
sourceAddress = "clamp";
minValue = -1;
maxValue = 1;
angle0 = "rad 35";
angle1 = "rad -35";
};

class Kars_HiluxFrontWheelLTurn : Kars_HiluxFrontWheelRTurn {
selection = "levy predni";
};

class Kars_Hilux2FrontWheelRTurn : Kars_HiluxFrontWheelRTurn {
selection = "pravy dalsi";
};

class Kars_Hilux2FrontWheelLTurn : Kars_HiluxFrontWheelLTurn {
selection = "levy dalsi";
};

class Kars_HiluxDamperFrontWheelR {
type = "translationY";
source = "damper";
selection = "pravy predni";
axis = "";
memory = 1;
sourceAddress = "clamp";
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = "35";
};

class Kars_HiluxDamperFrontWheelL : Kars_HiluxDamperFrontWheelR {
selection = "levy predni";
};

class Kars_Hilux2DamperFrontWheelL : Kars_HiluxDamperFrontWheelR {
selection = "levy dalsi";
};

class Kars_Hilux2DamperFrontWheelR : Kars_HiluxDamperFrontWheelR {
selection = "pravy dalsi";
};

class Kars_Hilux2DamperRearWheelR : Kars_HiluxDamperFrontWheelR {
selection = "pravy prostredni";
};

class Kars_Hilux2DamperRearWheelL : Kars_HiluxDamperFrontWheelR {
selection = "levy prostredni";
};

class Kars_HiluxDamperRearWheelR : Kars_HiluxDamperFrontWheelR {
selection = "pravy zadni";
};

class Kars_HiluxDamperRearWheelL : Kars_HiluxDamperFrontWheelR {
selection = "levy zadni";
};

class Kars_HiluxIndicatorSpeed
{
type="rotation";
source="speed";
selection="ukaz_rychlo";
axis="osa_rychlo";
memory="false";
animPeriod=0;
minValue=0;
maxValue="140 / 3.6";
angle0=0;
angle1="rad 280";
};

class Kars_HiluxIndicatorRPM
{
animPeriod=0;
type="rotation";
source="rpm";
selection="ukaz_rpm";
axis="osa_rpm";
memory=0;
minValue=0.000000;
maxValue=1.000000;
angle0=0.000000;
angle1=2.967060;
};

class Kars_HiluxDrivingWheel
{
type="rotation";
source="drivingWheel";
selection="volant";
begin="osaVolantZac";
end="osaVolantKon";
memory="false";
animPeriod=0;
minValue=-1;
maxValue=1;
angle0=-8;
angle1=8;
};
class Kars_Hilux_DestroyLF
{
Type = "hide";
Source = "HitLFWheel";
Selection = "levy predni";
MinValue = 0.00;
MaxValue = 1.00;
SourceAddress = "clamp";
hideValue = 0.98;
};
class Kars_Hilux_DestroyLB
{
Type = "hide";
Source = "HitLBWheel";
Selection = "levy zadni";
MinValue = 0.00;
MaxValue = 1.00;
SourceAddress = "clamp";
hideValue = 0.98;
};
class Kars_Hilux_DestroyRF
{
Type = "hide";
Source = "HitRFWheel";
Selection = "pravy predni";
MinValue = 0.00;
MaxValue = 1.00;
SourceAddress = "clamp";
hideValue = 0.98;
};
class Kars_Hilux_DestroyRB
{
Type = "hide";
Source = "HitRBWheel";
Selection = "pravy zadni";
MinValue = 0.00;
MaxValue = 1.00;
SourceAddress = "clamp";
hideValue = 0.98;
};
class Kars_Hilux_unhideLF
{
Type = "hide";
Source = "HitLFWheel";
Selection = "levy predni unhide";
MinValue = -1.00;
MaxValue = 0.00;
SourceAddress = "mirror";
hideValue = 0.02;
};
class Kars_Hilux_unhideLB
{
Type = "hide";
Source = "HitLBWheel";
Selection = "levy zadni unhide";
MinValue = -1.00;
MaxValue = 0.00;
SourceAddress = "mirror";
hideValue = 0.02;
};
class Kars_Hilux_unhideRF
{
Type = "hide";
Source = "HitRFWheel";
Selection = "pravy predni unhide";
MinValue = -1.00;
MaxValue = 0.00;
SourceAddress = "mirror";
hideValue = 0.02;
};
class Kars_Hilux_unhideRB
{
Type = "hide";
Source = "HitRBWheel";
Selection = "pravy zadni unhide";
MinValue = -1.00;
MaxValue = 0.00;
SourceAddress = "mirror";
hideValue = 0.02;
};
};
};
};

Edited by Karrr

Share this post


Link to post
Share on other sites

I guess you're inheriting the animation sources from HMMWV.

It looks like the unhide animations should work provided the spellings of the names are correct.

Share this post


Link to post
Share on other sites
I guess you're inheriting the animation sources from HMMWV.

It looks like the unhide animations should work provided the spellings of the names are correct.

Sorry for the late reply, was taking a break. Well all of my broken wheel proxies have the default name with unhide after it. Any ideas?

Share this post


Link to post
Share on other sites

Oh, I know what's wrong. You have to create bones in the skeleton for the unhide parts.

You should put them as children of the undamaged wheels.

Share this post


Link to post
Share on other sites
Oh, I know what's wrong. You have to create bones in the skeleton for the unhide parts.

You should put them as children of the undamaged wheels.

Sweet now it's working :) I'm looking at the link you sent me and I don't really understand how to make the vehicle drop after the tire is popped. I guessing it's the damper part but I really don't know.

Share this post


Link to post
Share on other sites

You animate the ground contact point of the wheel upwards. That causes the suspension to sink. If you want the tire to appear flat, you counter animate the damper downwards a bit. That causes portions of the tire to go below the ground plane.

Share this post


Link to post
Share on other sites
You animate the ground contact point of the wheel upwards. That causes the suspension to sink. If you want the tire to appear flat, you counter animate the damper downwards a bit. That causes portions of the tire to go below the ground plane.

How would I just make the vehicle drop to the front left when the actual wheel is gone and the destroyed wheel proxy appears. At the moment after I pop the wheel the destroyed wheel proxy is floating.

Share this post


Link to post
Share on other sites

I just described how. You know how to do it and you also know how to time animations so they only happen at a certain damage level. Animate the ground contact point until it's within the radius of the destroyed wheel proxy.

Share this post


Link to post
Share on other sites
You animate the ground contact point of the wheel upwards. That causes the suspension to sink. If you want the tire to appear flat, you counter animate the damper downwards a bit. That causes portions of the tire to go below the ground plane.

So I'm guessing the code would look something like this?

class Kars_Hilux_LFDamper
{
type = "translationY";
source = "damper";
selection = "levy predni tlumic";
SourceAddress = "clamp"; 
axis="";
animPeriod=0;
MinValue = -1.00;
MaxValue = 0.00;
};

Would I put how far I would want the land contact to raise/lower in the axis=""; part?

EDIT: Theoretically could I hide the original land contact when damage is met then unhide a selection in landcontact that I can make matching with the damaged wheel's height?

Edited by Karrr

Share this post


Link to post
Share on other sites

You could experiment with it. I would just translate it tho.

TranslationY is animated on the Y axis so axis doesn't do anything for that animation type.

Translation animations use offset0 and offset1 to determine the starting and ending points of the animation, dictated by minValue and maxValue. The animation controller for damage animations goes between 0 and 1, so I guess your minValue would be 0.79 and your maxValue would be like 0.80 to coincide with the hide value of 0.8. Offset0 would be 0 and Offset1 would be some distance (maybe in meters?).

Share this post


Link to post
Share on other sites
You could experiment with it. I would just translate it tho.

TranslationY is animated on the Y axis so axis doesn't do anything for that animation type.

Translation animations use offset0 and offset1 to determine the starting and ending points of the animation, dictated by minValue and maxValue. The animation controller for damage animations goes between 0 and 1, so I guess your minValue would be 0.79 and your maxValue would be like 0.80 to coincide with the hide value of 0.8. Offset0 would be 0 and Offset1 would be some distance (maybe in meters?).

I used the method I said in my edit above, I'm basically done just have a couple more bugs. I get no entry: "\ca\wheeled\data\coyota_skla.paa" when loading in so my hilux can't have broken glass and I was wondering if you knew the path for broken glass for the hilux unless I'm just missing the files. And for some reason the back seat texture does not load when outside of the vehicle (Just plain white) and was wondering if you knew a fix.

Edited by Karrr

Share this post


Link to post
Share on other sites

The back seat texture could be a missing texture, or it could be a glass alpha sorting problem.

That is the correct path to that file. Try without the first slash.

Share this post


Link to post
Share on other sites
The back seat texture could be a missing texture, or it could be a glass alpha sorting problem.

That is the correct path to that file. Try without the first slash.

After testing the wheels a bit it got really buggy and half of the vehicle went completely underground. Can you give me the code for the translation method?

Share this post


Link to post
Share on other sites
No I can't.

Understood, in this part of the code

Begin = "damper_begin";
End = "damper_end";

is it referring to a selection?

Share this post


Link to post
Share on other sites

Begin and End I believe are referring to two selections defining an axis. You can make a selection of two points and that can be an axis, or you can make two selections of one point each and make those the beginning and ending of an axis.

Share this post


Link to post
Share on other sites
Begin and End I believe are referring to two selections defining an axis. You can make a selection of two points and that can be an axis, or you can make two selections of one point each and make those the beginning and ending of an axis.

I've made LFDamperBegin and LFDamperEnd selection's in memory, I'm guessing LFDamperBegin is supposed to be at the bottom of the wheel and the LFDamperEnd would be raised to where the destroyed wheel would be. But when I shoot the wheel it does nothing, when I accidentally forgot to add the LFDamperEnd selection I went in game and shot the wheel and it raised up. But when I added the LFDamperEnd it doesn't move at all.

class 4_Seat_Hilux_LFDrop
{
Type = "translation";
Source = "HitLFWheel";
Selection = "levy predni drop";
MinValue = 0.00;
MaxValue = 1.00;
SourceAddress = "clamp";
Begin = "LFDamperBegin";
End = "LFDamperEnd";
Offset0 = 0.000000;
Offset1 = -0.760000;
};

EDIT: Okay what should I put in the selection box? Right now I have it as levy prendi drop and that's a selection in landcontact I've made. Where the broken wheel would be.

EDIT2: After studying the code a bit it made a bit more sense. Does the code move the original land contact from the LFDamperBegin to LFDamperEnd? If so this code should work no?

class 4_Seat_Hilux_LFDrop
{
Type = "translation";
Source = "HitLFWheel";
Selection = "levy predni tlumic"; //Original land contact - LOD LandContact
MinValue = 0.00;
MaxValue = 1.00;
SourceAddress = "clamp";
Begin = "LFDamperBegin"; //Selection made at the bottom of the wheel/same position as levy predni tlumic - LOD Memory
End = "LFDamperEnd"; //Selection made at the bottom of the destroyed wheel - LOD Memory
Offset0 = 0.000000;
Offset1 = -0.760000;
};

EDIT3: That code worked but I had the Begin and End the wrong way, so I reversed those and now it works! :)

Edited by Karrr

Share this post


Link to post
Share on other sites
Nice!

How would I make the vehicle look blown up after it catches on fire/explodes? (Right now it stays the same texture as it was spawned in)

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  

×