Jump to content
Sign in to follow this  
ADuke

Do not transfer vehicle damage to crew

Recommended Posts

Hi,

I am making an HMMWV, whenever the vehicle takes damage, such as running into a tree or wall, the crew takes damage, how can I stop this from happening.

I am guessing it is in the hit points section of my config under "passthrough".

Am I correct in this assumption.

Thanks,

-AD

Share this post


Link to post
Share on other sites
Hi,

I am making an HMMWV, whenever the vehicle takes damage, such as running into a tree or wall, the crew takes damage, how can I stop this from happening.

Well, you unless your HMMWV has some really thick padding all around the crew, it doesn't make any sense to not get injured when you crash into stuff. :confused:

But, I'm not sure how to disable this at a config level. Script-wise you might be able to, but you'd have a difficult time distinguishing between damage caused by collisions and damage caused by enemy fire.

Share this post


Link to post
Share on other sites
Well, you unless your HMMWV has some really thick padding all around the crew, it doesn't make any sense to not get injured when you crash into stuff.

Seatbelts, ever backed your car into something?

Did you have to go to the hospital?

Bet you had to take your car to the mechanic though right? :)

Guess I can't config it to differentiate between light impacts and impacts that would actually hurt the crew so oh well.

Share this post


Link to post
Share on other sites

Back in ACE1 we had a fix for precisely these occasions. It was based on Hit event handler attached to the CAManBase class. The called function is as follows:

_unit = _this select 0;
_injurer = _this select 1;
_dmg = _this select 2;


// *** preventing reckless driving injuries

if (_unit != vehicle _unit && alive (vehicle _unit)) then
{
if (typeName _injurer == "OBJECT") then
{
		if (_injurer in (vehicle _unit)) then 
		{
			if (_dmg < 0.25) then 
			{ 
				_unit setdamage (damage _unit - _dmg);
			};
		};	
};
};

Edited by Q1184

Share this post


Link to post
Share on other sites
Seatbelts, ever backed your car into something?

As far as I'm aware, seatbelts aren't used in military vehicles. I'd imagine they'd just get in the way.

Share this post


Link to post
Share on other sites
As far as I'm aware, seatbelts aren't used in military vehicles. I'd imagine they'd just get in the way.

Really?

Share this post


Link to post
Share on other sites

Hey mate.

One way to do this, is when the units enter a vehicle eg.

vehicle _unit != _unit;

use this:

_unit allowDamage false;

This will stop the units travelling in the HMMWV from taking damage. This will work fine in single player - its a little more complicated in MP as you need to declare this code on "all machines to have a global affect".

Hope everythings good in your neck of the woods.

Best wishes,

norrin

Share this post


Link to post
Share on other sites
Hey mate.

One way to do this, is when the units enter a vehicle eg.

vehicle _unit != _unit;

use this:

_unit allowDamage false;

This will stop the units travelling in the HMMWV from taking damage. This will work fine in single player - its a little more complicated in MP as you need to declare this code on "all machines to have a global affect".

Hope everythings good in your neck of the woods.

Best wishes,

norrin

This should solve your problem for MP, if you put this into the initline of the units who should be affected by this.

this addEventHandler [GetIn", {player allowdammage false}];

this addEventHandler ["GetOut", {player allowdammage true}];

OK, forget about this. Mixed something up. Wrong forum... :D

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  

×