Home   Help Search Login Register  

Author Topic: How To make units crouch  (Read 1570 times)

0 Members and 1 Guest are viewing this topic.

sergeantmajor1

  • Guest
How To make units crouch
« on: 11 Dec 2005, 14:01:40 »
I know that this setUnitPos "UP"/"DOWN" makes a unit stand or lie down, but I have never found out how to make a unit stay crouched. I know this question makes me look like a newbie but plz help me, thanks.

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:How To make units crouch
« Reply #1 on: 11 Dec 2005, 15:16:42 »
I will show you one example how you can make AI soldiers crouch when they are not moving. Adjust this to your needs if it is not exactly what you want.

Put into a trigger:

Axis A = 0, Axis B = 0
Activation: Repeatedly
Countdown: Min = 1, Max = 1, Mid = 1
Condition: speed r1 < 0.001 && canstand r1
On Activation: r1 playmove "crouch"

where r1 is the unit you want to crouch when not moving. What it does: checks if unit's speed has been under 0.001 for at least 1 second, and also if the unit is able to be in a crouched position (not wounded too much). If these conditions are met, the trigger makes the unit crouch. When the unit starts moving again, crouching is of course over and will start again when the unit stops again.

#EDIT

Additionally you need to put

Code: [Select]
this setUnitPos "up";this setBehaviour "combat"
to the unit's initialization field (or make it in init.sqs) to get the crouching effect described above.
« Last Edit: 11 Dec 2005, 15:51:49 by Baddo »

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:How To make units crouch
« Reply #2 on: 12 Dec 2005, 01:03:08 »
Is it just me or has this question been asked about a million times.
Yet, every time its asked some one comes up with a different answer!

I think a crouching thread should just be stuck somewhere and then everyone can post their millions of different answers in it.
I like your approach, lets see your departure.
Download the New Flashlight Script!

sergeantmajor1

  • Guest
Re:How To make units crouch
« Reply #3 on: 15 Dec 2005, 19:58:10 »
Thank you very much Baddo for ur reply. Your answer works really well.
Also I agree with Rujik - it would be great for a small area on the site to have "basic" mission making info. Things like crouching, standing up and lying down can add a lot of quality to a mission. Anyway thx.

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:How To make units crouch
« Reply #4 on: 15 Dec 2005, 22:46:10 »
Quote
has this question been asked about a million times


Although not on this site, the official BI forums has a topic here with the byline of:

Quote
Stuff already answered a million times..

Wadmann
Check out my Camouflage Collection! New items added 31 July 2005.