Jump to content
Sign in to follow this  
nullsystems

Return a players head or body part?

Recommended Posts

Ello,

I know that you can damage a players body part with a function like this:

player setHit ["hands", 0.9];

Or use a eventhandler to find where someone was hit:

http://community.bistudio.com/wiki/ArmA:_Event_Handlers#HandleDamage

This shows us its possible to access different parts of a model.

So how do I do "other things" to a players model parts?

If we look at the CfgVehicles config from : AddOns\characters\

class HitPoints {
		class HitHead {
			armor = 0.7;
			material = -1;
			name = "head_hit";
			passThrough = true;
		};

		class HitBody {
			armor = 0.8;
			material = -1;
			name = "body";
			passThrough = true;
		};

		class HitHands {
			armor = 0.5;
			material = -1;
			name = "hands";
			passThrough = true;
		};

		class HitLegs {
			armor = 0.5;
			material = -1;
			name = "legs";
			passThrough = true;
		};
	};

We can return info from the config files by using things like:

_weaponBone = getText (configFile >> "cfgVehicles" >> typeOf(player) >> "weaponBone");

Now, with this info in mind...

From looking into the config of CfgHeads I can see the model:

class Miles : Cooper {
	model = "\ca\characters\Heads\male\Miles\Miles";

So, how would I actually reference things like the current players head, hand, leg..so that I can return their ID and position ?

I've tried things like this, but it doesnt work:

_hand = getText (configFile >> "cfgVehicles" >> typeOf(player) >> "rightWrist");
hint format["%1",(getpos _hand)];

---------- Post added at 06:12 PM ---------- Previous post was at 05:42 PM ----------

Oh and is it possible to return the position of a players weapon?

Edited by nullsystems

Share this post


Link to post
Share on other sites

I would like to know how to get a body part's position as well.

Share this post


Link to post
Share on other sites

can't help with your main question and I'm not sure what you mean by 'position' of units weapon but you can use 'WeaponDirection' to find where the weapon is pointing.

check the comref for instructions on weaponDirection it my suit your needs.

Share this post


Link to post
Share on other sites

Thanks, but what im looking for is literally what I said...

The actual world position of a units body part or weapon.

Since each unit is made of up various parts ( and we can access various hit points using SetHit )...there must be some way for it to work :(

Share this post


Link to post
Share on other sites

there is the command selectionPosition which returns the position of a selection (in the Memory-LOD ?) in modelspace

- but I think it's not really exact for body parts (position and size of a selection in memory-LOD and 1.000-LOD aren't necessarily the same)

- you can check the soldier.p3d of the example mlods to get an idea

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  

×