Home   Help Search Login Register  

Author Topic: Detecting if a unit is proned  (Read 6519 times)

0 Members and 1 Guest are viewing this topic.

Offline Nemesis6

  • Members
  • *
Detecting if a unit is proned
« on: 23 Apr 2005, 15:23:56 »
Is this possible in any way? I tried (getpos player select 2), but that only works when the terrain is rugged, and it's not reliable... so, help?

EDIT: Maybe this should have been in the General section...
« Last Edit: 23 Apr 2005, 15:27:57 by Nemesis6 »
I am actually flying into a star... this is incredible!

Offline Blanco

  • Former Staff
  • ****
Re:Detecting if a unit is proned
« Reply #1 on: 23 Apr 2005, 17:52:50 »
AFAIK not possible in any way.
It's only possible in VBS1 (that's what I heard)
« Last Edit: 23 Apr 2005, 21:15:16 by Blanco »
Search or search or search before you ask.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detecting if a unit is proned
« Reply #2 on: 23 Apr 2005, 21:09:55 »
I was once working on a workaround for this problem, but it seems to be impossible to do... :(

My idea was to drop a very short 'lifed' particle on some named selection (of the 3D model) position and then compare that position's height to some initial value to get the units stance but all I found out was that the named selections on the model don't seem to follow the units animations...
The position returned always the same height, no matter what the units stance was...

And I confirmed the named selection's position was returned otherwise correctly as the x and y axis positions changed if the unit moved...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

DBR_ONIX

  • Guest
Re:Detecting if a unit is proned
« Reply #3 on: 30 Apr 2005, 14:10:09 »
I think it's possible on AI using animationPhase or something (can't remeber exactly)
..but not sure
- Ben

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detecting if a unit is proned
« Reply #4 on: 30 Apr 2005, 16:24:33 »
Nope, animationPhase is used to 'detect' O2 anims (like doors on houses etc) not .rtm anims that are used for example on the stances...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Detecting if a unit is proned
« Reply #5 on: 01 May 2005, 03:50:57 »
This problem needs major solving.

One idea is to use a 'latent' function (i.e. script), camcreate a smoke grenade (or something) and pass it briefly over the unit at a specific height, then return you a global variable, true or false based on whether the object hit the unit (standing up) or not (lying down).

Pros - It works (much of the time).
Cons- Not reliable
        - It doesn't work if the unit is faliing (units tend to fall upside down)
        - It doesn't work if the unit it on a very steep incline (can hit the unit's head or legs, or the ground)
        - It sometimes fails if the unit is running (level or non-level terrain)
        - It is latent, so it doesn't instantly return you a value. Consequently you have to take this into account in a script

Another method is (getpos this select 2) < 0.0135 or whatever it is, which you mentioned in your post.

Pros - It occaisionally works!
Cons- It is very unreliable
        - Only works on inclines
        - The 0.0135 value changes

Someone mentioned a while ago using a 'fired' evenhandler, comparing the height of fired ammo to the unit's height. The returned value is quite reliable, only you have to wait until the unit shoots (or force it to shoot), which would make it a VERY latent function (unpredictably so), would interfere with the scenario that the script was working in, and would make it dependent on whether the unit had ammo, was reloading etc.
« Last Edit: 01 May 2005, 03:54:08 by Fragorl »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Detecting if a unit is proned
« Reply #6 on: 01 May 2005, 14:02:40 »
I've looked into this and found several solutions to this problem. I decided that two of them are reliable enough to document. But I haven't got round writing the tutorial yet. It's very much possible, just gimme your spare time. :P

:beat: *Gets Shot* :beat:
« Last Edit: 01 May 2005, 14:03:54 by dmakatra »

Offline Jezuro

  • Members
  • *
  • Hookah 4 lyfe!
    • Jezuro's ArmA Workshop
Re:Detecting if a unit is proned
« Reply #7 on: 01 May 2005, 14:17:01 »
I've looked into this and found several solutions to this problem. I decided that two of them are reliable enough to document. But I haven't got round writing the tutorial yet. It's very much possible, just gimme your spare time. :P
Anything concerning camera targeting? I've also wanted to look at this problem and I believe that cameras (without camera view, of course) could solve it. But I've been too lazy to stop thinking and start testing so far  :)
"We are Her salvation, and through Her command we shall live forever. I will not die. Not here. Not now. Never!!!"

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detecting if a unit is proned
« Reply #8 on: 01 May 2005, 17:34:30 »
I've been assing about with the camera stuff actually a while back...
And completely forgot about it, so thanks a bunch for reminding me  :o

I found the old files and after a quick test it seems to work semi-perfectly ;)
Prone is easy to detected but crouch/standing up requires a bit more, but shouldn't be too hard :P ...

EDIT:
Of course this can be used only on the player(s)...
The AI doesn't press any buttons when it changes stances... ::)
« Last Edit: 01 May 2005, 18:51:27 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Detecting if a unit is proned
« Reply #9 on: 01 May 2005, 22:43:46 »
@dmakatra

Can you outline the bare bones of your method/s?

Offline Nemesis6

  • Members
  • *
Re:Detecting if a unit is proned
« Reply #10 on: 02 May 2005, 16:17:09 »
HateR, could you maybe post an example of this camera method? I'd like to see how it works, and of course, get my hands on it! :)
I am actually flying into a star... this is incredible!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detecting if a unit is proned
« Reply #11 on: 02 May 2005, 18:39:35 »
Just 'utilize' the Keyboard input script by hardrock (and Vektorboson)...
http://www.ofpec.com/editors/resource_view.php?id=760

But that won't work for the AI :(...

dmakatra, you really should post yer findings, or are you just trying to get faster up to 4000 posts ;)
« Last Edit: 02 May 2005, 18:39:56 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Detecting if a unit is proned
« Reply #12 on: 02 May 2005, 18:59:50 »
Oh, they're all mine. ALL MINE! ;D

I'm still doing some researching in the subject. But I got thursday (or is it tuesday? I never learn to keep those two apart) and friday off from school so I got time to work on it then. :)

:beat: *Gets Shot* :beat:

EDIT: Dude, I've totally missed that keyboard thingy. Awesome stuff! :wow:
« Last Edit: 02 May 2005, 19:04:32 by dmakatra »

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Detecting if a unit is proned
« Reply #13 on: 02 May 2005, 19:07:22 »
Quote
My idea was to drop a very short 'lifed' particle on some named selection (of the 3D model) position...
How do you do that? I thought you could only pass either an object or a position to the 'drop' command. Are you saying you can drop relative to some specific part of an object's model?

Quote
Just 'utilize' the Keyboard input script by hardrock (and Vektorboson)...
Jezuro mentioned camera targetting, which would be different than a controlable camera (inertial..? whatever its called). I know there was a skiing script written a while back that cleverly used cameras to determine the slope of the ground, so perhaps Jezuro is thinking of a similar method? Not sure how that would work though...


Another, general problem with any 'detect unit stance' function is that there are many different types of 'prone', 'crouched' or 'standing' animations. Pistol vs rifle, for one example. There could be infinite more possibilities, dependin on how many anims people make. How the computer determines if it is 'up' or 'down' depends entirely on how it is configured. Whether this matters or not would depend on what you need to do with this function though, I would suppose...
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detecting if a unit is proned
« Reply #14 on: 02 May 2005, 20:24:12 »
Quote
How do you do that? I thought you could only pass either an object or a position to the 'drop' command. Are you saying you can drop relative to some specific part of an object's model?
yes.. I thought this was almost common knowledge... :-[
Code: [Select]
drop["cl_basic","","Billboard",0.01,0.01,"here you can put the model part",[0,0,0],0,1,10,0,[0.1],[[0,0,0,0]],[0],0,0,"","pos.sqs",the 'target' unit]
the model part can be anything that has been named in the model, for example a proxy...
The position of the particle is passed into the script that can be executed from the drop[] line...

The pos.sqs would look like this:
_position = _this

However, the z axis of the position doesn't change even though the unit changes it's stance/pose...
The x and y do change but they can't be used as a reference data...
I also confirmed that the z pos does work, for example using this method on a chopper makes the z position change as well when the chopper changes altitude...

Quote
I know there was a skiing script written a while back that cleverly used cameras to determine the slope of the ground, so perhaps Jezuro is thinking of a similar method? Not sure how that would work though...
Any idea where that skiing script could be found...
Even if it wouldn't work in this case I  sure could find some other uses for such method...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.