demonhunter212 0 Posted December 1, 2006 Hello, im am creating a mission in Iraq with the American and British Infantry at a base that suddenly comes under attack by lots of insurgents.....but im still in the planning phase . There won't be much cover for the insurgents so i'm wondering if there is a way for any unit not to go prone in action? Normally in combat in OFP if a unit even hears a snap from a bullet hitting a wall they hit the dirt and if the insurgents go prone then they become sitting ducks. Share this post Link to post Share on other sites
Metal Heart 0 Posted December 1, 2006 Quote[/b] ]person setUnitPos modeOperand types: person: Object mode: String Type of returned value: Nothing Description: Set unit position rules. Mode may be one of: * "DOWN" - person goes prone and stays prone. * "UP" - person stands and stays standing. * "AUTO"- person chooses mode according to circumstances. Example: loon1 setUnitPos "UP" http://www.ofpec.com/COMREF/ Share this post Link to post Share on other sites
Flingotravels 0 Posted December 29, 2006 How would I apply this command to all units in the mission? Share this post Link to post Share on other sites
chris330 0 Posted December 31, 2006 Do you really mean all units in the mission? There is a quick way of doing it using an array of all groups in the mission and running the command on them. It will force all of them to stay permanently up though, and also it means they can never return to the weapon on back strolling animations you see in safe mode until you change their position back to auto. Share this post Link to post Share on other sites
Linker Split 0 Posted December 31, 2006 Create a trigger bigger as the map (50000x50000 i.e) and activation by the side you want the soldiers to stand or to go down... then in the "ON ACTIVATION" field write: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x setUnitPos "UP"} forEach thislist Linker Split Share this post Link to post Share on other sites
Flingotravels 0 Posted January 2, 2007 Create a trigger bigger as the map (50000x50000 i.e) and activation by the side you want the soldiers to stand or to go down...then in the "ON ACTIVATION" field write: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x setUnitPos "UP"} forEach thislist That didn't seem to work. Whenever they hear gunshots they go prone, instead of killing zombies. Perhaps something in a game logic? Share this post Link to post Share on other sites
Flingotravels 0 Posted January 14, 2007 This seems like a simple question. Does anyone have a solution? Share this post Link to post Share on other sites
chris330 0 Posted January 14, 2007 Put the units you want to do this into groups. Then for every group run this command: (_x setunit pos "up") foreach mygroup If that doesn't work it might need this next little tweak: (_x setunit pos "up") foreach units mygroup That will work. Share this post Link to post Share on other sites
Metal Heart 0 Posted January 14, 2007 That won't work, it's setUnitPos without the space and () are only used in arithmetic and conditions. For code blocks you should always use {}, although "" will usually work too. Group is just the id for a group, forEach only works with arrays. Use units to get the array of units in a group. This would be correct: {_x setUnitPos "UP"} forEach units groupname Linker Split's example works. If it doesn't, you're doing something wrong or the units are created dynamicly. Remember that triggers don't activate again unless they deactivate first. To create a trigger that setUnitPosses everyone in it constantly every 5 seconds: activation: anybody, repeatedly name: prone_trig condition: time mod 5 < 1 onActivation: {_x setUnitPos "UP"} forEach list prone_trig Share this post Link to post Share on other sites
Flingotravels 0 Posted January 16, 2007 That won't work, it's setUnitPos without the space and () are only used in arithmetic and conditions. For code blocks you should always use {}, although "" will usually work too.Group is just the id for a group, forEach only works with arrays. Use units to get the array of units in a group. This would be correct: {_x setUnitPos "UP"} forEach units groupname Linker Split's example works. If it doesn't, you're doing something wrong or the units are created dynamicly. Remember that triggers don't activate again unless they deactivate first. To create a trigger that setUnitPosses everyone in it constantly every 5 seconds: activation: anybody, repeatedly name: prone_trig condition: time mod 5 < 1 onActivation: {_x setUnitPos "UP"} forEach list prone_trig This worked perfectly, thank you! Share this post Link to post Share on other sites