Jump to content
Sign in to follow this  
Mani2

How do you get em to crouch?

Recommended Posts

I know that it's possible to force an ai unit to stand or hit the dirt but recently I noticed that it may be possible to force them to crouch down aswell. If you use ECP then you may know what I'm getting on at. During the ECP version of the Desert island intro cut scene, many of the soldiers are crouching.

I would normaly just open up the mission and find out for myself but the ECP version is hidden somewhere and i can't seem to find it anywhere. sad_o.gif

If anyone can help me on this, I would be very greatfull.

Viva OFP. smile_o.gif

Share this post


Link to post
Share on other sites

try this

soldier switchmove "combattocrouch"; soldier dostop true

play around with this and u figure it out

im not sure bout the anim name sort that plz from an anim ressource

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">soldierOne setUnitPos "Down"

Share this post


Link to post
Share on other sites

Hmmm, no joy so far. The <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">setunitpos "down" only get's the ai to dive onto the ground.

All the same, thanks for the help so far folks biggrin_o.gif

Edit: typo

Share this post


Link to post
Share on other sites

guy switchmove "crouch" ; guy setunitpos "UP"

You can try switching these around and Im not sure why you need to say "unitpos 'UP' " but it works.

PS : Remember you cant do any switchmoves via init fields wink_o.gif

Share this post


Link to post
Share on other sites

Ok, I'm getting somewhere now. I,ve put the line into the activation field of a move waypoint. The soldier jogs over to where I want him to go. To my delight, he crouches. But my hopes are shatered, when he imediatly stands back up, turns round and shoots me! wow_o.gif

I guess the next step is getting the fellow to stay put after he crouches. I've tried adding  "dostop guy" to the line in the activation field but no luck.  sad_o.gif

Again, thanks for all your help so far. biggrin_o.gif

Share this post


Link to post
Share on other sites

try

mysoldier switchmove "CombatToCrouch"; mysoldier dostop true

i additon u can try mysoldier setspeedmode "Limited"

or mysoldier setbehaviour "Stealth"

it works best if u use a script for this

dont faint nothing hard

Example

Crouch.sqs < thats hwo u name the scriptfile

CONTENT:

soldier doStop true

soldier switchmove "CombatToCrouch"

~5

soldier doStop false

soldier switchmove "Standbase"

i think its pretty simpe and u shoudl see thru this

the delay (~5) cn be any number depending on how long u want the soldier to stop, this onyl works in scripts

manticore

Share this post


Link to post
Share on other sites

The correct way is:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> unitname switchmove "crouch"; unitname setunitpos "UP";unitname stop true

That will make him stay down but because of the stop command he will not shoot.

Share this post


Link to post
Share on other sites

I found an init line on OFPEC that uses "Switchmove". To get it to work you need to use "this setbehaviour "combat"" to get it to work though. The crouching soldier remains crouched, can fire and will only stand up to throw a grenade.

Thanks for all your help folks. The static ai in my missions can make better use of cover now. Should even make building clearence more tricky too:D

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> This setbehaviour "combat"; This SwitchMove "CombatToCrouch"; This setunitpos "up"

Share this post


Link to post
Share on other sites

You can use the crouch ICPanims, AI is able to turn,aim and shoot and they will stay low because they are in the animation. Nice for trenchfights.

Share this post


Link to post
Share on other sites

Er... how do you do that then? That sounds like it may be what I'm after. smile_o.gif

I may as well explain exactly what I'm after.

I have an ai in the doorway of a house. I want him to start in Safe mode, with his gun on his back. When the alarm is triggered, I want him to crouch in the doorway and stay there.

The first bit is just a case of getting him into safe mode. which is easy enough. However, once he spots me he hits the dirt and vanishes into the houses stairs and start shooting at nothing! He then sorts his aim out and targets me as normal. He won't crouch at all now:(

You would have thought all this was standard procedure was pretty realistic for a soldier.

Stand about bored, alarm goes off, get gun ready and crouch to make use of your cover.

Why on earth has BIS made it so difficult to implement? sad_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]

I have an ai in the doorway of a house. I want him to start in Safe mode, with his gun on his back. When the alarm is triggered, I want him to crouch in the doorway and stay there

Thats exactly what I did with those ICPanims.

I'm working on a script where AI start in a random safe position (sitting, stand or crouched), once they spot the enemy they take their gun, crouch and stay in position.

This transition (animation-wise) occurs as smooth as possible.

They can turn, aim, shoot and reload. But they only can move and switch back to default animation when a certain condition is met. (fleeing, hit, whatever...)

I've already released a test but the links are down because my host deleted his site by accident  sad_o.gif  

But I'm planning an update.

read this topic @ Ofpec

 

Share this post


Link to post
Share on other sites

Wow!!!

Blanco, that is exactly what I'm after.

Where did that other guy get his trenches addon from, that would realy give my squad something to worry about? smile_o.gif

If you can let me know when your site is back up and I can get my hands on the goods, I'll be a very happy man. biggrin_o.gif

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
Sign in to follow this  

×