OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: penguinman on 25 Feb 2005, 02:02:27

Title: crouch
Post by: penguinman on 25 Feb 2005, 02:02:27
hey

how do u get AI to do the exact same position that the player would get if he pressed the "Q" key on the keyboard.

the crouch position where he can still turn and aim and stuff. i want that for AI soldiers
Title: Re:crouch
Post by: bedges on 25 Feb 2005, 02:20:45
you can either try

Code: [Select]
loon_name switchmove "CombatToCrouch"
which will play the animation, but won't last very long, or

Code: [Select]
loon_name setbehaviour "combat"
which will let the loon make up its own mind whether or not it wants to go prone, or get down on one knee and propose with bullets (how romantic  :-*) or stay standing....

the simple answer is you can't.
Title: Re:crouch
Post by: Blanco on 25 Feb 2005, 02:48:20
Use this :

Code: [Select]
_unit = _this select 0
dostop _unit


#loop
?alive _unit : exit
_unit setbehaviour "combat"
_unit setcombatmode "yellow"
dostop _unit
~1
#getdown
~1
_unit setbehaviour "combat"
~0.1
_unit setunitpos "up"
~2

_unit playmove "combattocrouch"
_unit playmove ""
~ (random 5) + 5
goto "loop"
He will popup once a while.

Title: Re:crouch
Post by: dan ick on 25 Feb 2005, 03:13:35
 ;D Hi

           You could also try this in the init field

This setbehaviour "combat";this switchmove "combattocrouch";this setunitpos "up".

I think this is right,if not its jus in a diff order,but they are the 3 commands you will need.

                                 Good Luck ;D
Title: Re:crouch
Post by: THobson on 25 Feb 2005, 08:33:51
Should it be:

?!(alive _unit) : exit