Jump to content
Sign in to follow this  
j-man

setunitpos broken?

Recommended Posts

Is anyone else having problems with the 'setunitpos' command? If I set a unit to "this setunitpos "UP"", he always goes prone when under attack or spot an enemy. Setting the unit to "DOWN" dosn't work either. He just stands there untill someones shoots at him.

Am I doing something wrong or is this just a bug? help.gif

Share this post


Link to post
Share on other sites

This is already reported as a bug, although I don't think it really is one.

The setUnitPos command is used in the FSM of the units and therefor overrides what you set in a script. The same goes for some other scripted AI behavior.

The new way of using FSMs for AI behavior offers a lot more control but unfortunately AI scripting like it was done in OFP just got more complicated because of that.

(I think searching would have revealed some other threads just about this topic)

Share this post


Link to post
Share on other sites

I'll bet that's why a unit in "safe" mode will literally drop like a sack of potatoes when shot at and stay there till the end of a mission now, ignoring any furthe waypoints huh?

Share this post


Link to post
Share on other sites

SetUnitPos will work on a newly created unit as long as you haven't yet joined that unit to a group. I tend to agree with Romulus that what messes it up afterwards is the AI FSM. I'm currently working on a 'mad gunman' script (actively hunts down and kills anything in the vicinity) and had major problems getting the unit to do what I wanted until I realised I was fighting with the pre-existing AI. Life should be a lot easier if BIS release the FSM tools.

Share this post


Link to post
Share on other sites
I'll bet that's why a unit in "safe" mode will literally drop like a sack of potatoes when shot at and stay there till the end of a mission now, ignoring any furthe waypoints huh?

Can you elaborate on that a bit?

I couldn't reproduce that behavior and I can't remember seeing something like this in the FSM.

Life should be a lot easier if BIS release the FSM tools.

Actually I really doubt that. The FSM tool seems to only provide the control structure (branching, looping on certain conditions) while the rest is just calling hard coded functions or simple scripting. FSMs are quite easy to create even without any tools (beside a text editor).

The main problem is that those are defined in the config and there's currently no way to really override those. The DoFSM and CommandFSM commands only run beside the config FSMs and if you try to override things, there'll probably be some undefined battling between the two. (I didn't do that much testing with those new AI commands yet.)

What we need is config FSMs with scripting hooks that allow the mission designer to attach their own scripts to the config FSMs in a clean way or the mission designer needs to create custom addons with special config FSMs if he wants to have some specific AI behavior that gets in the way of the regular config FSMs.

Share this post


Link to post
Share on other sites
I'll bet that's why a unit in "safe" mode will literally drop like a sack of potatoes when shot at and stay there till the end of a mission now, ignoring any furthe waypoints huh?

Can you elaborate on that a bit?

I couldn't reproduce that behavior and I can't remember seeing something like this in the FSM.

I'll rig up a clean example mission with this problem pretty soon. I really should sleep first though, so it'll likely be a while.

The main problem is that those are defined in the config and there's currently no way to really override those.

Except overriding the config you mean.

Share this post


Link to post
Share on other sites
Quote[/b] ]FSMs are quite easy to create even without any tools (beside a text editor).

The main problem is that those are defined in the config and there's currently no way to really override those. (

That's exactly what I meant. My current script is an FSM - it's just not an "Arma AI" FSM so it is constantly battling with the AI. I was hoping that when the tools were released we could at least generate FSM files in an appropriate format for the doFSM command so as to override the existing behaviour.

Quote[/b] ]The DoFSM and CommandFSM commands only run beside the config FSMs and if you try to override things, there'll probably be some undefined battling between the two.

Really ? Have you been able to try this? It seems a bit bizarre to me that the engine would try to run 2 FSMs in parallel on the same object. I'd expect (pure speculation) that calling 'doFSM x' would cause 'x' to run exclusively until it reached the terminal state at which point the old FSM would continue/restart.

However, if you have any real experience it would be interesting to hear it.

smile_o.gif

Share this post


Link to post
Share on other sites

[yoda voice]When a game programmer you are, sense it will make to you.[/yoda voice]

Kidding of course, but I tested that some, and sorry, it doesn't do that on safe mode with a waypoint plan, it does do it on safe mode with a move order though. I would post the example mission, but I think it's probably unrelated now. It belongs somewhere else. Still, I know someone who some kind of problem with this, not sure how to reproduce it though.

Edit:

Actually, I'm undecided if it's related or not. I'll just post the test mission real quick, then yall can play with it if you like.

to use it, fire a shot near the soldiers *don't kill them though* and they'll draw their weapons. Then after a second, try to use the radio to order them someplace else. anyone who drew his weapon and got down, won't go.

mission.sqm

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

version=11;

class Mission

{

addOns[]=

{

"cacharacters",

"CATracked",

"sara",

"CAWheeled"

};

addOnsAuto[]=

{

"cacharacters",

"sara"

};

randomSeed=1174019;

class Intel

{

resistanceEast=1.000000;

startWeather=0.100000;

forecastWeather=0.300000;

year=2007;

month=6;

day=7;

hour=8;

};

class Groups

{

items=2;

class Item0

{

side="GUER";

class Vehicles

{

items=1;

class Item0

{

position[]={8180.905273,49.949997,17043.724609};

azimut=19.205421;

id=0;

side="GUER";

vehicle="SquadLeaderG";

player="PLAYER COMMANDER";

leader=1;

skill=1.000000;

};

};

};

class Item1

{

side="WEST";

class Vehicles

{

items=9;

class Item0

{

position[]={8187.643066,49.949997,17051.300781};

azimut=-344.444458;

id=1;

side="WEST";

vehicle="SquadLeaderW";

leader=1;

rank="SERGEANT";

skill=0.466667;

init="squad = group this";

};

class Item1

{

position[]={8189.187500,49.949997,17045.677734};

azimut=-344.444946;

id=2;

side="WEST";

vehicle="TeamLeaderW";

rank="CORPORAL";

skill=0.333333;

};

class Item2

{

position[]={8191.114746,49.949997,17045.136719};

azimut=-344.444946;

id=3;

side="WEST";

vehicle="SoldierWG";

skill=0.200000;

};

class Item3

{

position[]={8193.046875,49.949997,17044.607422};

azimut=-344.444946;

id=4;

side="WEST";

vehicle="SoldierWAR";

skill=0.200000;

};

class Item4

{

position[]={8194.972656,49.949997,17044.062500};

azimut=-344.444946;

id=5;

side="WEST";

vehicle="SoldierWAT";

skill=0.200000;

};

class Item5

{

position[]={8196.898438,49.949997,17043.531250};

azimut=-344.444946;

id=6;

side="WEST";

vehicle="TeamLeaderW";

rank="CORPORAL";

skill=0.333333;

};

class Item6

{

position[]={8198.822266,49.949997,17042.992188};

azimut=-344.444946;

id=7;

side="WEST";

vehicle="SoldierWG";

skill=0.200000;

};

class Item7

{

position[]={8200.751953,49.949997,17042.458984};

azimut=-344.444946;

id=8;

side="WEST";

vehicle="SoldierWAR";

skill=0.200000;

};

class Item8

{

position[]={8202.675781,49.949997,17041.916016};

azimut=-344.444946;

id=9;

side="WEST";

vehicle="SoldierWSniper";

skill=0.200000;

};

};

class Waypoints

{

items=1;

class Item0

{

position[]={8188.071289,49.949997,17053.460938};

combat="SAFE";

class Effects

{

};

showWP="NEVER";

};

};

};

};

class Markers

{

items=1;

class Item0

{

position[]={11937.480469,124.508133,15768.671875};

name="marker";

text="marker";

type="Flag";

};

};

class Sensors

{

items=2;

class Item0

{

position[]={12024.620117,125.105888,15808.062500};

a=0.000000;

b=0.000000;

activationBy="ALPHA";

activationType="NOT PRESENT";

repeating=1;

age="UNKNOWN";

text="Move Squad To Marker";

name="squadMoveToMarker";

expActiv="{_x doMove (getMarkerPos ""marker"")} forEach units squad";

class Effects

{

};

};

class Item1

{

position[]={11934.539063,124.209007,15768.770508};

a=4000.000000;

b=1.000000;

angle=18.415701;

rectangular=1;

age="UNKNOWN";

class Effects

{

};

};

};

};

class Intro

{

addOns[]=

{

"sara"

};

addOnsAuto[]=

{

"sara"

};

randomSeed=7430659;

class Intel

{

startWeather=0.100000;

forecastWeather=0.300000;

year=2007;

month=6;

day=7;

hour=8;

};

};

class OutroWin

{

addOns[]=

{

"sara"

};

addOnsAuto[]=

{

"sara"

};

randomSeed=15887875;

class Intel

{

startWeather=0.100000;

forecastWeather=0.300000;

year=2007;

month=6;

day=7;

hour=8;

};

};

class OutroLoose

{

addOns[]=

{

"sara"

};

addOnsAuto[]=

{

"sara"

};

randomSeed=10383875;

class Intel

{

startWeather=0.100000;

forecastWeather=0.300000;

year=2007;

month=6;

day=7;

hour=8;

};

};

Share this post


Link to post
Share on other sites

lol, looks like somethings to do with the safe mode

when i changed the WP behaviour to "no change" all is fine and they continue after 2 seconds (shifted the WP further away from the gate)

under "safe" condition when still in prone pos, they crawl 2-3 meters each time when firing some bursts with the M4 but stop again <g>

never noticed this with enemy units though - i use "safe" (patrol) mode and "move" quite often scripted for eny groups in ArmA but after making contact they never had a problem pretty fast attacking me ... :-)

Share this post


Link to post
Share on other sites

They seem to shoot back, and engage any enemy units, but they don't like to continue doing what they where supposed to be doing afterwards, which can cause some problems for mission designers.

Share this post


Link to post
Share on other sites
Quote[/b] ]I'll bet that's why a unit in "safe" mode will literally drop like a sack of potatoes when shot at and stay there till the end of a mission now, ignoring any furthe waypoints huh?

Grrr - I'm having exactly this problem. I have a bunch of civilians being shot at by a gunman. As soon as they receive fire they either go prone (fine, at least it's realistic) or stand still like utter imbeciles. "I know, I bet if I stand perfectly still he won't notice me here in the middle of the road !"

You can spur them back into action by calling 'setBehaviour careless' but they then immediately drop back into 'scared-sh*tless' mode since when they hear the gunman firing at one of their friends. Really I'd like them to run for the hills. sad_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  

×