Jump to content
Sign in to follow this  
Balschoiw

SetCaptive true not always working

Recommended Posts

Hi !

Just running into a problem while making a mission.

I have an east officer imprisoned in a Resistance camp.

I have civillians who more or less switch their loyalities multiple times in the mission. No problem so far. All working nice.

The problem starts when I use

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">civilian setFriend [resistance, 0]; resistance setfriend [civilian, 0]

when a civillian attack on the camp is about to begin.

As civillians have to attack the resistance side and resistance side is supposed to shoot back there is no easier way then that.

But, as the east officer is set to civillian side aswell by the setcaptive true command he instantly gets shot upon by resistance guards. First i was like : Huh ? huh.gif

But it makes sense if you think about it.

Anyway, it´s a serious problem for me though as I cant use

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">east setFriend [resistance, 1]; resistance setfriend [east, 1]

as the player´s role is on the east side and he should be attacked by resistance also.

See the dilemma ?

How do I make the eastern prisoner appear freindly to the Resistance side ?

Editing the mission.sqm is out of question as the prisoner is supposed to follow the east player in one part of the mission.

As setcaptive fails because of the civillian argument I am running out of options.

Any ideas ? huh.gif

Share this post


Link to post
Share on other sites

Sounds confusing, in fact i need to reread that. Just a sec..

crazy_o.gif

Ok

Option 1:

- Group Your East Man With a Civilian, Make the Civilian The Leader and set the civilians presence to 0. This should make the East Officer a civilian.

Option 2:

- I have no clue let me think some more...

Share this post


Link to post
Share on other sites

I guess engine-internal the russian officer with setcaptive true is already handled as a civillian. That´s why he gets mowed down once I set the friendship from Resistance to Civillians on a very bad level.

What is also interesting is that empty objects like barrels and car wrecks are getting attacked by resistance once I set the setFriend of civillians and resistance on a bad level.

So either I´m doing something wrong with the values, or the game engine does not distinguish between side "empty" and side "civillian" in some aspects. The funny thing is that resistance does not attack all empty objects. For example they don´t attack empty cars, tents, etc, but carwrecks, barrels and stuff like that.

Really weird.

Share this post


Link to post
Share on other sites

Interesting observation,

there is no side "empty" btw, empty vehicles are always considered

"civilian". There must be still a different "flag" to them, because AI keeps firing at abandoned vehicles although they are officially "civilian".

Setcaptive and setfriend don't seem to get along with each other too well. If i remember correctly setcaptive does NOT actually change the side of the unit (check with command :side unit),

but i might be wrong

Share this post


Link to post
Share on other sites

Well the really bad thing is that it blows my almost finished mission somewhere near the dustbin if I can´t find a working solution sad_o.gif

A ChangeSide command would do wonders if there was one implemented.

Another observation. Changing setFriend values during a mission does not always work. Sometimes the AI simply does not react on the command and stay with it´s preset relation.

Will investigate further.

Btw, what happens if I first group the captive to a resistance guy ? This should make him a friendly first, right ? So can I group him with another side later on to switch his side, or is that impossible ?

What happens if I group him to a Game-logic. What side are they ?

I know those questions are pretty specific but I am looking for a solution really badly.

Share this post


Link to post
Share on other sites

As far as I am aware, it is currently impossible to change the actual side of a unit under any circumstances (once the mission starts that is).

Unless someone knows something I don't?  confused_o.gif

In any event, this feature would come in really handy.  Image a population of civs that start off on the civilian side, but join one side or the other depending on how things are going.  (i.e. Whether East or West has killed more civs acidentally, or perhaps you could also have a sub mission where you incite a riot, etc.)

Currently you could script all this but it would involve swapping the units out (delete and then replace them with a new unit on another side, probably inside buildings or vehicles), and thus would get pretty messy.

A setUnitSide command would be just what the doctor ordered.   biggrin_o.gif

Now I just had an idea - Has anyone ever tried to join a unit from one side into a group that belongs to another side?  I doubt this works, but I'm going to try it tonight!

Share this post


Link to post
Share on other sites

Many non-unit objects that are not east, west, or resistance are civilian. eg empty vehicles, dead bodies, buildings. You should try to avoid having to use setFriend [civilian, 0]. Civilians are not meant to be enemy to anyone. By default, civilians share the same enemies as the resistance, and setting these two sides as enemy's might cause some unexpected results.

Try to work out another solution based on the 3 combat teams, such as putting all resistance units on the west side instead. It is possible to place/add any unit class on any side, and the actual side a unit is on is completely transparent to the player.

Share this post


Link to post
Share on other sites

Ok crumbled back to the old OFP way of using a dummy east units with a probability of 0 grouped with my civillian fighters. This way it works for the attack team. No flaws there.

But still changing side loyalities really needs a look from BIS as it does not allways work. I used some repeated radio triggers in a test to switch their loyality from friendly to east to unfriendly to east. In about 20 percent of the switches the civillians didn´t switch their loyality factor. Maybe something in their AI pattern is hindering them from time to time. Don´t know.

The workaround will do for this mission but it´s so old fashioned smile_o.gif

Quote[/b] ]By default, civilians share the same enemies as the resistance, and setting these two sides as enemy's might cause some unexpected results.

The civillians didn´t cause that much trouble. It was the resistance side set enemy to civillians that started to go frenzy over empty objects. Quite insane. They kept shooting car wrecks and as wrecks are already wrecks they wasted all their AT´s and mg´s and tank power on one daihatsu wreck biggrin_o.gif

I was like: Good god, hold it ! It´s dead !!

Anyway the mission is evolving again and I hope I don´t run into more trouble.

Quote[/b] ]A setUnitSide command would be just what the doctor ordered.

Agreed. Something for the wishlist ?

Quote[/b] ]Has anyone ever tried to join a unit from one side into a group that belongs to another side?

I just grouped one of east to the civis to make them east. Used probability of 0 to not have the unit on the map but the grouped civis still act like they are russian agitators biggrin_o.gif

Share this post


Link to post
Share on other sites

Put the civillians on an different side then. Civillian side is special so you shouldn't change it with setFriend, put the civillian combatants on west side or something.

Share this post


Link to post
Share on other sites

In OFP, when I grouped units to squads of other sides [during runtime], I had horridly bad results. Like, west fires on east, but east doesnt shoot back, etc..

I cannot test if it is the same in ArmA.

Share this post


Link to post
Share on other sites
A setUnitSide command would be just what the doctor ordered.   biggrin_o.gif

Doubt it, such a task would more likely screw the AI up even more. Changing a units side mid-mission isn't something that seems very easy to implement to me, especially thinking about it in multiplayer. Sides are much more than just who's friendly to who (if it were setFriend would suffice).

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  

×