Home   Help Search Login Register  

Author Topic: Wait to fire  (Read 528 times)

0 Members and 1 Guest are viewing this topic.

Offline Killzone

  • Members
  • *
  • War is the true Enemy
Wait to fire
« on: 06 Aug 2005, 03:37:35 »
Hello

I am not sure if this is an advanced scripting question so sorry if this is in the wrong group.  It seems advanced to me  ;)

I was wondering if it is possible to have your squad members not fire there weapons unless one of two things happen.

1) I fire my weapon
2) The enemy fires his

I was thinking an addeventhandler would be used for the 1st but I dont know how the second would be done and then of course putting it together.

As always thanks in advance
"Everyone dies so deal with it and move on"

                                                      ME

Offline Pilot

  • Contributing Member
  • **
Re:Wait to fire
« Reply #1 on: 06 Aug 2005, 03:42:32 »
I would assume a fired eventhandler can be used for both.  Just put a fired eventhandler in the player's init field, and all the enemies' init field that sets a global variable to true, which in turn changes the combat mode of the other squad members, if that's possible, of course ::)

-Student Pilot

EDIT:
Try something like this, in init.sqs, type:
AnyFired=false

Then, in the init field of all the enemy men and the player, put:
this addEventHandler ["fired",{AnyFired=true}]

Then, in a trigger, set the size to X: 5000   Y: 5000

Set the activation to Anybody Present

set the condition to:
this and AnyFired

and in the On Activation field, put:
group player setcombatmode "Red"; foreach thislist removeAllEventHandlers "fired"

Assuming of course changing the combat mode will do the trick.  If it doesn't, just enter whatever works in the On Activation field, but keep the removealleventhandlers part.

Syntax not guarenteed.
« Last Edit: 06 Aug 2005, 03:50:08 by Student Pilot »

Offline Killzone

  • Members
  • *
  • War is the true Enemy
Re:Wait to fire
« Reply #2 on: 06 Aug 2005, 04:06:37 »
Thanks Student Pilot.  I will give it a go.
"Everyone dies so deal with it and move on"

                                                      ME

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Wait to fire
« Reply #3 on: 06 Aug 2005, 10:52:26 »
this can be done by group commander radio orders, or waypoints
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123