Jump to content
Chuc

Hostile civilians

Recommended Posts

Like the title when I start my mission any civilian I have placed into mission form the editor they turn hostile towards blufor.

 

I removed all of my scripts and just left the mission.sqm file in and I still got the same problem.

 

If I start a new mission with the same mods no civilian in hostile.

 

If anyone has an idea I'm all ears.

 

civilian setFriend [WEST, 1];
WEST setFriend [civilian, 1];

Doesn't help

Share this post


Link to post
Share on other sites
4 hours ago, Chris Smith said:

Like the title when I start my mission any civilian I have placed into mission form the editor they turn hostile towards blufor.

 

I removed all of my scripts and just left the mission.sqm file in and I still got the same problem.

 

If I start a new mission with the same mods no civilian in hostile.

 

If anyone has an idea I'm all ears.

 


civilian setFriend [WEST, 1];
WEST setFriend [civilian, 1];

Doesn't help

How are the defined in the editor? It would appear you have them friendly towards OPFOR, you need to look at the "General" parameters in the Editor, to see which side you have the Civilians/Independant forces friendly towards.

Share this post


Link to post
Share on other sites

everyone is friendly. But even if I take out all of my scripts and just leave the mission.sqm file they will still be hostile.

 

But even with everyone set to friendly civilians will still attack blufor. As far as I can tell they don't attack anyone else. Also it seems civilians spawned in with enigmas script are not hostile, its only ones I place in the editor.

 

Its like im placing renegades/enemy civilians.

 

Im still kinda new to editing and scripting so its gotten me kinda confused to the point I take a few days off to clear my head before trying again.

 

If you would like to check the mission yourself send me a private message and ill send you the mission files if you would like. I cant post it to the public because I havnt gotten permission to yet.

Share this post


Link to post
Share on other sites

I remembered that I grouped a bunch of civilians to EAST to make them that team. Would that be causing my problem maybe?

Share this post


Link to post
Share on other sites

it could also be a rating problem caused by wron addRating usage which would turn em to sideEnemy

But if the behavior persists even if you start the mission without any script active. Then it must have to do with with your mission settings.

Share this post


Link to post
Share on other sites

you could try a different method. what i have had good experiences with is having fake civilians. this means you'd have an opfor unit, assuming you are bluefor, dress it like a civilian and throw it into a civilian group. then when you want shit to hit the fan you put that unit into an opfor group.

 

that way you avoid all problems with AI having issues with attacking civs because their actual unit type is civ side. so no ratings needed. just switching of groups. i foudn this to be the easiest way to handle dynamic hostility. less factors that can cause error too.

  • Like 1

Share this post


Link to post
Share on other sites

I can recommend bad Benson's method

Sent from my D6503 using Tapatalk

Share this post


Link to post
Share on other sites

@bad benson you may have misunderstood what is happening to me. Nice idea you have and I may need to use it in away to fix my problem.

 

So to break it down for everyone.

Everyone starts the mission as friends. There is no fighting for the first part until a event that is activated by a trigger.

From testing it has worked quite well but if I have opfor and bluefor in the same room, the first couple of seconds they will fight until the init.sqf has activated and then they will be friends. I have fixed this issue with just placing them with there backs turned to each other.

 

For some reason civilian placed in game are hostile to everyone. I made a weapons trader a civilian and went to buy good off him and he attacked me. So after I killed him I decided to drive up the road to the opfor camp. As a bluefor soldier I could walk around and even interact with all the opfor soldiers.

 

I thought that was abit odd so I placed a couple of civilians down with a bluefor and opfor  soldier. The mission started and the opfor and bluefor worked together to kill the civilians.

 

@sarogahtyp I believe you may be on to something here. I have been screwing around with a rank up script and was a little confused that the rating each rank gave me was very different to what the wiki site said each rank should have. 

I have this in my init for testing to show me my current rating

onEachFrame {hintSilent format ["RATING: %1", rating player]};

But I did try adding a couple thousand rating to each civilian I placed plus the playable character and still had the same effect of civilian trying to kill me.

 

This has had me buggered for a couple weeks now to the point I havnt even played for 4 days.

The only thing I can think of that isn't script related was what I posted above about grouping some civilians with opfor. Maybe that has made every other civilian I place go to the enemy side.

 

Thank you guys for helping, it's appreciated. If anyone wants my mission file private message me and ill send it to you

Share this post


Link to post
Share on other sites

Did you try to set up a new mission and see if the error persists?

Go through every single step in a new mission to find out when the error occurs.

 

How do you make everyone start as friends?

Without posting any code it's a guess at most.

 

Cheers

Share this post


Link to post
Share on other sites

@Grumpy Old Man I set the command setFriend in the mission init.sqf file so it loads at start of mission. 

 

EAST setFriend [WEST, 1];
EAST setFriend [resistance, 1];
EAST setFriend [civilian, 1];

WEST setFriend [EAST, 1];
WEST setFriend [resistance, 1];
WEST setFriend [civilian, 1];

resistance setFriend [EAST, 1];
resistance setFriend [civilian, 1];
resistance setFriend [WEST, 1];

civilian setFriend [EAST, 1];
civilian setFriend [resistance, 1];
civilian setFriend [WEST, 1];

I have changed it a bit to try and fix my hostile CIV's but with not much luck atm.

This init works but it takes between 1-3 seconds to activate so sometimes they fight for the start then stop.

 

The way I tested it was put that in the init, then in another sqf file I called it Factions.sqf I put the same thing but changed the 1's to 0's and then I put 3 squads at the airport in a diamond shape. 6 soldiers in each squad from opfor, bluefor and resistance. Then I put in a radio activated trigger in the on act bit I put

[] exec "Factions.sqf";

Call the radio they they will all start fighting each other. Funny thing I found out of 10 test was opfor won everytime. The other 2 always hesitated before firing, im gonna say its because they are first in the list.

 

EDIT: To make the test work right you have to disable AI pathing so they don't move. If they are able to move they will run away from each other at start. Not sure why they do it.

Share this post


Link to post
Share on other sites

You could skip the entire setfriend commands and use this inside the init field of one single unit:

{_x setCaptive true} forEach allUnits;

and to make them open fire on each other:

{

	_x setCaptive false;
	_unit = _x;
	
	{
	
		_unit reveal [_x,4];
	
	} forEach allUnits;

} forEach allUnits;

 

Cheers

Share this post


Link to post
Share on other sites
On 4/2/2017 at 0:47 AM, Grumpy Old Man said:

You could skip the entire setfriend commands and use this inside the init field of one single unit:


{_x setCaptive true} forEach allUnits;

and to make them open fire on each other:


{

	_x setCaptive false;
	_unit = _x;
	
	{
	
		_unit reveal [_x,4];
	
	} forEach allUnits;

} forEach allUnits;

 

Cheers

Wait a sec. Wouldn't reveal show the enemy position regardless of the friendly position?

IE: Across the map?

:/

Share this post


Link to post
Share on other sites
10 minutes ago, Midnighters said:

Wait a sec. Wouldn't reveal show the enemy position regardless of the friendly position?

IE: Across the map?

:/

Yes it would, unless you meant they will be visible on the map, that would be a difficulty setting.

The thread author stated that all units are within the same room, the reveal command helps them to speed up the detection, so they engage faster.

 

Cheers

Share this post


Link to post
Share on other sites
3 minutes ago, Grumpy Old Man said:

Yes it would, unless you meant they will be visible on the map, that would be a difficulty setting.

The thread author stated that all units are within the same room, the reveal command helps them to speed up the detection, so they engage faster.

 

Cheers

aye, I missed that tid bit. Thanks, this makes more sense now. 

Share this post


Link to post
Share on other sites

Yeah thanks for that but I still cant figure out what is happening. I cant even replicated it in a new mission.

 

So I have decided to go with it and change the atmosphere of the game. So instead of Bluefor showing up to help the civilians get back there land from opfor, Bluefor now will be helping opfor settle a rebellion and take back control of the area.

 

So now the mission is going to be Opfor and Bluefor fighting Civilians.

Share this post


Link to post
Share on other sites

So I went back into mission today to make it work with hostile civilians and it was going really well, until every single empty car became a civilian car and became unusable to me.

So I decided to start in car, that made the car ours until we all got out then it went back to civilian and we couldn't use it. 

 

To top it off I also lost the ability to open any container or pick up any loot. Also anything on ground, loot or player dropped weapon turns into a civilian item and cant be picked up unless you  open your inventory on top of it.

 

I got debug turned on for my loot so it tells me where the loot is, weirdest thing is that every peace of loot had a purple square around it. I have units come up on map for testing purposes and purple is civilian.

 

I believe my mission is bugged and just cant be fixed.

Share this post


Link to post
Share on other sites

Empty vehicles will always be civilian.

What do you mean with the car becoming unusable?

 

Dropped weapons turning into civilian items? Wat?

 

Are you sure you're not running any mods?

 

Cheers

Share this post


Link to post
Share on other sites

I got mods but they aren't the problem. 

 

So normally a empty vehicle would yellow on your map and you can get in it. What is happening to me is once the vehicle is empty it turns purple and then there is no action to get in or check inventory. 

 

Also when you drop a weapon on ground you can normally pick it up again and it doesn't show up on the map. 

What is happening to me is you drop the weapon and there is no action to pick it up again and if you go to the map the said weapon on ground will be a purple square. 

 

It's the same with any placed weapon/ammo create, as in there is no option to open them. 

 

At first I thought it may have been a bug with the action commands but if I start mission with a friendly in the vehicle I have all the actions available to me but if I get that soldier to exit I lose all actions and car turns purple not yellow. Also I don't get a command for squad to enter only to attack it. 

 

I hope that is abit more detailed for you. 

I believe it's the same bug that turned the civilians hostile and it's mutated into this now. I believe my mission is dead and not able to be saved. 

 

Pm me if you would like the mission files. 

 

Thank you for helping me it is very appreciated 

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

×