Home   Help Search Login Register  

Author Topic: Standing guards  (Read 1424 times)

0 Members and 1 Guest are viewing this topic.

j-man

  • Guest
Standing guards
« on: 16 Mar 2005, 04:58:19 »
I'm creating a mission where there are a bunch of guards standing around a gate. The soldiers are placed in very specific spots. The problem is that when ever a gun is fired, the soldiers switch to 'aware' mode, lay down on the ground, and then stand back up and switch back to 'safe' mode. As soon as they lay down, their positioning gets all messed up. I tried using "unit setUnitPos "UP"", but that puts the soldiers in 'aware' mode. Is there some way I can have the soldiers in 'safe' mode, but as soon as they switch to 'aware' mode, they wont lay down?  ???

Offline Sentinel

  • Contributing Member
  • **
  • World is tough and I'm tougher!!
Re:Standing guards
« Reply #1 on: 16 Mar 2005, 10:15:36 »
SetUnitPos has worked with me fine. Perhaps you have one too many quotation marks.

Code: [Select]
this setunitpos "up"
Or if you're using foreach command

Code: [Select]
{_x setunitpos "up"} foreach array

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Standing guards
« Reply #2 on: 16 Mar 2005, 10:46:00 »
I think it was General Barron who made a wee script to help with this kind of thing.    
Plenty of reviewed ArmA missions for you to play

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Standing guards
« Reply #3 on: 16 Mar 2005, 10:47:34 »
A rare case of AI being too intelligent??  You can't stop "SAFE" troops reacting and going into "AWARE" or "COMBAT", SetUnitPos will just make them stand in that heightened state.

The easy way round this is to put your guards in "CARELESS", then they won't react to fire (unless it hits them).  You can always change their Behaviour to "SAFE" or greater when you want them to react.

Kyle Sarnik

  • Guest
Re:Standing guards
« Reply #4 on: 16 Mar 2005, 21:33:36 »
I'm creating a mission where there are a bunch of guards standing around a gate. The soldiers are placed in very specific spots. The problem is that when ever a gun is fired, the soldiers switch to 'aware' mode, lay down on the ground, and then stand back up and switch back to 'safe' mode. As soon as they lay down, their positioning gets all messed up. I tried using "unit setUnitPos "UP"", but that puts the soldiers in 'aware' mode. Is there some way I can have the soldiers in 'safe' mode, but as soon as they switch to 'aware' mode, they wont lay down?  ???

Eh, seems you all understood him wrong, looks like he wants his soldiers to start in safe mod, and then, if they ever switch to aware, make them stand. Yes you could make a script for this, but it would mean cause some problems. Once unit is in aware mode, he won't enter safe mode automaticly (since hes on setunitpos "up"), so he would remain on aware untill you switch his unitpos to "AUTO". You could get around this by making the script have a set time the unit remains in aware state before returning to safe. And if I am right, units in careless won't even react to anything at all (enemys, fire, hits), they basicly just stay in safe mode untill they are killed.

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Standing guards
« Reply #5 on: 16 Mar 2005, 23:34:15 »
I tried using "unit setUnitPos "UP"", but that puts the soldiers in 'aware' mode.

Ambiguity aplenty, but I thought it was the "AWARE" stance that was part of the problem.  

UnitPos is independent of the Behaviour - telling it to "UP" won't stop the unit changing from "SAFE" to "AWARE" then "COMBAT", which they must be doing to want to lie down ("AWARE" units don't lie in my experience).  The only way I know to stop the AI's Behaviour changing is to use "CARELESS" without scripts.

A more interesting question is why the slight position change when a unit lays down then gets up again is so critical?  Camera script?  I know the problem as I've had units inch themselves off of rooves and balconies.

Kyle Sarnik

  • Guest
Re:Standing guards
« Reply #6 on: 17 Mar 2005, 00:04:11 »
Ambiguity aplenty, but I thought it was the "AWARE" stance that was part of the problem.  

UnitPos is independent of the Behaviour - telling it to "UP" won't stop the unit changing from "SAFE" to "AWARE" then "COMBAT", which they must be doing to want to lie down ("AWARE" units don't lie in my experience).  The only way I know to stop the AI's Behaviour changing is to use "CARELESS" without scripts.

A more interesting question is why the slight position change when a unit lays down then gets up again is so critical?  Camera script?  I know the problem as I've had units inch themselves off of rooves and balconies.

But thats where you're wrong. As j-man allready stated and I allready knew, putting a units unitpos on anything other than AUTO will cause them to remain in a combat or aware state, preventing them from entering safe (well at least putting their guns away), setunitpos "up" will keep him standing, but it will also keep him in an aware state, he WILL NOT put his gun on his back no matter what you try, I promise you. Also to correct you again, units in AWARE will lie down since units in aware are allowed to switch to combat once they have made contact with an enemy, causing them to go prone. I am pretty sure there is no way to prevent automatic behaviour change (unless on careless) in a unit. Anyways, j-man, this has been a problem I have been running into for a while, so my solution usualy is scripted, putting the units in careless, detecting when they make contact with an enemy, and then apply setunitpos "up" to make them switch to their weapons (and stand). However, none of my missions have required them to re enter safe mode, so no attemp for a solution in that part has been made by me.

j-man

  • Guest
Re:Standing guards
« Reply #7 on: 17 Mar 2005, 04:29:48 »
Quote
I think it was General Barron who made a wee script to help with this kind of thing.

You wouldn't happen to have a link macG? ???

Quote
...so my solution usualy is scripted, putting the units in careless, detecting when they make contact with an enemy, and then apply setunitpos "up" to make them switch to their weapons (and stand).

That's a good idea kyle. I'll try experimenting with the 'careless' behaviour.

Thakns for the tips. I'll leave this thread open for a while incase anyone comes up with some more ideas.

 :)
« Last Edit: 17 Mar 2005, 04:33:05 by j-man »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Standing guards
« Reply #8 on: 17 Mar 2005, 10:58:18 »
No, sorry.    Try the online comref for tips, the Pending pile in the Ed Depot as well as the main database, an the forum search function.
Plenty of reviewed ArmA missions for you to play

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Standing guards
« Reply #9 on: 17 Mar 2005, 11:45:53 »
The easy way round this is to put your guards in "CARELESS", then they won't react to fire (unless it hits them).  You can always change their Behaviour to "SAFE" or greater when you want them to react.

so my solution usualy is scripted, putting the units in careless, detecting when they make contact with an enemy, and then apply setunitpos "up" to make them switch to their weapons (and stand).

I'm still not sure whether we're trying to delay a guard's response or keep him standing or a bit of both, but we do seem to be in heated agreement!

All I can add is that you can also 'keep him standing' by first doing SetBehaviour "SAFE" THEN SetUnitPos "UP" - the unit will stay in the "SAFE" stance until there's a threat (but, yes, it won't go back again). That seems sensible behaviour and, if it works from init commands (which, I concede, it might not), avoids monitoring scripts and triggers. It's an option.

The bit I haven't misunderstood, as I never claimed to understand it, is why we [might] want to prevent the unit in contact from going prone (unless it's a use-of-cover issue)?  Anyway, j-man's happy to tinker so I'll shut up.