Welcome, Guest Saturday 19th April 2014, 05:20:18
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: Get center of dead unit.  (Read 561 times)
0 Members and 1 Guest are viewing this topic.
DMarkwick
Contributing Member
**
Offline Offline


I'm a llama!


« on: 11 Feb 2010, 08:49:45 »

You might say, how do I find the dead-center haha Cheesy

Anyway.

When a unit dies, it very much seems to depend on what stance the unit is in when he's killed as to the location of the boundingCenter returned value. Example:

Shoot a unit who's standing up, and even after he's fallen down dead, returning the center of the unit's position still returns a location located over his feet.
However, shoot a unit who's prone and the same center location is the actual center of his laying-down body.

I've used delays etc and various combinations of boundingCenter and modelToWorld etc, but I always get a unit's feet position when looking for a body's center position if that unit was standing when he was killed.

Anyone know what I might try next?
Logged
DeanosBeano
Addons Depot Staff
*****
Offline Offline


SirDeanosbeano bstowed on me by sui ;)


WWW
« Reply #1 on: 11 Feb 2010, 09:34:44 »

 try mandos script from arma1 , it will return the position in every stance , not sure if he converted it to A2 but it shouldnt need much.
 failing that do an array of anims and get the likely center( bit long winded).

  bounding arrays always return the array of a unit /vehicle/structure  at the moment its created , not a live update.

 infact having thought about it , selectionposition maybe your friend.
 if the spine memmory point or similar is updated with the rtm . it would look something like :
pos = unit selectionposition "spine"  iirc 
then you would get realpos = (unit modeltoworld pos) .
 away from  home  at the min so not 100% on my syntax
« Last Edit: 11 Feb 2010, 10:05:36 by DeanosBeano » Logged

I love ofp
h-
Forum
Administrator
*****
Offline Offline


Formerly HateR_Kint


WWW
« Reply #2 on: 11 Feb 2010, 14:23:15 »

Thankfully in A2 selectionPosition finally fully works, even with the dead Good
Logged

Project MCAR   ---   FWW2 - Finland At War 1939-1945
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.
DMarkwick
Contributing Member
**
Offline Offline


I'm a llama!


« Reply #3 on: 12 Feb 2010, 19:18:05 »

I don't seem to be having much luck with selectionPosition either. "spine" doesn't seem to exist (in that I don't see results) while "hit_body" has the same result as before i.e. feet position.
Logged
h-
Forum
Administrator
*****
Offline Offline


Formerly HateR_Kint


WWW
« Reply #4 on: 12 Feb 2010, 20:21:19 »

Try "Pelvis".
At least that has worked for me in the past..

That spine selections is probably "Spine3" and consists of one vertex and a proxy so that might not give the position you're looking for.
Logged

Project MCAR   ---   FWW2 - Finland At War 1939-1945
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.
DeanosBeano
Addons Depot Staff
*****
Offline Offline


SirDeanosbeano bstowed on me by sui ;)


WWW
« Reply #5 on: 12 Feb 2010, 20:27:27 »

 well i was not at my  home pc when i wrote it  but "Pelvis" is probably better.
 
  Remember at the exact moment of death the location of the center will be exactly same , it is not until the death animation is finished and the soldier is lying that you then need to get your Data .
 
  in essence if your returning the info at the moment of death then it wont be the most update position.

        

 edit seems -H already pointed out the Pelvis selection.
« Last Edit: 12 Feb 2010, 20:29:11 by DeanosBeano » Logged

I love ofp
DMarkwick
Contributing Member
**
Offline Offline


I'm a llama!


« Reply #6 on: 12 Feb 2010, 23:51:33 »

I'll try the pelvis selection thing. I also did consider the positional info at time of death, and experimented with delays to let the new pose become valid, but no luck yet. Fingers crossed with the pelvis. (One of those once-in-a-lifetime sentences for sure Wink)
Logged
DeanosBeano
Addons Depot Staff
*****
Offline Offline


SirDeanosbeano bstowed on me by sui ;)


WWW
« Reply #7 on: 13 Feb 2010, 15:23:49 »


 Pelvis works  , i know that from previous tests of my own .
 
      As to your problem returning the exact position of the body center after death , the simple solution (if you cant delay the data return till after the rtm) is to make a small addon and use attachto and use the Init of the small addon to then give you a pos ,
 If your using this for a drop effect or something then i know myself it works as i have used it for something myself.

 you could do a generic Killed eventhandler  jtdcenter attachto [deadunit,[0,0,0]","Pelvis"] ;

Logged

I love ofp
DMarkwick
Contributing Member
**
Offline Offline


I'm a llama!


« Reply #8 on: 15 Feb 2010, 02:12:33 »

It seems that pelvis does indeed work Smiley

Needed it for the JTD_Flies addon BTW, the flies were always rather annoyingly centered around the feet area.

Thanks to all Smiley
Logged
Wolfrug
Addons Depot
Administrator
*****
Offline Offline


Official OFPEC Old Timer


« Reply #9 on: 15 Feb 2010, 09:53:03 »

Quote
the flies were always rather annoyingly centered around the feet area

 Cheesy Well you know how it is after days and days out in the boons in those army boots...

Wolfrug out.
Logged

"When 900 years YOU reach, look as good you will not!"
DMarkwick
Contributing Member
**
Offline Offline


I'm a llama!


« Reply #10 on: 15 Feb 2010, 19:45:27 »

Well you know how it is after days and days out in the boons in those army boots...

Well now that the flies are centered around the pelvis area we can lay the hygiene thing down to rest.




Can't we? Wink
Logged
Pages: [1]   Go Up
  Send this topicPrint  
 
Jump to: