Home   Help Search Login Register  

Author Topic: LAGGY Eventhandler "Firing while Detected" (BETA)  (Read 3067 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
LAGGY Eventhandler "Firing while Detected" (BETA)
« on: 15 Feb 2009, 19:31:39 »
Hi,

Have you ever wanted to have this logical ingredient in an "undercover" (setCaptive) mission?

You are undercover, but if you start shooting your cover is blown, you can solve that with a simple:
Eventhandler "fired", where _this select 0 setCaptive false.

But what if you fire your weapon inside a deep forest miles away from anyone and 1 hour later enter enemy positions. They then start firing at you, even though they could not possibly know that you had fired your weapon.

My solution also naturally takes into account if you are using silenced weapons, as you will then less likely be detected when firing.

EDIT: You can now set the wanted SIDES, GROUPS or UNITNAMES that you want to be possible spotters.
         Still wondering if the radius check could (should) be dynamic.

I think this is the solution:

init.sqf
Code: [Select]
// Set the array parameters to include any side, group or unit, that can spot the firing unit. EXAMPLE: [EAST,RESISTANCE,group3,guy5].

LAGGY_firespotters = [EAST];

Eventhandler "fired"
Code: [Select]
_shooter = _this select 0;
_spotters = nearestObjects [vehicle _shooter, ["AllVehicles"], 50];

sleep 5;

if (count _spotters > 1) then
   {
      {
         if ((side _x in LAGGY_firespotters OR group _x in LAGGY_firespotters OR _x in LAGGY_firespotters) AND (_x knowsAbout _shooter > 0.5) AND (alive _x)) then
         {
            _shooter setCaptive false; _x doFire _shooter;
         };
      };
   } forEach _spotters;

The "_x doFire _shooter;" is optional, but since ArmA is quite unpredictable regarding how AI sees you at night, I would add that line if the mission is set at night. During day it is not needed at all.

The "sleep 5;" is also optional, but if you kill a small group quickly, they shouldn't be able to "report" that you are an "enemy".

 Mission Example included ;)


Edit: attachment lost in crash of November 2009; re-upped in last post - WEK
« Last Edit: 12 Oct 2010, 19:11:40 by Walter_E_Kurtz »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Eventhandler "Firing while Detected" (BETA)
« Reply #1 on: 15 Feb 2009, 22:29:50 »
laggy, if you want something to be tested here by the community, please, attach a demo mission.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Eventhandler "Firing while Detected" (BETA)
« Reply #2 on: 16 Feb 2009, 10:09:54 »
 :-[,

Sorry I thought something as simple as this could just be copied from the code.

It's done,

Laggy
« Last Edit: 16 Feb 2009, 10:30:21 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline CaptainBravo

  • Members
  • *
Re: LAGGY Eventhandler "Firing while Detected" (BETA)
« Reply #3 on: 31 Aug 2010, 09:48:51 »
Sounds very interesting. Any chance of reposting mission as the link is dead?

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: LAGGY Eventhandler "Firing while Detected" (BETA)
« Reply #4 on: 07 Sep 2010, 00:42:17 »
Sorry for the late reply, rarely check ArmA threads these days.

Here it is...
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.