Home   Help Search Login Register  

Author Topic: Get center of dead unit.  (Read 2790 times)

0 Members and 1 Guest are viewing this topic.

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Get center of dead unit.
« on: 11 Feb 2010, 08:49:45 »
You might say, how do I find the dead-center haha :D

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?

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Get center of dead unit.
« 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 »
I love ofp

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Get center of dead unit.
« Reply #2 on: 11 Feb 2010, 14:23:15 »
Thankfully in A2 selectionPosition finally fully works, even with the dead :good:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Get center of dead unit.
« 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.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Get center of dead unit.
« 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.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Get center of dead unit.
« 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 »
I love ofp

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Get center of dead unit.
« 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 ;))

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Get center of dead unit.
« 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"] ;

I love ofp

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Get center of dead unit.
« Reply #8 on: 15 Feb 2010, 02:12:33 »
It seems that pelvis does indeed work :)

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

Thanks to all :)

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Get center of dead unit.
« Reply #9 on: 15 Feb 2010, 09:53:03 »
Quote
the flies were always rather annoyingly centered around the feet area

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

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline DMarkwick

  • Contributing Member
  • **
  • I'm a llama!
Re: Get center of dead unit.
« 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? ;)