OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: sergeantmajor1 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.
-
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
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.
-
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.
-
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.
-
has this question been asked about a million times
Although not on this site, the official BI forums has a topic here (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=7d5b4a5befd8e0430f5f0e49b1ae4d4c;act=ST;f=7;t=26723) with the byline of:
Stuff already answered a million times..
Wadmann