Jump to content
Sign in to follow this  
demonhunter212

No Prone during Combat

Recommended Posts

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 biggrin_o.gif.

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. confused_o.gif

Share this post


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

Operand 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

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

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

wink_o.gif

Linker Split

Share this post


Link to post
Share on other sites
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

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

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
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×