Jump to content
-Snafu-

General Barron's Scripts

Recommended Posts

Does anyone have a collection of the scripts General Barron released for OFP?

 

Some are still around on ofpec or ofp.info but there are others missing like the aircraft holding pattern script, AI info share and AI using artillery script.

  • Like 1

Share this post


Link to post
Share on other sites
;=================================================================================
;infoShare.sqs v1.1
;makes nearby friendly groups share enemy locations with each other
;this version is hardcoded to only work with the player's squad from the HS scripts
;get full, commented script from www.ofpec.com

;range = shouting signal range
;delay: 10 sec (hard-coded)

;[unit, enemy array] exec (hs_pth+"infoShare.sqs")
;=================================================================================

_man = _this select 0
_emy = _this select 1

;only run once per group
?_man != leader group _man : exit
_grp = group _man
;player never changes combat mode; ensure he shares info
? _man == player : player setbehaviour "combat"

~random 10

;   Wait until group goes into combat mode (done automatically by OFP when enemies are detected, unless in stealth mode)
#Wait
? behaviour leader _grp == "COMBAT" : goto "Loop"
~10
goto "Wait"

;   Share info with nearby friendlies
#Loop
;find known enemies
_knw = []
{if ((_grp knowsabout _x) > 0.105) then {_knw = _knw + [_x]}} foreach _emy

;share with nearby groups
_i = 0
_frd = call hs_getSquad
_rng = hs_cmd_sht^2
   #InnerLoop
     _man = _frd select _i
     if ({([getpos _man, getpos _x] call hs_distancePosSqr) <= _rng} count (units _grp) > 0) then {{_man reveal _x} foreach _knw}
     _i = _i + 1
   ? _i < count _frd : goto "InnerLoop"

~10
? behaviour leader _grp != "COMBAT" : goto "Wait"
goto "Loop"
;never exit (in case new units are added to 'dead' group)

Acquired from his handsignal command system addon. As it says in the comment, it is geared for the HS so you need to customize it. I have the standalone version as well but I've modified it.

  • Like 2

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

×