Home   Help Search Login Register  

Author Topic: controlling group hostility?  (Read 791 times)

0 Members and 1 Guest are viewing this topic.

redmenace

  • Guest
controlling group hostility?
« on: 19 Nov 2005, 20:10:30 »
How do you make it so police fire back if fired upon?
Is there a init field command to make a group hostile/hostile if fired upon, even if they are civillians?

thx


Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:controlling group hostility?
« Reply #1 on: 19 Nov 2005, 20:17:42 »
Welcome to the forum!

Usually in these sort of situations the answer is setCaptive true/false commands.    Give us more detail about the situation and we can give a more detailed answer.
Plenty of reviewed ArmA missions for you to play

redmenace

  • Guest
Re:controlling group hostility?
« Reply #2 on: 19 Nov 2005, 20:22:13 »
Well I was fooling around and wanted to make a quick gta-style mission, like just have a bunch of civillians, cars, police, and the player. The only thing is when I shoot the police they don't shoot back. The same thing happens if you are a civillian and you shoot anybody.

So I guess I'm asking how to make police respond if shot at, and also if its possible to make a group of units and sort of make it its own team, which shoots at anyone if they are shot at first.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:controlling group hostility?
« Reply #3 on: 19 Nov 2005, 22:23:32 »
In the mission editor, go to the Intel Box (cloud/sun bit, top right hand corner.)   Set the Resistance friendly to nobody.  Whether you are East or West, the police will now shoot at you.  Probably.

However, you doubtless want to be a civvy too.   So use this trick.  It works any way round, and you can use it to make loons in any clothes be on any side you want.

Create the civilian player unit.   Create a West officer and make him a colonel.   Now group the player to the officer.  (Not the other way around.)    Your civvy is now side West and anybody who is enemy to West will shoot at him.

Play around with this.  You'll soon figure out what you want.
Plenty of reviewed ArmA missions for you to play

Offline Pilot

  • Contributing Member
  • **
Re:controlling group hostility?
« Reply #4 on: 19 Nov 2005, 22:26:26 »
Quote
Now group the player to the officer.  (Not the other way around.)
What difference does that make?

-Pilot

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:controlling group hostility?
« Reply #5 on: 19 Nov 2005, 22:54:32 »
There is a risk that the officer would join your group, rather than you joining his (which would mess things up entirely).   If you want to be absolutely sure of getting it right, make the officer higher rank than you and also join him to you.  
Plenty of reviewed ArmA missions for you to play

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:controlling group hostility?
« Reply #6 on: 19 Nov 2005, 23:12:32 »
And don't forget to make the officers probability of presence = 0.


Planck
I know a little about a lot, and a lot about a little.

redmenace

  • Guest
Re:controlling group hostility?
« Reply #7 on: 19 Nov 2005, 23:18:36 »
thanks for the help, but theres just one more thing, which is that now the police just shoot at you when they see you, but what I need is for them only to shoot when fired at (or preferrably when fired at or near).

thanks

Offline Pilot

  • Contributing Member
  • **
Re:controlling group hostility?
« Reply #8 on: 19 Nov 2005, 23:18:52 »
@macguba
I always thought that when a lower ranking unit was joined to a higher ranking unit, the higher ranking unit would be leader by default.

Of course, if the player unit is a colonel, then you would be absolutely right.  And I guess it doesn't hurt to be on the safe side.

-Pilot

EDIT:
Quote
thanks for the help, but theres just one more thing, which is that now the police just shoot at you when they see you, but what I need is for them only to shoot when fired at (or preferrably when fired at or near).

thanks
What you could do is add a 'fired' eventhandler to the player unit.  When the player fires, the eventhandler would setcaptive the player false, ex:
put this in the player's init field:
this addeventhandler ["Fired", {_this setcaptive false}]

Be sure to also put the following in the player's init field:
this setcaptive true

EDIT EDIT:
Correction
« Last Edit: 19 Nov 2005, 23:23:49 by Pilot »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:controlling group hostility?
« Reply #9 on: 19 Nov 2005, 23:46:36 »
@Planck - well spotted.   ;D

@Pilot - yes you're right, its just better to be safe than sorry.

@redmenace, I should explain that setCaptive true means that nobody will shoot at you.   In Pilot's answer, as soon as you fire you become setCaptive false which means that your enemies (ie the police) will shoot at you.

There are further subtleties of how you might handle this depending on exactly what conditions you want.   However, setcaptive true/false is almost certain to the at the heart of it.   Get Pilot's answer working first, before going any further.    There is lots of stuff that will help you in the Editors Depot - have a good look round.
Plenty of reviewed ArmA missions for you to play