Jump to content
Sign in to follow this  
iceman77

Dead Body WeaponHolder

Recommended Posts

Dead bodies create weaponHolders (:confused:). However, when I use:

waitUntil {!alive man1};
_weaponHolders = nearestObjects [player, ["weaponHolder","groundWeaponHolder"],50];
hint format ["%1 : %2", count _weaponHolders, _weaponHolders];

It returns 0 and an empty array after I kill the unit.

I simply want to make an unarmed unit take a weapon from the nearest body and I figured this was the best place to start, as I can't simply use takeWeapon on a dead body any longer. As the primaryWeapon for a dead body in A3 for example, is an empty string and not the weapon the unit had before he died.

Edited by Iceman77

Share this post


Link to post
Share on other sites

More types of weapon holder than that in A3? Maybe dead bodies uses one of the others? Will try and test that when I get time - busy at moment.

Share this post


Link to post
Share on other sites

_holders = nearestObjects [getPos player, ["WeaponHolderSimulated", "GroundWeaponHolder", "Default"], _radius];

Share this post


Link to post
Share on other sites

I don't remember anymore. I just remember having spent hours on this line alone and this is what I came up with. So I trust myself that it has to be in there. :D

Edit: Or it is just a misfired ctrl-V. :) dead soliders seem to all keep their weapons in weaponholderSimulated.

Other than that WeaponholderSimulated is handled by phisics engine, whereas GroundWeaponHolder is not.

Edited by zapat

Share this post


Link to post
Share on other sites
Guest

When i delete the dead body, the weapon dissapears. Any way to avoid that?

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  

×