Jump to content
darkdexter

How: Animation Combat walk slow

Recommended Posts

You guys know when we press F while our guns are out, we walk in a slow combat stance as if we are aiming while walking. What is the animation code for this when making the AI do it?

this switchmove "X" ?? what would be the X

and what do i do to make them stay in a static pose or at least make an animation in a loop

Reason for this is i wanna make a combat scene, take good clean screenshot and edit it to a wallpaper/desktop background.

Edited by darkdexter

Share this post


Link to post
Share on other sites

WP with slow speed mode and combat behaviour

Share this post


Link to post
Share on other sites

hi,

You guys know when we press F while our guns are out, we walk in a slow combat stance as if we are aiming while walking. What is the animation code for this when making the AI do it?

this switchmove "X" ?? what would be the X

and what do i do to make them stay in a static pose or at least make an animation in a loop

Reason for this is i wanna make a combat scene, take good clean screenshot and edit it to a wallpaper/desktop background.

the animations you are searching are:

CivilWalkB // unit will walk back
CivilWalkF // unit will walk forward
CivilWalkL  // unit will walk left
CivilWalkLB  // unit will walk left back
CivilWalkLF // unit will walk left forward
CivilWalkR  // unit will walk right
CivilWalkRB // unit will walk right back
CivilWalkRF // unit will walk right forward

I didn't tested but I don't think it'll work since the unit will perform animation and it will go back to normal behaviour. If you want to make AI move with animation I think you have to use trial and error to obtain what you want. It will take long time if you have complexe stuffs to do.

Better to use setUnitPos write in the init field of the unit this setUnitPos "UP" and setSpeedMode or change the speed mode to limited in a waypoint and setBehaviour or change the behaviour to stealth not combat (tested in editor). The best and easiest choice is to use waypoints to change speed and behaviour. It means the unit's first waypoint will be stealth, limited.

DEMO LINK

BTW, if you want that AI perform very precise stuff it will take forever and due to ofp randomness it will not work everytime.

cya.

Nikiller.

Edited by Nikiller

Share this post


Link to post
Share on other sites

i tried the stealth way point but instead they just prone and crawl. and CivilWalk commands dont work. i guess il try the setunit commands

---------- Post added at 11:16 PM ---------- Previous post was at 11:02 PM ----------

hi, just to let you know the unitpos up setting to stealth limited works. Thanks man.

So what does the UP meant?

Share this post


Link to post
Share on other sites

hi,

i tried the stealth way point but instead they just prone and crawl. and CivilWalk commands dont work. i guess il try the setunit commands

Did you tried the demo mission I uploaded?

hi, just to let you know the unitpos up setting to stealth limited works. Thanks man.

Ho ok, glad it works. ;)

So what does the UP meant?

It means that unit stands and stays standing at all cost even if it is under fire. Of course, if the unit can't walk because it's injured, it'll crawl. You can go back to normal stand position by using this setUnitPos "AUTO".

Mode may be one of:

- "DOWN" - unit goes prone and stays prone.
- "UP" - unit stands and stays standing.
- "AUTO" - unit chooses mode according to circumstances.

source: http://community.bistudio.com/wiki/setunitpos

cya.

Nikiller

Edited by Nikiller

Share this post


Link to post
Share on other sites

how about if you want them to crouch?

"Middle" seems like it says its only for Arma

Share this post


Link to post
Share on other sites

hi,

how about if you want them to crouch?

"Middle" seems like it says its only for Arma

I think it would be better to open a new topic for that, I mean for other mission makers interested by making a unit crouch :)

I coded a little script to make a unit crouch. SP/MP compatible.

crouch.sqs

;*****************************************
;Unit Crouch Script by Nikiller v0.9b
;Make a unit in crouch position
;contact: nikillerofp@hotmail.fr
;[unitName] exec "crouch.sqs"
;*****************************************

_u = _this select 0

if (local _u) then {} else {goto "ende"}

if (alive _u) then {_u setUnitPos "UP"; _u setBehaviour "COMBAT"}
_d=2
_a="crouch"

#crouch
~_d
if (alive _u) then {if (speed _u == 0) then {_u playMove _a}; goto "crouch"}

#ende

exit

I made a little demo to show how it works.

DEMO LINK

NB: Better to use this script for AI only.

cya.

Nikiller.

Edited by Nikiller
Tested locality in MP and it works!

Share this post


Link to post
Share on other sites

Thanks alot Nikiller, you seems to know a lot about OFP mission editing/scripting.

I have another yet noobishly annoying question for ya.

How do I make an AI fire in auto or fast burst using Ini/anims/script codes?

while they are in assigned pose

For ex. using your crouch position and they will fire in fully auto mode at assigned target using

"Unitname DoFire "X" or maybe shooting at nothing at all.

Share this post


Link to post
Share on other sites

hi,

As I said yo should really open a new topic :p

Ho, and BTW I improved the crouch script code, instead of alive check I use a canStand check like that if the unit can't walk it'll not execute the script anymore.

crouch.sqs

;************************************
;Unit Crouch Script by Nikiller v0.9b
;Make a unit in crouch position
;contact: nikillerofp@hotmail.fr
;[unitName] exec "crouch.sqs"
;************************************

_u = _this select 0

if (local _u) then {} else {goto "ende"}

if (alive _u) then {_u setUnitPos "UP"; _u setBehaviour "COMBAT"}
_d=2
_a="crouch"

#crouch
~_d
if (canStand _u) then {if (speed _u == 0) then {_u playMove _a}; goto _a}

#ende

exit

Thanks alot Nikiller, you seems to know a lot about OFP mission editing/scripting.

I have another yet noobishly annoying question for ya.

How do I make an AI fire in auto or fast burst using Ini/anims/script codes?

while they are in assigned pose

For ex. using your crouch position and they will fire in fully auto mode at assigned target using

"Unitname DoFire "X" or maybe shooting at nothing at all.

There's 2 solutions for what you want to do

1st solution (without addons):

You need to force the unit fire on the target. So, here's a little script to make unit fire on a target.

dofire.sqs

;***************************************
;Unit Fire Script by Nikiller v0.9b
;Make a unit fire on a target
;contact: nikillerofp@hotmail.fr
;[unitName,targetName] exec "dofire.sqs"
;***************************************

_u = _this select 0
_t = _this select 1

if (local _u) then {} else {goto "ende"}

_d=0.5

_u reveal _t
~_d
_u doTarget _t
~_d
_u doFire _t

#ende

exit

Now you want that the unit to fire a lot on his target so you must make the target invulnerable or at least very hard to kill.

invulnerable.sqs

;*************************************
;Invulnerable Script by Nikiller v0.9b
;Make a unit invulnerable
;NOTE: it's not 100% reliable
;contact: nikillerofp@hotmail.fr
;[unitName] exec "invulnerable.sqs"
;*************************************

_u = _this select 0

if (local _u) then {} else {goto "ende"}

_u addeventhandler [{dammaged},{(_this select 0) setdamage (damage (_this select 0)-(_this select 2))}]
_u addeventhandler [{hit},{(_this select 0) setdamage (damage (_this select 0)-(_this select 2))}]

#ende

exit

I made a little demo to show how it works.

DEMO LINK

2nd solution (with addon)

You must use an invisible target addon. This addon will force AI to fire. I quickly made a little addon (nik_target.pbo) that I included in the demo archive then don't forget to load it or it wont work :)

I made a little demo to show how it works.

DEMO LINK

Use the first or the second solution it depends what you want.

cya.

Nikiller.

Edited by Nikiller

Share this post


Link to post
Share on other sites

your nik target works great at daytime but at dawn,sunset and full night time setting the AI won't fire. Also they can't detect it when it is placed beyond 150 meters.

But its beter than nothing. Thanks!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×