Home   Help Search Login Register  

Author Topic: really Friendly  (Read 648 times)

0 Members and 1 Guest are viewing this topic.

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
really Friendly
« on: 13 Apr 2003, 14:25:34 »
I have a slightly annoying prob with joining civvies with hostile sides. I run a script for each civilian that takes care of about everything you'd want from real life  ::) and here's the deal: Firstly I randomize the weaponry, they get either a rifle, shotgun, handgun or grenades. In each occasion except the grenades it looks like this:

Quote
#rifle
_unit removeAllEventHandlers "killed"
_armam = 99
[_unit] join rcom
_unit addMagazine "UZIMag"
_unit addMagazine "UZIMag"
_unit addMagazine "UZIMag"
_unit addWeapon "UZI"
~.1
[_unit] join grpNull
goto "skiparm"
You see there that I join them to a unit called rcom, a resistance unit, which is friendly to east. Here's where it gets odd:

Quote
#loop
? (! alive _unit) : exit
? (vehicle _unit != _unit) : goto "hold"

; armed behaviour
? (_armam > 35) && (_unit knowsAbout player) > 1 && (side _unit != side player) : _unit doTarget player; _unit doFire objNull
Now I test wether the civvies side is equal to the players side and to shoot at him or not. This is very important, because at a later stage of a mission, I convert the civvies to west by joining them to a west unit and back to grpNull. After that, they still shoot at me. I can understand that their side is still civilian, but I've also tried the Friendly equasion (side _unit != Friendly) but to no avail.

What am I missing? Are the civvies really ever enemies by joining an unfriendly side? After I've changed their side to west, I do get radiomessages from them (the usual seize fire). I'd just want them not to shoot at me after they are on my side so to speak.
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Fox2

  • Guest
Re:really Friendly
« Reply #1 on: 13 Apr 2003, 22:34:43 »
Perhaps try making two of those last sections, one in which it fires on West, and the other it fires on East.

Then you can set up a global variable like CivFriendly or something, and check it at the beginning of those sections. ie.

Code: [Select]

#CivOnEast

? (! alive _unit) : exit

? (CivFriendlyPlayer) : goto "CivOnWest"

? (vehicle _unit != _unit) : goto "hold"

; armed behaviour
? (_armam > 35) && (_unit knowsAbout player) > 1 && (side _unit != side player) : _unit doTarget player; _unit doFire objNull

goto "exit"

#CivOnEast

? (! alive _unit) : exit

? !(CivFriendlyPlayer) : goto "CivOnEast"

? (vehicle _unit != _unit) : goto "hold"

goto "exit"


You can then set that global variable sometime in the mission when you want it to change. ie. when the civilians go AWOL on East and join the player's side.

Also, I just tested this out in the editor, but not too extensively. I grouped a West soldier (player) to an East soldier, then created another East soldier situated ahead of us facing the opposite direction. Upon loading, the East soldier acted exactly like a normal West soldier, even to the point of identifying and SHOOTING the other East soldier from 100m away. Another test, this time with the East soldier BEHIND us, he shot the East soldier in my group.

Yet another test, a bit more relevant to your question.... I set civvies friendly to East, then did the same as above. I put a civilian on my squad, armed him with an AK47, and placed a guy exactly like him a few meters ahead.  This time, for some reason, he didn't shoot at him, no clue why. However, when I placed an East soldier the other civilian's place, he immediately hunkered down and wasted him.

My conclusion is that any unit, regardless of side or affiliation, when grouped under the command of an opposing side, takes on that side's enemies and allies.

You might not even have to do the above code if you just put East-friendly civilians in a squad with East commanders.

I don't know if this grouping thing works with SCRIPT (unit join group) or if it only works in the editor. You'd have to play with it a bit more.

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:really Friendly
« Reply #2 on: 13 Apr 2003, 23:06:15 »
Hmm thanks for the effort, but I fear this just was pushed further away from solved  ::). A minor clarification, the opponent of west is in my mission resistance, and I intented to create an atmosphere where you don't know which civvy is a res troop in civil clothes and which not and so on... but when they keep on shooting at you as you said, oh blx.

And you do mean east-friendly resistance don't you  ;D

I did try a global variable, flicked true right before the player should have any contact to them civvies. That if anything should prevent the equasion to shoot the player from returning true but noh  :(

I can't do this via the editor, the civvies get grouped with the resistance only if they get a weapon by the random lottery in the beginning of the script. Resistance being friendly to east, the civils do shoot me. I don't know if they would without that command in the script tho. All I wan't is to prevent them from shooting me, preferably a general purpose solution and not mission specific variable flickering solution.

So the question remains... I hint formatted the command friendly and it was not defined. What gives?

update: Well it looks like they are hostile to me anyways. A chick just nailed my ass with a 'nade even tho she was never grouped with resistance and the whole 'shoot the player' line is commented.
Just standing with a innocent smile at a bus stop... sigh.
« Last Edit: 13 Apr 2003, 23:30:44 by MI_Fred »
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Offline nEO iNC

  • Contributing Member
  • **
Re:really Friendly
« Reply #3 on: 19 May 2003, 13:37:50 »
Sorry, if I'm missing something, or saying something that has already been said (just scanned previous replies), but here's what I've observed when playing in the editor with Resistance and civvys...

It seems like the civvy population is always allied to which ever side the Resistance force is allied to. Which would kinda make sense as the Resistance would be made up of civvys who have taken up arms... So, if you have Res with East, civvies will always no matter what, see West as enemy, opposite is obviously true.

Having said that maybe there is something you could do with Res being friendly to all..? Just a though... Dunno... ::)

Fox2

  • Guest
Re:really Friendly
« Reply #4 on: 19 May 2003, 15:58:57 »
Well, you could use the old this setcaptive true on every unit you don't want to be shot at.

That should keep them from shooting at him/them. Then, when you WANT them to shoot at you, just flip it to this setcaptive false.


Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:really Friendly
« Reply #5 on: 19 May 2003, 16:49:12 »
If a Players "Rating" number is negative, friendly forces will see him as enemy, this is why when in normal play, if you TK or shoot an AI, the other AI will shoot you


I presume as default all players start with a "Rating" of 0

try "player addrating 2000" in the init field of each player
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:really Friendly
« Reply #6 on: 20 May 2003, 03:02:59 »
Actually the answer is very simple: do nothing  ;D

The best way to handle civvies is to let them be. When given a gun and no setbehaviours, they automaticly take the side of resistance and shoot at its enemy. The bad thing is that they can't be set to careless or safe or they will become retards again.

I've put up the whole script in my sites forum, link below. It has a long way to go and might be buggy on the counting part, I just love maths grrrrr...
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Offline CrashDome

  • Members
  • *
Re:really Friendly
« Reply #7 on: 20 May 2003, 06:11:37 »
Don't know if this is bad news for you, but I tried once (around v1.46) to do what you are doing and found that the mission.sqm file pretty much determines the side of the unit. The only option is to "createunit" and join to desired group/side immediately. (i.e. changing sides of an existing unit is impossible in-game)

I will try and find the "old" thread...

ah... can't find it...

anyway.. we had tried to get BIS to add a "switchside" command.. w/ no luck.


BTW: Fox2? You've been scripting lately! Hmmmm... maybe I should put you to work?
**grabs yoke and electric cattle prod**

**Crashdome rethinks action as it might be taken wrong way**
**CrashDome hopes no one noticed he owns electric cattle prod and yoke**
« Last Edit: 20 May 2003, 06:12:48 by CrashDome »