Jump to content
Sign in to follow this  
ShadowRanger24

AI Running Away

Recommended Posts

So I'm working with a script which creates AI and disable their AI, however even know their AI has been disabled, they still seem to keep running away.  I am thinking it has something to do with them being part of the same group and trying to return to formation or something. I can't figure out a way to make it so they just don't run away and don't move at all. I don't want to create a new group for each unit either.

 

civGroup = createGroup civilian;
 
_npc1 = civGroup createUnit ["C_journalist_F", getPos player, [], 0, "NONE"];
_npc1 disableAI "ALL";
 
_npc2 = civGroup createUnit ["C_journalist_F", getPos player, [], 0, "NONE"];
_npc2 disableAI "ALL";

 

The only workaround I can think of is disabling their AI. But this is just silly. Surely there's a way to fix this? Thanks in advance.

Share this post


Link to post
Share on other sites

You could provide more info about your issue, what's the situation, what units are placed near the civilians, etc.

 

Civilians will run away if there's opfor in their area they know about.

They'll also run away if there's shooting going on.

 

Returning to formation isn't what one would usually call "running away".

 

Cheers

Share this post


Link to post
Share on other sites

You could provide more info about your issue, what's the situation, what units are placed near the civilians, etc.

 

Civilians will run away if there's opfor in their area they know about.

They'll also run away if there's shooting going on.

 

Returning to formation isn't what one would usually call "running away".

 

Cheers

Sorry for not explaining properly. Basically there's only civilians and BLUFOR on the map, no OPFOR. The units get created around other actual player civilians, and are all put into 1 created civilian group. And when I say running away, honestly, they just start running. They get created and just start running. I don't know where, because these NPCs are created all over the map, so maybe their just running towards each other? I really don't know. But I don't want to disable simulation on them because that just looks stupid and there's gotta be another option. I don't understand why disableAI doesn't work.

Share this post


Link to post
Share on other sites

Sorry for not explaining properly. Basically there's only civilians and BLUFOR on the map, no OPFOR. The units get created around other actual player civilians, and are all put into 1 created civilian group. And when I say running away, honestly, they just start running. They get created and just start running. I don't know where, because these NPCs are created all over the map, so maybe their just running towards each other? I really don't know. But I don't want to disable simulation on them because that just looks stupid and there's gotta be another option. I don't understand why disableAI doesn't work.

 

They usually try to regroup with the group leader.

Do they all need to be in the same group?

You could use a simple doStop _npc1 to make them stay at their position unless fired upon.

No need to disableAI anything.

 

Cheers

Share this post


Link to post
Share on other sites

They usually try to regroup with the group leader.

Do they all need to be in the same group?

You could use a simple doStop _npc1 to make them stay at their position unless fired upon.

No need to disableAI anything.

 

Cheers

I'll give doStop a go.

Share this post


Link to post
Share on other sites

_unit disableAI "MOVE";

Share this post


Link to post
Share on other sites

I'll take an educated guess and say reading isn't one of your strengths.

 

Cheers

 

"And when I say running away, honestly, they just start running" - thats the part i didn't understand.

If you disableAI "MOVE" they're not moving but still the idle animations are playing so it's not the same as disabling simulations. As i know grouped units will get into a formation> If you wan't to break the formation you can set a waypoint as dismissed, if they come upon enemies they will form a formation again.

 

Also doStop is one way to do this.

 

"I can't figure out a way to make it so they just don't run away and don't move at all" - That can be done simply with disableAI "MOVE", when you enableAI they will create formation again.

 

We're all trying to help here and give multiple different solution and ideas, as some others than the thread starter might be reading this with a similiar problem.

  • Like 1

Share this post


Link to post
Share on other sites

"And when I say running away, honestly, they just start running" - thats the part i didn't understand.

If you disableAI "MOVE" they're not moving but still the idle animations are playing so it's not the same as disabling simulations. As i know grouped units will get into a formation> If you wan't to break the formation you can set a waypoint as dismissed, if they come upon enemies they will form a formation again.

 

Also doStop is one way to do this.

 

"I can't figure out a way to make it so they just don't run away and don't move at all" - That can be done simply with disableAI "MOVE", when you enableAI they will create formation again.

 

We're all trying to help here and give multiple different solution and ideas, as some others than the thread starter might be reading this with a similiar problem.

 

He already used disableAI "ALL", which includes "MOVE" in the very first post.

 

Cheers

Share this post


Link to post
Share on other sites

Well you can be surprised sometimes when just try it instead of talk about it.

Share this post


Link to post
Share on other sites

I had a related thread about civilians running away not long ago. Nothing works consistently on civilians, this is a change from earlier versions of the game. They definitely ignore disableAI commands and allowFleeing seems to be useless. It helps a lot to use setBehaviour "CARELESS" and setCombatMode "BLUE". In my case, the civilians would not even use assigned animations. I ended up using soldier units and simply dressing them up as civilians, but in most cases changing behavior should help.

Share this post


Link to post
Share on other sites

Yeah this is ridiculous. No matter what I use they just keep running away. I don't understand why they're so buggy.

Share this post


Link to post
Share on other sites

Are you using any AI mods?

Grouped civilians stay stationary just fine using dostop, in vanilla A3.

 

Cheers

Share this post


Link to post
Share on other sites

Are you using any AI mods?

Grouped civilians stay stationary just fine using dostop, in vanilla A3.

 

Cheers

No I am not using any AI mods. Just spawning the civilians into 1 civ group for each of them and applying disableAI and doStop. They still seem to keep running when spawned.

Share this post


Link to post
Share on other sites

Using the snippet you posted in the first post indeed makes at least one of them walk a few meters before stopping.

Note that disableAI "ALL" currently only works on devbranch (1.65.something), so there's that.

Using disableAI "MOVE" on both has them stationary.

Using dostop on both units also has them stationary.

 

I'd use the latter.

 

If they still run away try it in a new empty mission and go from there, has to be on your end, since you already stated that there's no opfor anywhere.

 

Cheers

Share this post


Link to post
Share on other sites

Afaik dostop is cancelled in a group once the group is fleeing. The only valid solution would be to ungroup them.

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  

×