Jump to content
Sign in to follow this  
FAR-FD AIR K

Script who spawn randomly or accurately russian patrols who hunt your group

Recommended Posts

Hi everybody

I don t know if this kind of script already existing

if you need it for your maps, this is a sample map here

Best regards

------------edit 2010/04/24--------------

thanks for yours feedbacks

i rewrite this script with this change:

- add a parameter for AI skill

- add a parameter for hunters side

- add a parameter for detection threshold to be in combat mode

- hunters choose like target the nearest member of the chased group

- hunters ignore the member who are not on the ground like in case using parachute or heli to be insert

i hope this version is better for you

regards

// SCRIPT DE PATROUILLE DE CHASSEURS / SCRIPT PATROL HUNTERS

// auteur/author: FAR-FD AIR K

// mail: fd_air_k@hotmail.com

// clan: www.clan-far.fr

// Merci pour vos retours d'information, thank for your feedbacks

// Ce script permet de faire apparaitre de maniere très aléatoire ou très précise une patrouille qui prendra en chasse votre groupe de joueurs.

// This script will spawn by very random way or very accurate way a russian patrol that will hunting your group of players.

// version originale sous OFP créée par FAR-Carpazo

// Activation: null = [grp_cible, gl_spawn, 0/1, r_min, r_max, nbre_unit_min, nbre_unit_max,detectLevel(0<dlvl<4),skillLevel(0<slvl<1),_defside(west_or_east)] execVM "chasepatrol.sqf"

// Exemple apparition aléatoire/Example with random occurrence:

// null = [playergroup,GameLogicSpawn01,1,111,333,6,12] execVM "chasepatrol.sqf"

// Exemple apparition précise/Example with accurate spawn:

// null = [playergroup,GameLogicSpawn02,0,1,10,2,4] execVM "chasepatrol.sqf"

// grp_cible = nom du groupe des joueurs qui seront chassés / name of the group with players who will be hunted

// gl_spawn = nom de la logique de jeu dont les coordonnées seront le centre de l'equation du cercle sur lequel un point aleatoire (cf valeur de _alpha) servira de point d'apparition / name of the game logic whose coordinates are the center of the equation of the circle on which a random point (see _alpha value) will be the point of spawn

// 0/1 = valeur à 1 si vous souhaitez que la game logique prenne la position du leader encore en vie et valeur à 0 pour le cas contraire / value to 1 if you want the game logic takes the alive leader position and value to 0 otherwise

// r_min = rayon minimum du cercle de placement / minimum radius of the circle of investment

// r_max = rayon maximum du cercle de placement / maximum radius of the circle of investment

// nbre_unit_min = nombre d'unité maximum dans la patrouille de chasse / Maximum number of units in the patrol hunting

// nbre_unit_max = nombre d'unité minimum dans la patrouille de chasse / Minimum number of units in the patrol hunting

// detectLevel(0<dlvl<4) = regler avec valeur entre 0 et 4 pour choisir le seuil de detection pour passer en mode combat / set with value between 0 and 4 to choose the detection threshold to be in combat mode

// skillLevel(0<slvl<1) = regler avec valeur entre 0 et 1 pour determiner le niveau de competence des IA / set with valu between 0 and 1 to define the skill of AI

// _defside(west_or_east) = regler avec west ou east pour choisir le coté des chasseurs / set with east or west to choose hunters side

// evolutions futures: choisir différentes troupes d'unités prédéfinies

// future changes: to choose differents kinds of troops

if (isServer) then{

//releve des parametres

_targetgrp = _this select 0 ;

_spawn = _this select 1 ;

_spawnattarget = _this select 2 ;

_rmin = _this select 3 ;

_rmax = _this select 4 ;

_nmin = _this select 5 ;

_nmax = _this select 6 ;

_dlvl = _this select 7 ;

_slvl = _this select 8 ;

_defside = _this select 9 ;

_chasegrp ="";

_posspawn =[];

_nbunit=0;

// détermination du nombre d'ennemis

_nbunit = _nmin + (random (_nmax-_nmin));

// détermination du rayon de placement et de l'azimut

_rd = _rmax - _rmin;

_r = _rmin + (random _rd) ;

_alpha = random 360 ;

//infos hint serveur

hintsilent format ["chasepatrol.sqf \n R: %1m \n alpha: %2m", _r , _alpha ];

sleep 1;

//détermination de la cible (max rank -1 si max rank pas au sol)

_alltarget = units _targetgrp ;

_nbtarget = count _alltarget;

if (_nbtarget==0) exitWith {};

_n=0;

while {(not alive (_alltarget select _n))&&(((getpos (_alltarget select _n)) select 2)>1)} do{

_n=_n+1;

};

_ldtargetgrp = _alltarget select _n ;

//détermination si apparition relative à la position des joueurs ou celle de la logique de jeu déclarée

if (_spawnattarget==1) then{_spawn setpos (position _ldtargetgrp)};

_posspawn = getpos _spawn ;

_posspawnx = (_posspawn select 0) + (cos(_alpha) * _r ) ;

_posspawny = (_posspawn select 1) + (sin(_alpha) * _r ) ;

_posspawn = [ _posspawnx , _posspawny ];

//controle si le point d'apparition se trouve sur dans une zone d'eau, le cas echeant le script sera relancé tant que le point d'apparition n'est pas sur la terre ferme

if (surfaceIsWater _posspawn ) exitWith{ [_targetgrp ,_spawn ,_spawnattarget ,_rmin ,_rmax, _nmin, _nmax ] execVM "chasepatrol.sqf"};

if (not(surfaceIsWater _posspawn)) then{

//creation de la patrouille de chasseurs en fonction des valeurs min et max déclarées et en fonction du coté du groupe de joueurs

switch (_defside) do{

case (east): {

_chasegrp = creategroup east ;

if (_nbunit >1) then{ "RU_Soldier_SL" createunit [ _posspawn , _chasegrp , "", _slvl , "CAPTAIN" ] };

if (_nbunit >2) then{ "RU_Soldier_Medic" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >3) then{ "RU_Soldier_MG" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >4) then{ "RU_Soldier_AT" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >5) then{ "RU_Soldier_GL" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >6) then{ "RU_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >7) then{ "RU_Soldier_Medic" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >8) then{ "RU_Soldier_MG" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >9) then{ "RU_Soldier_AT" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >10) then{ "RU_Soldier_GL" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >11) then{ "RU_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >12) then{ "RU_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

};

case (west): {

_chasegrp = creategroup west ;

if (_nbunit >1) then{ "USMC_Soldier_SL" createunit [ _posspawn , _chasegrp , "", _slvl , "CAPTAIN" ] };

if (_nbunit >2) then{ "USMC_Soldier_Medic" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >3) then{ "USMC_Soldier_MG" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >4) then{ "USMC_Soldier_AT" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >5) then{ "USMC_Soldier_GL" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >6) then{ "USMC_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >7) then{ "USMC_Soldier_Medic" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >8) then{ "USMC_Soldier_MG" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >9) then{ "USMC_Soldier_AT" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >10) then{ "USMC_Soldier_GL" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >11) then{ "USMC_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >12) then{ "USMC_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

};

};

//boucle tant que condition vraie, executer la chasse

_loop=true;

while {(_loop)} do{

deleteWaypoint [ _chasegrp , 0] ;

_allhunter = units _chasegrp ;

_nbhunter = count _allhunter ;

_alltarget = units _targetgrp ;

_nbtarget = count _alltarget ;

//infos hint serveur

hintsilent format [" nbchasegrp: %1 \n nbtarget: %2", _nbhunter , _nbtarget ];

sleep 0.5;

//controle si unite encore vivante dans la patrouille de chasse ou dans le groupe cible

if ((_nbhunter==0)||(_nbtarget==0)) then{

_loop=false;

if (!_loop) exitwith{};

};

//determination de la cible la plus proche

_dmin=99999;

_d=0;

for [{_i=0}, {_i < count _alltarget }, {_i=_i+1}] do{

_allhunter = units _chasegrp ;

_nbhunter = count _allhunter ;

_alltarget = units _targetgrp ;

_nbtarget = count _alltarget ;

if ((_nbhunter==0)||(_nbtarget==0)) then{

_loop=false;

if (!_loop) exitwith{};

};

_n=0;

while {not alive (_allhunter select _n)} do{

_n=_n+1;

};

_d = (_allhunter select _n) distance (_alltarget select _i);

hintsilent format ["%1",_d];

sleep 0.1;

if (((getpos (_alltarget select _i) select 2)<1)&&(alive(_alltarget select _i))) then{

if (_dmin>_d) then{

_dmin=_d;

target = (_alltarget select _i) ;

sleep 0.1;

};

};

};

//creation du point de passage en mode rejoindre positionné sur le chef de groupe encore vivant

postarget = getpos target ;

hintsilent format ["poswp\n%1\n%2",target, postarget];

sleep 1;

_postargetx = postarget select 0 ;

_postargety = postarget select 1 ;

_wp = _chasegrp AddWaypoint [[ _postargetx , _postargety ], 0];

_wp setWaypointType "SAD" ;

_wp setWaypointSpeed "FULL" ;

_wp setWaypointBehaviour "AWARE" ;

_wp setWaypointCombatMode "RED";

_wp setWaypointFormation "VEE" ;

//test si groupe de joueurs reperes par les chasseurs alors passage en mode combat

for [{_i=0}, {_i < count _alltarget }, {_i=_i+1}] do{

_allhunter = units _chasegrp ;

_nbhunter = count _allhunter ;

_alltarget = units _targetgrp ;

_nbtarget = count _alltarget ;

if ((_nbhunter==0)||(_nbtarget==0)) then{

_loop=false;

if (!_loop) exitwith{};

};

_kv = { _x knowsAbout ( _alltarget select _i) } foreach _allhunter ;

hintsilent format [" DetectLevel= %1", _kv] ;

sleep 0.1;

if ( _kv > _dlvl ) then{

_chasegrp setCombatMode "RED" ;

_chasegrp setbehaviour "COMBAT" ;

_chasegrp setFormation "LINE" ;

hintsilent "repere/detected\n...combat";

sleep 0.1;

}else{

hintsilent "pas repere/not detected";

sleep 0.1;

};

};

};

};

};

};

if (true) exitwith{hintsilent "FIN/END"};

// SCRIPT DE PATROUILLE DE CHASSEURS / SCRIPT PATROL HUNTERS

// auteur/author: FAR-FD AIR K

// mail: fd_air_k@hotmail.com

// clan: www.clan-far.fr

// Merci pour vos retours d'information, thank for your feedbacks

Edited by FAR-FD AIR K

Share this post


Link to post
Share on other sites

This looks very nice! I'll be sure to test.

Is there any chance of a version with US forces hunting the player?

How would one add a custom group? Like, US Army units from the ACE2 mod?

Cheers,

- HateDread.

Share this post


Link to post
Share on other sites

yes i hope do it soon

// future changes: adding a parameter to create Russian fighter patrols or U.S. depending of the player side and other parameter to choose differents kinds of troops

you can change side and unit here (and their skill):

//creation de la patrouille de chasseurs en fonction des valeurs min et max déclarées

_chasegrp = creategroup east ;

if (_nbunit >1) then{ "RU_Commander" createunit [ _posspawn , _chasegrp , "", 0.5 , "CAPTAIN" ] };

if (_nbunit >2) then{ "RU_Soldier_Medic" createunit [ _posspawn , _chasegrp , "", 0.5 , "SOLDAT"] };

if (_nbunit >3) then{ "RU_Soldier_MG" createunit [ _posspawn , _chasegrp , "", 0.5 , "SOLDAT"] };

if (_nbunit >4) then{ "RU_Soldier_AT" createunit [ _posspawn , _chasegrp , "", 0.5 , "SOLDAT"] };

if (_nbunit >5) then{ "RU_Soldier_GL" createunit [ _posspawn , _chasegrp , "", 0.5 , "SOLDAT"] };

if (_nbunit >6) then{ "RU_Soldier" createunit [ _posspawn , _chasegrp , "", 0.5 , "SOLDAT"] };

if (_nbunit >7) then{ "RU_Soldier_Medic" createunit [ _posspawn , _chasegrp , "", 0.5 , "SOLDAT"] };

if (_nbunit >8) then{ "RU_Soldier_MG" createunit [ _posspawn , _chasegrp , "", 0.5 , "SOLDAT"] };

if (_nbunit >9) then{ "RU_Soldier_AT" createunit [ _posspawn , _chasegrp , "", 0.5 , "SOLDAT"] };

if (_nbunit >10) then{ "RU_Soldier_GL" createunit [ _posspawn , _chasegrp , "", 0.5 , "SOLDAT"] };

if (_nbunit >11) then{ "RU_Soldier" createunit [ _posspawn , _chasegrp , "", 0.5 , "SOLDAT"] };

if (_nbunit >12) then{ "RU_Soldier" createunit [ _posspawn , _chasegrp , "", 0.5 , "SOLDAT"] };

Edited by FAR-FD AIR K

Share this post


Link to post
Share on other sites

Hi FAR-FD AIR K

Thanks for this, ive managed to change side to west easily enough

Is it possible to change the spawn distance? and im not sure what accurate and random means, or does accurate mean they spawn close to you where random can be any distance?

Cheers / Merci? :)

Share this post


Link to post
Share on other sites

I'm having a problem with this. The enemy units don't fire at me or my team. What am I missing?

They just run up to me and stand there.

Share this post


Link to post
Share on other sites

Place Russian(any opfor works i think) unit anywhere on the map and units that are spawned by script will start working correctly.

Share this post


Link to post
Share on other sites

Thx for this nice script!

Put it on our scripts section at Assault Mission Studio.

dlicon.gif

Patrol Hunters Script by FAR-FD AIR K

Edited by Imutep

Share this post


Link to post
Share on other sites
Place Russian(any opfor works i think) unit anywhere on the map and units that are spawned by script will start working correctly.

To avoid the need of a preplaced unit, use the command createCenter before creating groups.

Share this post


Link to post
Share on other sites

hi katipo

perhaps my english is too bad

// Activation: null = [group_target, gamelogic_spawn, 0 or 1, r_min, r_max, nb_unit_min, nb_unit_max] execVM "chasepatrol.sqf"

accurate way:

If you set like this: r_min=1 and r_max=2 then AIs will spawn randomly between 1 and 2 meter around the game logic you specified

random way:

If you set like this: r_min=1 and r_max=999 then AIs will spawn randomly between 1 meter and 1 km around the game logic you specified and if you set with 1 the parameter 0/1 the AIs spawn will be around the leader of the specified name group

look in my template map

i put two ways in the radio

in the first russians spawn always near a house and in the second russians spawn randomly around you but never in water ;)

hi imotep

thank for added my script

hi myke

i did not know this command, i will use it

thanks

Edited by FAR-FD AIR K

Share this post


Link to post
Share on other sites

Oh, awesome... thanks, no your english is fine i just wasnt sure what numbers to change :)

This script is simple and fun, heres some more dumb questions:

Is it possible to have the hunting units respawn if all are killed and can i just execute the random option from the init without going through the radio

Share this post


Link to post
Share on other sites

I don't understand how it works

I've tried with trigger( in init : null = [playergroup,GameLogicSpawn01,1,111,333,6,12] execVM "chasepatrol.sqf" detection bluefor) and with logic nothing happens except bip sounds

Share this post


Link to post
Share on other sites

Ok i just changed the trigger activation so it starts automatically :)

and yeah there is a bip type sound, ive just noticed it now?

Share this post


Link to post
Share on other sites

thanks for yours feedbacks

i rewrite this script with this change:

- add a parameter for AI skill

- add a parameter for hunters side

- add a parameter for detection threshold to be in combat mode

- hunters choose like target the nearest member of the chased group

- hunters ignore the member who are not on the ground like in case using parachute or heli to be insert

this is a sample map here

i hope this version is better for you

regards

// SCRIPT DE PATROUILLE DE CHASSEURS / SCRIPT PATROL HUNTERS

// auteur/author: FAR-FD AIR K

// mail: fd_air_k@hotmail.com

// clan: www.clan-far.fr

// Merci pour vos retours d'information, thank for your feedbacks

// Ce script permet de faire apparaitre de maniere très aléatoire ou très précise une patrouille qui prendra en chasse votre groupe de joueurs.

// This script will spawn by very random way or very accurate way a russian patrol that will hunting your group of players.

// version originale sous OFP créée par FAR-Carpazo

// Activation: null = [grp_cible, gl_spawn, 0/1, r_min, r_max, nbre_unit_min, nbre_unit_max,detectLevel(0<dlvl<4),skillLevel(0<slvl<1),_defside(west_or_east)] execVM "chasepatrol.sqf"

// Exemple apparition aléatoire/Example with random occurrence:

// null = [playergroup,GameLogicSpawn01,1,111,333,6,12] execVM "chasepatrol.sqf"

// Exemple apparition précise/Example with accurate spawn:

// null = [playergroup,GameLogicSpawn02,0,1,10,2,4] execVM "chasepatrol.sqf"

// grp_cible = nom du groupe des joueurs qui seront chassés / name of the group with players who will be hunted

// gl_spawn = nom de la logique de jeu dont les coordonnées seront le centre de l'equation du cercle sur lequel un point aleatoire (cf valeur de _alpha) servira de point d'apparition / name of the game logic whose coordinates are the center of the equation of the circle on which a random point (see _alpha value) will be the point of spawn

// 0/1 = valeur à 1 si vous souhaitez que la game logique prenne la position du leader encore en vie et valeur à 0 pour le cas contraire / value to 1 if you want the game logic takes the alive leader position and value to 0 otherwise

// r_min = rayon minimum du cercle de placement / minimum radius of the circle of investment

// r_max = rayon maximum du cercle de placement / maximum radius of the circle of investment

// nbre_unit_min = nombre d'unité maximum dans la patrouille de chasse / Maximum number of units in the patrol hunting

// nbre_unit_max = nombre d'unité minimum dans la patrouille de chasse / Minimum number of units in the patrol hunting

// detectLevel(0<dlvl<4) = regler avec valeur entre 0 et 4 pour choisir le seuil de detection pour passer en mode combat / set with value between 0 and 4 to choose the detection threshold to be in combat mode

// skillLevel(0<slvl<1) = regler avec valeur entre 0 et 1 pour determiner le niveau de competence des IA / set with valu between 0 and 1 to define the skill of AI

// _defside(west_or_east) = regler avec west ou east pour choisir le coté des chasseurs / set with east or west to choose hunters side

// evolutions futures: ajout d'un paramétre permettant au script de créer de patrouilles de chasse russes ou US en fonction du coté du groupe de joueurs et de choisir différentes troupes d'unités prédéfinies

// future changes: adding a parameter to create Russian fighter patrols or U.S. depending of the player side and other parameter to choose differents kinds of troops

if (isServer) then{

//releve des parametres

_targetgrp = _this select 0 ;

_spawn = _this select 1 ;

_spawnattarget = _this select 2 ;

_rmin = _this select 3 ;

_rmax = _this select 4 ;

_nmin = _this select 5 ;

_nmax = _this select 6 ;

_dlvl = _this select 7 ;

_slvl = _this select 8 ;

_defside = _this select 9 ;

_chasegrp ="";

_posspawn =[];

_nbunit=0;

// détermination du nombre d'ennemis

_nbunit = _nmin + (random (_nmax-_nmin));

// détermination du rayon de placement et de l'azimut

_rd = _rmax - _rmin;

_r = _rmin + (random _rd) ;

_alpha = random 360 ;

//infos hint serveur

hintsilent format ["chasepatrol.sqf \n R: %1m \n alpha: %2m", _r , _alpha ];

sleep 1;

//détermination de la cible (max rank -1 si max rank pas au sol)

_alltarget = units _targetgrp ;

_nbtarget = count _alltarget;

if (_nbtarget==0) exitWith {};

_n=0;

while {(not alive (_alltarget select _n))&&(((getpos (_alltarget select _n)) select 2)>1)} do{

_n=_n+1;

};

_ldtargetgrp = _alltarget select _n ;

//détermination si apparition relative à la position des joueurs ou celle de la logique de jeu déclarée

if (_spawnattarget==1) then{_spawn setpos (position _ldtargetgrp)};

_posspawn = getpos _spawn ;

_posspawnx = (_posspawn select 0) + (cos(_alpha) * _r ) ;

_posspawny = (_posspawn select 1) + (sin(_alpha) * _r ) ;

_posspawn = [ _posspawnx , _posspawny ];

//controle si le point d'apparition se trouve sur dans une zone d'eau, le cas echeant le script sera relancé tant que le point d'apparition n'est pas sur la terre ferme

if (surfaceIsWater _posspawn ) exitWith{ [_targetgrp ,_spawn ,_spawnattarget ,_rmin ,_rmax, _nmin, _nmax ] execVM "chasepatrol.sqf"};

if (not(surfaceIsWater _posspawn)) then{

//creation de la patrouille de chasseurs en fonction des valeurs min et max déclarées et en fonction du coté du groupe de joueurs

switch (_defside) do{

case (east): {

_chasegrp = creategroup east ;

if (_nbunit >1) then{ "RU_Soldier_SL" createunit [ _posspawn , _chasegrp , "", _slvl , "CAPTAIN" ] };

if (_nbunit >2) then{ "RU_Soldier_Medic" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >3) then{ "RU_Soldier_MG" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >4) then{ "RU_Soldier_AT" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >5) then{ "RU_Soldier_GL" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >6) then{ "RU_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >7) then{ "RU_Soldier_Medic" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >8) then{ "RU_Soldier_MG" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >9) then{ "RU_Soldier_AT" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >10) then{ "RU_Soldier_GL" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >11) then{ "RU_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >12) then{ "RU_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

};

case (west): {

_chasegrp = creategroup west ;

if (_nbunit >1) then{ "USMC_Soldier_SL" createunit [ _posspawn , _chasegrp , "", _slvl , "CAPTAIN" ] };

if (_nbunit >2) then{ "USMC_Soldier_Medic" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >3) then{ "USMC_Soldier_MG" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >4) then{ "USMC_Soldier_AT" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >5) then{ "USMC_Soldier_GL" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >6) then{ "USMC_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >7) then{ "USMC_Soldier_Medic" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >8) then{ "USMC_Soldier_MG" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >9) then{ "USMC_Soldier_AT" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >10) then{ "USMC_Soldier_GL" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >11) then{ "USMC_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

if (_nbunit >12) then{ "USMC_Soldier" createunit [ _posspawn , _chasegrp , "", _slvl , "SOLDAT"] };

};

};

//boucle tant que condition vraie, executer la chasse

_loop=true;

while {(_loop)} do{

deleteWaypoint [ _chasegrp , 0] ;

_allhunter = units _chasegrp ;

_nbhunter = count _allhunter ;

_alltarget = units _targetgrp ;

_nbtarget = count _alltarget ;

//infos hint serveur

hintsilent format [" nbchasegrp: %1 \n nbtarget: %2", _nbhunter , _nbtarget ];

sleep 0.5;

//controle si unite encore vivante dans la patrouille de chasse ou dans le groupe cible

if ((_nbhunter==0)||(_nbtarget==0)) then{

_loop=false;

if (!_loop) exitwith{};

};

//determination de la cible la plus proche

_dmin=99999;

_d=0;

for [{_i=0}, {_i < count _alltarget }, {_i=_i+1}] do{

_allhunter = units _chasegrp ;

_nbhunter = count _allhunter ;

_alltarget = units _targetgrp ;

_nbtarget = count _alltarget ;

if ((_nbhunter==0)||(_nbtarget==0)) then{

_loop=false;

if (!_loop) exitwith{};

};

_n=0;

while {not alive (_allhunter select _n)} do{

_n=_n+1;

};

_d = (_allhunter select _n) distance (_alltarget select _i);

hintsilent format ["%1",_d];

sleep 0.1;

if (((getpos (_alltarget select _i) select 2)<1)&&(alive(_alltarget select _i))) then{

if (_dmin>_d) then{

_dmin=_d;

target = (_alltarget select _i) ;

sleep 0.1;

};

};

};

//creation du point de passage en mode rejoindre positionné sur le chef de groupe encore vivant

postarget = getpos target ;

hintsilent format ["poswp\n%1\n%2",target, postarget];

sleep 1;

_postargetx = postarget select 0 ;

_postargety = postarget select 1 ;

_wp = _chasegrp AddWaypoint [[ _postargetx , _postargety ], 0];

_wp setWaypointType "SAD" ;

_wp setWaypointSpeed "FULL" ;

_wp setWaypointBehaviour "AWARE" ;

_wp setWaypointCombatMode "RED";

_wp setWaypointFormation "VEE" ;

//test si groupe de joueurs reperes par les chasseurs alors passage en mode combat

for [{_i=0}, {_i < count _alltarget }, {_i=_i+1}] do{

_allhunter = units _chasegrp ;

_nbhunter = count _allhunter ;

_alltarget = units _targetgrp ;

_nbtarget = count _alltarget ;

if ((_nbhunter==0)||(_nbtarget==0)) then{

_loop=false;

if (!_loop) exitwith{};

};

_kv = { _x knowsAbout ( _alltarget select _i) } foreach _allhunter ;

hintsilent format [" DetectLevel= %1", _kv] ;

sleep 0.1;

if ( _kv > _dlvl ) then{

_chasegrp setCombatMode "RED" ;

_chasegrp setbehaviour "COMBAT" ;

_chasegrp setFormation "LINE" ;

hintsilent "repere/detected\n...combat";

sleep 0.1;

}else{

hintsilent "pas repere/not detected";

sleep 0.1;

};

};

};

};

};

};

if (true) exitwith{hintsilent "FIN/END"};

// SCRIPT DE PATROUILLE DE CHASSEURS / SCRIPT PATROL HUNTERS

// auteur/author: FAR-FD AIR K

// mail: fd_air_k@hotmail.com

// clan: www.clan-far.fr

// Merci pour vos retours d'information, thank for your feedbacks

Share this post


Link to post
Share on other sites

Thx for informing us! :cool:

Put it on our scripts section at Assault Mission Studio.

dlicon.gif

Patrol Hunters Script [v0.3] by FAR-FD AIR K

Share this post


Link to post
Share on other sites

Hmm, i tested this today for my mission and it won't work with east side spawn. West side works. Any new version in sight? ^^

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
Sign in to follow this  

×