Home   Help Search Login Register  

Author Topic: unit position and weapon in hand  (Read 1919 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
unit position and weapon in hand
« on: 16 Apr 2007, 01:15:23 »
Call me lazy, but as far as I can tell ArmA has neither commands to:
1) report an infantry unit's stance(prone/crounching/standing)
2) report which weapon an infantry unit has selected(in particular I would like to know whether a unit has selected binoculars or not)

Please prove this lazy old fart wrong....
urp!

Offline RaymondLu

  • Members
  • *
Re: unit position and weapon in hand
« Reply #1 on: 16 Apr 2007, 08:27:58 »
1) try unitPos

Description:
Return the unit position rules.

Syntax

Syntax:
unitPos person
Parameters:
person: Object
Return Value:
String


2) i'm still think about that.

#removed unnecessary quote of entire previous post - bedges
« Last Edit: 16 Apr 2007, 11:47:12 by bedges »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: unit position and weapon in hand
« Reply #2 on: 16 Apr 2007, 09:33:03 »
RaymondLu, do not quote the entire previous post if you're replying to it.

Anyways, unitPos only returns what the stance rules are for the unit set with the setUnitPos/setUnitPosWeak..
It has nothing to do with getting the unit's stance.. :(
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: unit position and weapon in hand
« Reply #3 on: 16 Apr 2007, 11:53:32 »
Didnt test it, but i'm convinced modeltoWorld uses Z = 0 for the head. So, modeltoWorld [0,0,0] would return different Z for prone/crounching/standing.

Offline Cheetah

  • Former Staff
  • ****
Re: unit position and weapon in hand
« Reply #4 on: 16 Apr 2007, 16:51:04 »
Or use a command which returns the animationState of a soldier.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: unit position and weapon in hand
« Reply #5 on: 16 Apr 2007, 18:36:24 »
Code: [Select]
unit modelToWorld [0,0,0]Returns a very small z height that varies slightly with the altitude of your location. On flat ground the z height does not change with stance. On sloped ground it changes even less with stance.

animationState would work but I need to search the returned string for the substring "BINDNON" if I want my script to work with different units.

edit: PositionCameraToWorld might work for the stance...

edit2: nope. no way to hook player's camera

edit3: BIS included a switchCamera command. Why did they not include a command to return which camera type a player is using or what cutResource for that matter?
« Last Edit: 16 Apr 2007, 19:17:28 by Mr.Peanut »
urp!


Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: unit position and weapon in hand
« Reply #7 on: 17 Apr 2007, 17:10:54 »
Found another solution here
urp!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: unit position and weapon in hand
« Reply #8 on: 17 Apr 2007, 22:06:11 »
Do you mean looking for substrings into unit current anim phase or something like that?