Mani2 0 Posted July 16, 2004 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. If anyone can help me on this, I would be very greatfull. Viva OFP. Share this post Link to post Share on other sites
nephilim 0 Posted July 16, 2004 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
raedor 8 Posted July 16, 2004 <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
Mani2 0 Posted July 16, 2004 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 Edit: typo Share this post Link to post Share on other sites
Sniper_Kyle 0 Posted July 16, 2004 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 Share this post Link to post Share on other sites
Mani2 0 Posted July 16, 2004 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! 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.  Again, thanks for all your help so far. Share this post Link to post Share on other sites
nephilim 0 Posted July 16, 2004 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
Sniper_Kyle 0 Posted July 17, 2004 Search the FAQ / Forum over at the OFP Editing Center because I think this was answered there. Share this post Link to post Share on other sites
Maddmatt 1 Posted July 18, 2004 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
nephilim 0 Posted July 19, 2004 strange my soldiers shoot when i use this to le´tem crouch... Share this post Link to post Share on other sites
Mani2 0 Posted July 19, 2004 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
Blanco 0 Posted July 19, 2004 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
Mani2 0 Posted July 19, 2004 Er... how do you do that then? That sounds like it may be what I'm after. 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? Share this post Link to post Share on other sites
Blanco 0 Posted July 19, 2004 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   But I'm planning an update. read this topic @ Ofpec  Share this post Link to post Share on other sites
Mani2 0 Posted July 19, 2004 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? 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. Share this post Link to post Share on other sites