Jump to content
Sign in to follow this  
A-SUICIDAL

Teammates look dead but they're still running around?

Recommended Posts

I have a weird bug in my mission where sometimes a teammate will get out of a vehicle and they immediately look as though they are dead, but they are not. Their body sometimes slides along the ground and turns towards different directions as if the player is still controlling the body. I tested it it further with some friends and managed to recreate the bug, but I have no idea what is causing it. I asked one of my bugged friends if he was dead and he told me that he was still standing and running around in base, yet his body, which appeared to be dead, was outside of the base on the ground next to the vehicle that he last got out of, and sometimes his body would move a little and his gun would fire from the dead position. There was a diamond around his dead body and his name appeared when I aimed at him, but he was actually about 100 meters away in base and was basically invisible. The worst part about the bug is that the player that is currently bugged - does not know it at all. I first noticed this happen in my mission a few weeks ago and I thought I would've figured out how to fix it by now, but I haven't had any luck. I remember one time I asked my bugged friend to get into a vehicle and then get back out and it fixed the bug, sort of like how the head-bug fix works, but today when we tested the mission some more - the bug came back and when my friend got into a vehicle and then got back out - he still looked like he was dead.

Has anybody ever seen this bug before? And if so, is there any possible way to remedy it?

I don't know what is causing the bug, but I did incorporate additional armor for the players in my 14 man coop mission, along with a few vehicles that also have additional armor. I thought the bug might have something to do with the additional armor. When I first added the additional armor to the mission, none of these bugs occurred. It wasn't until a couple of weeks testing that the bug started to occur. So I don't really think it has anything to do with the additional armor, but I can't think of anything else that might be causing this to happen.

Anyway, if anybody has ever seen this happen before or know what might be the cause of it, please let me know. I can't release the mission with this bug in it and the mission is basically done.

Thanks in advance for any help.

Share this post


Link to post
Share on other sites

This sounds like desync, mate.

Tell us more about the circumstances? Is it on a dedicated server?

Share this post


Link to post
Share on other sites

Are you using handleDamage ?

If so be sure that the damage won't get higher than 0.89. Any value above (0.9+) and the server thinks the unit is dead (alive unit returns false on the server for units with a damage between 0.9 and 0.99 while alive unit on clients returns true for those units) which results in the behaviour you describe.

Xeno

Share this post


Link to post
Share on other sites

The following is the handleDamage used in my mission (props to celery).

player setVariable ["selections", []];
player setVariable ["gethit", []];
player addEventHandler 
[
"HandleDamage",	
{
	if (_this select 1 == "") then
	{
		_selections = player getVariable ["selections", []];
		_gethit = player getVariable ["gethit", []];
		_selection = _this select 1;
		if !(_selection in _selections) then
		{
			_selections set [count _selections, _selection];
			_gethit set [count _gethit, 0];
		};    
		_i = _selections find _selection;
		_olddamage = _gethit select _i;
		 olddamage = _olddamage;
		_damage = _olddamage + ((_this select 2) - _olddamage) * 0.4;
		_gethit set [_i, _damage];
		_damage;
	};
}
];

Note that it does not calculate individual body part damage, but instead calculates the over-all damage. I created a health HUD (dialog) in my mission and the only way I could get it to update the exact health amount was to force it to calculate the overall damage only. Blood effects and inability to walk are added to the player at certain health levels. All of the scripts can be found in the sample mission in this other thread I created 2 months ago: Health status HUD/Dialog.

I've been dying to release this mission, but I have to get this bug fixed first. Is it possible that a vehicle in my mission that was given additional armor using a handleDamage might conflict with the additional armor given to a playable unit upon entering and exiting a vehicle? I wouldn't imagine that the additional armor given to a player and a vehicle would conflict, but then again - this is Arma 2. I have a friend available to test with me right now, so I am going to test it again now and try to recreate the bug and record it using DXtory.

Thank you so much for the advice.

Share this post


Link to post
Share on other sites

I recreated the bug and recorded it.

Below is a detailed description of what exactly is happening in the movie.

Select 720p HD & fullscreen and you can read the in-game chat messages easier.

http://www.youtube.com/watch?v=-KMV5lPBuuo&feature=youtu.be

As you can see in the HandleDamage script above, the player would take * 0.4 overall damage only.

The Health HUD in my mission would then display the converted damage value by doing this:

_dam = getDammage _unit;
_dif = 1 - _dam;
_total = _dif * 100;
_hp = round _total;

In the movie you see my friend, Scudweiser, get in and out of an ATV and everything is fine. I then shot Scud in the leg 1 time, bringing him to "Health 89", but since he has been given additional armor by means of a damage reduction of * 0.4 using the code above, if my math is correct - his real damage would have been around 0.27

A reverse of the math would look something like this

0.27 damage * .4 = .108

1 - .108 = .892

.892 * 100 = 89.2

89.2 rounded = 89 or (Health: 89)

Scud then got back in the ATV and got out again and everything is fine. I then shot him in the leg a 2nd time bringing him to "Health 79", which I figured to be around 0.53 damage. Scud then got into the ATV a 3rd time, but this time when he got out he suddenly appears to be lying dead on the ground, but he's not dead. I then told (invisible)Scud, lol, to run over to the last tent on the right and place a satchel charge inside the middle of the tent. Spooky how a satchel charge suddenly appears. A moment or so later Scud detonates the satchel charge - killing himself. His fake body that is still near the ATV never sinks into the ground like it is supposed to, yet his fake body does have the action to "Take Medkits"(another celery prop), which only appears on dead units in my mission. The ATV used in the movie did not have any additional armor. Scud and I tested with other vehicles and the same problem occurs regardless of whether or not the vehicle has been given additional armor.

Xeno, you mentioned that the damage should not go above .89, but in the test above my friend would have been at .53 damage when the bug occurred. But then there is also the factor where only the overall damage is being calculated. Both times I shot my friend just below his left knee cap he was around 7 to 9 meters away. In a normal game, I guess his leg damage might have brought him to a damage above .89, but I don't know for sure.

Because I am calculating the overall damage only, instead of using * 0.4 in my HandleDamage, what should I be multiplying the damage by?

I don't know when my friend will be available to test with me again. He's busy juggling the wife, kid, work, night school, homework, hookers, blow, chainsaws, you name it. But when I get the chance to test with him again I will try changing the * 0.4 to a higher value and see if I can find a value that doesn't cause any bugs. Until then, any further explanations that you might be able to give me, or advice, would be very helpful. It was hell just teaching myself how to create a dialog so I could make a Health HUD. The thought of having to remove the additional armor that I gave to the units in my mission would make my Health HUD kind of useless, since without the additional armor players die pretty fast and would not get much use out of the Health HUD at all. Plus, since they have extra armor, I made the enemy in my mission more deadly to balance things out. Basically this bug is ruining things a bit.

Edited by A-SUICIDAL

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  

×