Jump to content

Recommended Posts

Hola,

 

Here we have a first version of my dynamic trader camp spawn script.

I will open a proper topic after my holidays. Until then I would be happy to receive feedback and suggestions!

 

Functions of the script

- spawns a trader camp at one of 5 pre-placed markers (more markers can be added)

- spawns 3 traders (arms, supplies, gear) that can not move and can not be killed

- spawns guards that will patrol the area

- looper to simulate that the traders are moving around (spawn and despawn). e.g. place 5 markers along a long road to simulate that the traders are traveling that road

- the gear that the traders sell is depending on your ravage equipment settings (e.g. specific mods, or custom lootlist via modules..)

 

How to create, use and Install the script:

Step 1 - init.sqf

1. Open notepad.

2. Copy this code ------->  [] execVM "tradercamp.sqf";  

3. Paste the code into your notepad doc.

4. Save the notepad document with this name ----->  init.sqf

5. Move the init.sqf to your mission folder.

===================================

Note - if you already have an init.sqf then just add the code from 2 to it.

 

Step 2 - tradercamp.sqf

1. Open notepad.

2. Copy this code ------> from the spoiler below

3. Paste the code into your notepad doc.

4. Save the notepad document with this name ------> tradercamp.sqf

5. Move the tradercamp.sqf to your mission folder.

 

Spoiler

//VANDEANSONS DYNAMIC TRADERCAMP SPAWNER
//AUGUST 3, 2018
//VERSION 0.9
//DEPENDENCIES: RAVAGE & CBA

_traderspawn = selectRandom ["mrkrTR_1"];

_traders = createGroup west;
_trader1 = _traders createUnit ["B_G_Survivor_F", getMarkerPos _traderspawn, [], 0, "FORM"];
[_trader1] call rvg_fnc_equip;
_trader1 setVariable ["isTrader", "rvg_supplies_s", true];
_trader1 allowDamage false;
_trader1 disableAI "MOVE";
_trader2 = _traders createUnit ["B_G_Survivor_F", getMarkerPos _traderspawn, [], 0, "FORM"];
[_trader2] call rvg_fnc_equip;
_trader2 setVariable ["isTrader", "rvg_arms_s", true];
_trader2 allowDamage false;
_trader2 disableAI "MOVE";
_trader3 = _traders createUnit ["B_G_Survivor_F", getMarkerPos _traderspawn, [], 0, "FORM"];
[_trader3] call rvg_fnc_equip;
_trader3 setVariable ["isTrader","rvg_gear_s", true];
_trader3 allowDamage false;
_trader3 disableAI "MOVE";


while {true} do {// THIS LOOPS THE SCRIPT

_mark = selectRandom ["mrkrTR_1","mrkrTR_2","mrkrTR_3","mrkrTR_4","mrkrTR_5"];

//1.1 SOME DETAILS THAT CAN BE CONFIGURED:
_activationRadius = 4000; // (REFERENCE FOR CODE UNDER ITEM 2) SETS THE RADIUS AROUND THE FIRST MARKER, WHERE THE SCRIPT IS ACTIVE. WHEN THE PLAYER IS OUTSIDE THIS RADIUS, THE SCRIPT WILL PAUSE TO SAVE FPS
_despawnSleepRnd = 3600; // (REFERENCE FOR CODE UNDER ITEM 8)SETS THE TIMER IN SECONDS FOR THE CAMPT TO DESPAWN, WILL SELECT A RANDOM NUMBER (E.G. 3600: IT WILL SELECT A RANDOM NUMBER BETWEEN 1 AND 3600)
_despawnSleepFix = 1000;// (REFERENCE FOR CODE UNDER ITEM 8)SETS A FIX TIMER IN SECONDS THAT WILL RUN AFTER THE RANDOM TIMER
_despanPauseProxy = 300;// (REFERENCE FOR CODE UNDER ITEM 9)SETS A RADIUS AROUND THE CAMP POSITION.WHEN THE PLAYER IS WITHIN THIS RADIUS, DESPAWNING IS PAUSED
//////////////////////
//2 PROXIMITY CHECK///
//- CHECKS IF THE PLAYER IS CLOSE ENOUGH TO THE MAIN MARKER.//
/////////////////////////////////////////////////////////
WaitUntil {player distance (GetMarkerPos "mrkrTR_1") < _activationRadius}; ///THE MARKER, IN THIS CASE "mrkrA_1" MUST ALWAYS BE IN THE CENTER OF A 4000 METERS RADIOS AND ALL ADDITIONAL MARKERS MUST BE WITHIN THIS RADIUS. CHANGE THE NUMBER TO INCREASE OR DECREASE THE RADIUS

/////////////////////////////////////////////////////////////////////
//3. ARRAYS OF OBJECTS, STRUCTURES AND ITEMS THAT WILL SPAWN/////////
/////////////////////////////////////////////////////////////////////
//3.1. LOOTABLE OBJECTS AND WRECKS
_objectsArray = ["Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F",
"Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F","TargetP_Zom_F",
"Land_Pallets_F","Land_GarbageBags_F","Land_WoodPile_large_F","Land_WoodPile_F"];

//3.2. STRUCTURES SUCH AS TENTS, HOUSES,ambient vehicles...
_trucks = ["C_Truck_02_covered_F","C_Truck_02_transport_F","B_Truck_01_covered_F"];
_tents = ["Land_TentDome_F","Land_TentA_F"];
_camonets = ["CamoNet_BLUFOR_open_F"];
_campfire = ["Campfire_burning_F","MetalBarrel_burning_F"];


/////////////////////////////////////////////////////////////////////
//5. SPAWNER:
//THIS PART;
//-  SELECTS RANDOM ITEMS, OBJECTS, STRUCTURES FROM POINT 4. ABOVE
//-  CREATES A SPAWNPOINT RELATIVE TO THE MARKER RANDOMLY SELECTED UNDER POINT 3. ABOVE
//-  SPAWNS STRUCTURES, OBJECTS AND THE LOOTBOX
//-  DISABLE DAMAGE OF SPAWNED STRUCTURES, OBJECTS OR LOOTBOX
//-  SET THE DIRECTION THE OBJECT OR STRUCTURE IS HEADING/////////
/////////////////////////////////////////////////////////////////////
//5.1 FIREPLACE, TENTS, CAMONETS SPAWNER
_fireplace = _campfire call BIS_fnc_selectRandom createVehicle getMarkerPos _mark; //SELECTS SPAWN POSITION RELATIVE TO _MARK AND SPAWNS A STRUCTURES FROM THE RESPECTIVE ARRAY
_fireplace allowDamage false; // DISABLE DAMANGE FOR THE OBJECT
_fireplace setDir 180; // SET DIRECTION

_tent1 = _tents call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 8*sin(225), (getMarkerPos _mark select 1) + 8*cos(225), 0];
_tent1 allowDamage false;
_tent1 setDir (random 359);

_tent2 = _tents call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 15*sin(180), (getMarkerPos _mark select 1) + 15*cos(180), 0];
_tent2 allowDamage false;
_tent2 setDir 250;
_tent2cover = _camonets call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) +15*sin(180), (getMarkerPos _mark select 1) +15*cos(180), 0];
_tent2cover allowDamage false;
_tent2cover setDir 250;

_tent3 = _tents call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) +15*sin(270), (getMarkerPos _mark select 1) +10*cos(270), 0];
_tent3 allowDamage false;
_tent3 setDir 320;
_tent3cover = _camonets call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) +15*sin(270), (getMarkerPos _mark select 1) +15*cos(270), 0];
_tent3cover allowDamage false;
_tent3cover setDir 350;

//////////////////
//7. AI SPAWNER//
////////////////

_guards = createGroup west;
"B_G_Survivor_F" createUnit [getMarkerPos _mark, _guards, "[this] call rvg_fnc_equip;", 1, "corporal"];
_guards2 = createGroup west;
"B_G_Survivor_F" createUnit [getMarkerPos _mark, _guards2, "[this] call rvg_fnc_equip;", 1, "corporal"];
_guards3 = createGroup west;
"B_G_Survivor_F" createUnit [getMarkerPos _mark, _guards3, "[this] call rvg_fnc_equip;", 1, "corporal"];
_guards4 = createGroup west;
"B_G_Survivor_F" createUnit [getMarkerPos _mark, _guards4, "[this] call rvg_fnc_equip;", 1, "corporal"];

//7.3 WAYPOINTS - THIS IS VERY BASIC AND JUST MAKES THE GUARDS MOVE AROUND CLOSE TO THE CAMP
// THE BELOW SETS A "SEARCH AND DESTROY" WAYPOINT THAT MAKES THE AI WANDER THE CAMP AND LOOK FOR ENEMIES
_wp1 = _guards addWaypoint [getmarkerpos _mark, 0];
    _wp1 setWaypointType "SAD"; //SETS THE WAYPOINT AS SEARCH AND DESTROY
    _wp1 setWaypointSpeed "Limited"; //SETS THE SPEED
    _wp1 setWaypointBehaviour "AWARE"; // SETS THE COMBAT STANCE
    _wp1 setWaypointFormation "COLUMN"; // SETS THE FORMATION

_wp1 = _guards2 addWaypoint [getmarkerpos _mark, 0];
    _wp1 setWaypointType "SAD";
    _wp1 setWaypointSpeed "Limited";
    _wp1 setWaypointBehaviour "AWARE";
    _wp1 setWaypointFormatioN "LINE";

_wp1 = _guards3 addWaypoint [getmarkerpos _mark, 0];
		    _wp1 setWaypointType "SAD";
		    _wp1 setWaypointSpeed "Limited";
		    _wp1 setWaypointBehaviour "AWARE";
		    _wp1 setWaypointFormatioN "LINE";

_wp1 = _guards4 addWaypoint [getmarkerpos _mark, 0];
    _wp1 setWaypointType "SAD";
    _wp1 setWaypointSpeed "Limited";
    _wp1 setWaypointBehaviour "AWARE";
    _wp1 setWaypointFormatioN "LINE";

//traderteleport
_trader1 setpos [(getMarkerPos _mark select 0) + 5*sin(225), (getMarkerPos _mark select 1) + 5*cos(225), 0];
_trader2 setpos [(getMarkerPos _mark select 0) + 5*sin(0), (getMarkerPos _mark select 1) + 5*cos(0), 0];
_trader3 setpos [(getMarkerPos _mark select 0) + 5*sin(90), (getMarkerPos _mark select 1) + 5*cos(90), 0];

sleep 0.2;
_truck1pos = [getPosATL _fireplace, 18, 25, 2, 0, 100, 0] call BIS_fnc_findSafePos;
_truck = _trucks call BIS_fnc_selectRandom createVehicle _truck1pos;
_truck allowDamage false;
_truck setDir 10;
_truck setvehiclelock "LOCKED";
clearItemCargoGlobal _truck;

sleep 0.2;
_truck1pos = [getPosATL _fireplace, 18, 25, 2, 0, 100, 0] call BIS_fnc_findSafePos;
_truck1 = _trucks call BIS_fnc_selectRandom createVehicle _truck1pos;
_truck1 allowDamage false;
_truck1 setDir 85;
_truck1 setvehiclelock "LOCKED";
clearItemCargoGlobal _truck1;

sleep 0.2;
_truck2pos = [getPosATL _fireplace, 18, 25, 2, 0, 100, 0] call BIS_fnc_findSafePos;
_truck2 = _trucks call BIS_fnc_selectRandom createVehicle _truck2pos;
_truck2 allowDamage false;
_truck2 setDir 46;
_truck2 setvehiclelock "LOCKED";
clearItemCargoGlobal _truck2;


sleep 0.2;
_pos1 = [getPosATL _fireplace, 5, 15, 2, 0, 100, 0] call BIS_fnc_findSafePos;
_object1 = _objectsArray call BIS_fnc_selectRandom createVehicle _pos1;
_object1 allowDamage false;
_object1 setDir (random 359);


_pos2 = [getPosATL _fireplace, 5, 15, 2, 0, 100, 0] call BIS_fnc_findSafePos;
_object2 = _objectsArray call BIS_fnc_selectRandom createVehicle _pos2;
_object2 allowDamage false;
_object2 setDir (random 359);

_pos3 = [getPosATL _fireplace, 5, 15, 2, 0, 100, 0] call BIS_fnc_findSafePos;
_object3 = _objectsArray call BIS_fnc_selectRandom createVehicle _pos3;
_object3 allowDamage false;
_object3 setDir (random 359);

_pos4 = [getPosATL _fireplace, 5, 15, 2, 0, 100, 0] call BIS_fnc_findSafePos;
_object4 = _objectsArray call BIS_fnc_selectRandom createVehicle _pos4;
_object4 allowDamage false;
_object4 setDir (random 359);

_pos5 = [getPosATL _fireplace, 5, 15, 2, 0, 100, 0] call BIS_fnc_findSafePos;
_object5 = _objectsArray call BIS_fnc_selectRandom createVehicle _pos5;
_object5 allowDamage false;
_object5 setDir (random 359);

_pos6 = [getPosATL _fireplace, 5, 15, 2, 0, 100, 0] call BIS_fnc_findSafePos;
_object6 = _objectsArray call BIS_fnc_selectRandom createVehicle _pos6;
_object6 allowDamage false;
_object6 setDir (random 359);

_pos7 = [getPosATL _fireplace, 5, 15, 2, 0, 100, 0] call BIS_fnc_findSafePos;
_object7 = _objectsArray call BIS_fnc_selectRandom createVehicle _pos7;
_object7 allowDamage false;
_object7 setDir (random 359);


////////////////////////////////////////
//8. TIMER IN SECONDS UNTIL THE CAMP DESPAWNS AND RESPAWNS AGAIN
///////////////////////////////////////////////////////
Sleep (random _despawnSleepRnd);Sleep _despawnSleepFix; // (CHANGE FIGURES UNDER ITEM 1.1)FIRST NUMBER STES A RANDOM AMOUNT OF SECONDS BETWEEN 1-3600 AND THE SECOND NUMBER SETS A DEFINITE TIMER OF 1000 SECODS. SO THE CAMP WILL RESPAWN EARLIEST AFTER 1000 SECONDS AND AT MAXIMUM AFTER 4600 SECONDS OR IF POINT 9. BELOW IS THE CASE.

////////////////////
//9. PAUSE DESPAWN, IF PLAYER IS TOO CLOSE TO THE CAMP
//////////////////////
WaitUntil {player distance (GetMarkerPos _mark) > _despanPauseProxy}; // (CHANGE FIGURES UNDER ITEM 1.1)IF THE PLAYER IS WITHIN xyz METERS CLOSE TO THE MAIN MARKER, THE SCRIPT WILL PAUSE AND WILL NOT DESPAWN. THE SCRIPT WILL PROCEED ONCE THE PLAYER IS FURTHER AWAY THAN 200 METERS.

///////////////////////////
//10. DESPAWN/DELETION/////
///////////////////////////
//- ANY SPAWNED OBJECT RECEIVES A REFERENCE (EG. _FIREPLACE) AND NEEDS TO BE DELETED AS SHOWN BELOW
deleteVehicle _fireplace;
deleteVehicle _truck;
deleteVehicle _truck1;
deleteVehicle _truck2;
deleteVehicle _tent1;
deleteVehicle _tent2;
deleteVehicle _tent3;

deleteVehicle _tent2cover;
deleteVehicle _tent3cover;

deleteVehicle _object1;
deleteVehicle _object2;
deleteVehicle _object3;
deleteVehicle _object4;
deleteVehicle _object5;
deleteVehicle _object6;
deleteVehicle _object7;

/*//10.1 DELETES ITEMS THAT WHERE SPAWNED IN MULTIPLE BUILDING POSITIONS
{	deleteVehicle _x; } forEach _itemBoxArray1;
{	deleteVehicle _x; } forEach _itemBoxArray2;
{	deleteVehicle _x; } forEach _itemBoxArray3;
*/
//10.1 DELEETES ALIVE AI FROM GROUP _bandits (NEEDS TO BE SET UP FOR ALL GROUPS OF AI)
if(isNil("_guards"))exitWith{};
{
	if(vehicle _x != _x)then{deleteVehicle (vehicle _x);};
	deleteVehicle _x;
}forEach units _guards; //EXECUTES DELETION FOR ALL UNITS OF SAID GROUP

//10.1 DELEETES ALIVE AI FROM GROUP _bandits
if(isNil("_guards2"))exitWith{};
{
	if(vehicle _x != _x)then{deleteVehicle (vehicle _x);};
	deleteVehicle _x;
}forEach units _guards2;

if(isNil("_guards3"))exitWith{};
{
	if(vehicle _x != _x)then{deleteVehicle (vehicle _x);};
	deleteVehicle _x;
}forEach units _guards3;

if(isNil("_guards4"))exitWith{};
{
	if(vehicle _x != _x)then{deleteVehicle (vehicle _x);};
	deleteVehicle _x;
}forEach units _guards4;

//10.2 DELETES DEAD AI
{ deleteVehicle _x; } forEach allDead;
//10.3 DELETS OBJECTS THAT MAY HAVE BEEN SPAWNED INTO SPAWNED STRUCTURES VIA RAVAGE LOOT MODULE
{ deleteVehicle _x; } forEach nearestObjects [getMarkerPos _mark,["WeaponHolder","GroundWeaponHolder"],550];
};

 

 

Make sure to place all markers on your map in the eden editor:

mrkrTR_1

mrkrTR_2

mrkrTR_3

mrkrTR_4

mrkrTR_5

 

Credits:

to @GEORGE FLOROS GR for his help!

 

Dependencies:

Ravage and CBA and you need to place the Ravage Ambient AI module and the Ravage Equipment module as the traders goods and gear will depend on the settings there

 

Changelog:

v.0.9

- hasty release before my holiday absence ;)

  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites
10 hours ago, Vandeanson said:

dynamic trader camp spawn script

 

Well done Vandeanson

and thank you very much also !

  • Thanks 1

Share this post


Link to post
Share on other sites

So yea I've added many weapons to the common, millitary, and rare lists within the equipment module....thing is though is that the game still generates vanilla weapons occasionally. Is there anyway to eliminate arma 3 weapons from the loot pool?

Share this post


Link to post
Share on other sites

Hello, 

I tried this great mod, but some points are not clear.

 

Ambient Ai zombie....keep spawning forever, with maximum number considered as "max number of zombie in map at same time" 

Or

It spawns the max number of zombie per player, then stops ?

 

Same for the horde....is it one-shot or will they respawn with time ?
where do the zombies spawn ? only buildings ? how make them spawn also in random area, like an open field, a forest ecc?

 

My goal is to populate the map with random zombies all the time, and have "more zombies" or hordes in some places...that respawn after some time.

And with a cap on max number of zombies at same time...for performance reasons !

 

Thanks for any help

Share this post


Link to post
Share on other sites
3 hours ago, dlegion said:

Ambient Ai zombie....keep spawning forever, with maximum number considered as "max number of zombie in map at same time" 

Same for the horde....is it one-shot or will they respawn with time ?
where do the zombies spawn ? only buildings ? how make them spawn also in random area, like an open field, a forest ecc?

 

 

Ambient zombies keep spawning forever. The maximum is indeed the maximum number on the map at any one time. Zombies despawn when the player moves out of range.

 

The horde is a one-shot. They don't respawn over time. When the player moves away, the horde does not despawn.

 

Zombies spawn in the vicinity of buildings or constructions.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
2 hours ago, kodabar said:

Zombies spawn in the vicinity of buildings or constructions.

thanks!
is there any way to make them spawn everywhere ? its really limitating my mission a lot...
is there any way to make a place spawn hordes at random times or something like this ?
(maybe i can script to randomly spawn a    RAVAGE_HORDES    module ? (how do that? ) 

thanks for answering man !

 

Share this post


Link to post
Share on other sites
15 hours ago, kodabar said:

The horde is a one-shot. They don't respawn over time. When the player moves away, the horde does not despawn.

 

BTW, did anyone find a way to spawn zombie hordes at a random place? Problem is, ArmA forgets this random radius in those editor objects, an old story.

Maybe Haleks can tell the internal command of defining a horde?

Share this post


Link to post
Share on other sites

Yesterday i played with my unit 9 players)...and while in the town of agia marina, on stratis, fps went down from 60 to 8 , making it totally unplayable...when other people quitted, fps went back to around 35!

What can be ?

i just placed a "ambient ai zombie" module...si must be something in it...maybe related to the gact it search for buildings to spawn zombies ?

I suggest to optimize it...

Share this post


Link to post
Share on other sites

No mention of the settings inside your Ambient Zombie module doesn't help. ^^

 

With 9 players in a session, default module settings will kill performance for sure (even in Agia Marina)

Personally speaking when playing any mission with zombies, less is much more, especially when performance is at a premium. 

 

Try tweaking these settings in the Ambient Zombie module for better performance.....

: Population Limit (maximum number of infected to spawn per player)
: Global Population Limit (maximum global number of infected to spawn in MP)

: Sun Factor (decreases spawn rate as sun rises)

  • Thanks 5

Share this post


Link to post
Share on other sites

thanks EO!
this evening will test again with this settings tweaked! thanks!

PS: is there a way to spawn an horde on command ?
 

Share this post


Link to post
Share on other sites
2 hours ago, dlegion said:

PS: is there a way to spawn an horde on command ?

 

I don't know for the certain type of horde ,

but why not just to spawn a group  , on a random position and set this to hunt players?

 

I can give you a script for this.

Share this post


Link to post
Share on other sites

i menaged to spawn an horde module with:
 

null = "ravage_hordes" createVehicleLocal (getpos player);"HORDE INCOMING!" remoteExecCall ["hint"];  // for SP only

but i discovered that "global zombie limit" ...simply not work on hordes!
a global limiter is really needed to save performance!!

  • Like 1

Share this post


Link to post
Share on other sites

...and seems they are not in "allunits" list, so how count them ???

Share this post


Link to post
Share on other sites
38 minutes ago, dlegion said:

...and seems they are not in "allunits" list, so how count them ???

 

I believe Ravage zeds are agents

  • Like 1

Share this post


Link to post
Share on other sites

For anyone who is interested:

 

This hunting script is part of my mission WIP Salvation 2

 

To set a hunting Group :

 

1 minute ago, GEORGE FLOROS GR said:
  On 7/8/2018 at 7:07 PM, GEORGE FLOROS GR said:

To set a hunting Group :

 

2 hours ago, GEORGE FLOROS GR said:

add in your init or initServer.sqf

 

  Reveal hidden contents






//________________  Author : [GR]GEORGE F ___________ 12.08.18 _____________

/*

________________	GF Hunting Groups	________________

Please keep the Credits or add them to your Diary

https://community.bistudio.com/wiki/SQF_syntax
Don't try to open this with the simple notepad.
For everything that is with comment  //  in front  or between /* 
means that it is disabled , so there is no need to delete the extra lines. 

You can open this ex:
with notepad++
https://notepad-plus-plus.org/

and also use the extra pluggins
(this way will be better , it will give also some certain colours to be able to detect ex. problems )
http://www.armaholic.com/page.php?id=8680

or use any other program for editing .

For the Compilation List of my GF Scripts , you can search in:
https://forums.bohemia.net/forums/topic/215850-compilation-list-of-my-gf-scripts/
*/


GF_Hunted_Players = allUnits select {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}};
GF_Hunted_Player_selected = GF_Hunted_Players call BIS_fnc_selectRandom;

hint format ["GF_Hunted_Player    %1 ",GF_Hunted_Player_selected];
systemchat format ["GF_Hunted_Player    %1 ",GF_Hunted_Player_selected];


GF_Hunting_Group_spawn_time = 10;	//	The time to spawn the next GF_Hunting_Group

[] spawn {
	while {true} do {
    _time = diag_tickTime + 1;
    _i = 0;
    waitUntil {
		sleep GF_Hunting_Group_spawn_time;
        _i = _i + 1;
		
        diag_tickTime >= _time
    };
[] execVM "Recon_Hunting_Group.sqf";
//	hint "Recon_Hunting_Group.sqf";
	};
};


[] spawn {
	while {true} do {
    _time = diag_tickTime + 1;	
    _i = 0;
    waitUntil {
	sleep 20;	//	The time to Hunt the next random Player
        _i = _i + 1;		
        diag_tickTime >= _time
    };		
GF_Hunted_Player_selected = GF_Hunted_Players call BIS_fnc_selectRandom;

//hint format ["GF_Hunted_Player    %1 ",GF_Hunted_Player_selected];
//systemchat format ["GF_Hunted_Player    %1 ",GF_Hunted_Player_selected];
	};
};

 

Then create an .sqf

 

_Recon_Hunting_Group.sqf

 

  Reveal hidden contents






//________________  Author : [GR]GEORGE F ___________ 12.08.18 _____________

/*

________________	GF Hunting Groups	________________

Please keep the Credits or add them to your Diary

https://community.bistudio.com/wiki/SQF_syntax
Don't try to open this with the simple notepad.
For everything that is with comment  //  in front  or between /* 
means that it is disabled , so there is no need to delete the extra lines. 

You can open this ex:
with notepad++
https://notepad-plus-plus.org/

and also use the extra pluggins
(this way will be better , it will give also some certain colours to be able to detect ex. problems )
http://www.armaholic.com/page.php?id=8680

or use any other program for editing .

For the Compilation List of my GF Scripts , you can search in:
https://forums.bohemia.net/forums/topic/215850-compilation-list-of-my-gf-scripts/
*/


if (!isServer) exitWith {};

	hint"_Recon_Hunting_Group";
	
#define _Recon_Hunting_Group "I_Soldier_SL_F", "I_Soldier_TL_F", "I_soldier_UAV_F", "I_Soldier_M_F","I_medic_F","I_Soldier_AR_F"

	_enemies_Array = [grpNull];	
	
	_Recon_Hunting_Teams = createGroup independent;
	_GF_randomPos = [[[GF_Hunted_Player_selected, (1500)],[]],["water","out"]] call BIS_fnc_randomPos;
	_Recon_Hunting_Teams = [_GF_randomPos, independent,[_Recon_Hunting_Group]] call BIS_fnc_spawnGroup;
	_Recon_Hunting_Teams setCombatMode "YELLOW";
	_Recon_Hunting_Teams setSpeedMode "NORMAL";	
	_Recon_Hunting_Teams allowFleeing 0; 	
	_Waypoint =_Recon_Hunting_Teams addWaypoint [(GF_Hunted_Player_selected ) ,0];	
	_Waypoint setWaypointType "SAD";	
	
	
	_enemies_Array = _enemies_Array + [_Recon_Hunting_Teams];


while {true} do {
    _time = diag_tickTime + 1;
    _i = 0;
    waitUntil {
	sleep 10;
        _i = _i + 1;		
        diag_tickTime >= _time
    };
	
	hint "_Updating_WP";
	{
	deleteWaypoint [_x, 0];	
	_Updating_WP = _x addWaypoint [(GF_Hunted_Player_selected ) ,0];	
    _Updating_WP setWaypointType "SAD";		//	SAD 	MOVE
    _x setCombatMode "YELLOW";			//	YELLOW	RED
    _x setSpeedMode "NORMAL";			//	NORMAL	FULL
    _x allowFleeing 0; 
	}foreach [_Recon_Hunting_Teams];
	
};	

 

 

 

 


#define _Recon_Hunting_Group "zombie_runner","zombie_walker","zombie_bolter"

 

 

Keeping steady numbers is good for performance.

  • Like 3

Share this post


Link to post
Share on other sites
47 minutes ago, dlegion said:

they are not in "allunits" list, so how count them ???

6 minutes ago, EO said:

I believe Ravage zeds are agents

[] spawn {
	while {true} do {
    _time = diag_tickTime + 2;	
    _i = 0;
    waitUntil {
	sleep 1;
    _i = _i + 1;		
    diag_tickTime >= _time
    };	
	
//diag_log format ["FPS : %1    ||    Objects : %2    ||    allUnits : %3",round diag_fps,count allMissionObjects "All",count allUnits,{count _x;}];
systemchat format ["FPS : %1    ||    Objects : %2    ||    agents : %3",round diag_fps,count allMissionObjects "All",count agents,{count _x;}];	

	};
};

 

Share this post


Link to post
Share on other sites

thanks guys!

i writed this "global limiter" for my needs, maybe someone will find it useful:
 


_Zn = [];
{if ((side _x != CIVILIAN) && (side _x != WEST) && (_x isKindOf "CAManBase") && (!isPlayer _x)) then {_Zn append [_x]}; } foreach (allmissionObjects "");
uiSleep 1;

while {(count _Zn) > 95} do {

uiSleep 0.3;
_Zn = [];
{if ((side _x != CIVILIAN) && (side _x != WEST) && (_x isKindOf "CAManBase") && (!isPlayer _x)) then {_Zn append [_x]}; } foreach (allmissionObjects "");
if ((count _Zn) > 90) then {_TOdel = selectrandom _Zn;deleteVehicle _TOdel;};

};   // END  WHILE loop

bye!

  • Like 2

Share this post


Link to post
Share on other sites

here are curent problems i found:
- global limiter dont work at all (and is really needed)
- activating cleaner delete also the dead needed to operate the zeus, resulting in zeus not usable!
- an error about deletion range , i link error screenshot https://ibb.co/k859GK
- ambient zombie if manually deleted does not respawn.
- zombie kill count is plain wrong
- sometimes zombies does not attack players, especially after a move or doMove command.

hope it helps, bye

Share this post


Link to post
Share on other sites

Hi guys, I'm thinking about posting quite a few scripts I made which are especially useful for Ravage and SP. E.g. I'm using a script which lets units accidentally shoot at times, so you get awareness of them. Later.

But I already uploaded my reworked weather modules as seen below, may also be useful for Ravage. It's a script version which you can easily put into missions... with no addon requirements. 

 

 

  • Thanks 2

Share this post


Link to post
Share on other sites

OK, I paste my scripts here - which I use in Ravage

Some stuff is from a while ago... some stuff is derived from someone elses stuff, I don't know any more. That's just the way it works. Hopefully it is useful for some of you. I sometimes create stuff only for the scripting fun and pain. I love pain ;-) I think you can even test all the code in a debug window. BTW, I love this kind of syntax and didn't know it is even possible: "_sgn = if (_changeValue < 0) then {-1} else {1};"

 

Have AI of all sides accidentally pull the trigger (code to a game logics init)

 

0 = [] spawn 
{  tort_shoot = true; 
 
   private _minDistance = 20; 
   private _maxDistance = 700; 
   private _minWait     = 10; 
   private _maxWait     = 110; 
   private _maxShots    = 3; 
   private _probability = 0.6; 
 
   while {true} do 
   { 
      sleep (_minWait + random (_maxWait - _minWait)); 
      if (tort_shoot && (_probability >= random 1)) then 
      { 
         _nearUnits = allUnits select {((_x distance player) > _minDistance) && ((_x distance player) <= _maxDistance) && ((side _x) != CIVILIAN) && (alive _x) && (vehicle _x == _x)}; 
         if ((count _nearUnits) > 0) then 
         { 
            _i = 0; while {((random 1) > 0.75) && (_i < ((count _nearUnits) -1))} do {_i = _i + 1}; 
            _unit = _nearUnits select _i; 
            _num = floor(1 + _maxShots * ((random 1)^1.4)); 
            _unit disableAI "MOVE"; _unit disableAI "FSM"; _unit disableAI "AIMINGERROR"; 
            _behaviour = behaviour _unit; 
            _unit setBehaviour "AWARE"; sleep 1; 
            for "_j" from 1 to _num do 
            { 
               _unit forceWeaponFire [currentMuzzle _unit, "Single"]; 
               sleep (0.2 + random 1); 
            }; 
            _unit enableAI "MOVE"; _unit enableAI "FSM"; _unit enableAI "AIMINGERROR"; _unit setBehaviour _behaviour; 
 
         }; 
      }; 
   }; 
};

 

Automatically heal unit (code goes to a units init)

 

0 = player spawn { 
   waituntil {alive _this}; 
   tortdebug = false; 
   private _full_heal_seconds = 900; 
   private _heal_bonus_multiplier = 4; 
   private _heal_bonus_after_seconds = 20; 
   private _removeDamage_until = 0.25; 
   private _addDamage_above_damage = 0.35; 
   private _moredamage_above_damage = 0.5; 
   private _addDamage_until = 0.9; 
   private _random_factor = 0.1; 
 
   private ["_i", "_player_damage", "_speed", "_speedmult", "_modifier", "_pom"]; 
   private _prone_modifier_min = -0.75; 
   private _prone_modifier_max = 0.6; 
   private _prone_maxspd = 5; 
   private _prone_exponent = 1; 
   private _crouch_modifier_min = -0.3; 
   private _crouch_modifier_max = 0.55; 
   private _crouch_maxspd = 18; 
   private _crouch_exponent = 1.5; 
   private _stand_modifier_min = -0.65; 
   private _stand_modifier_max = 0.7; 
   private _stand_maxspd = 19; 
   private _stand_exponent = 2; 
   private _sitsec = 0; 
 
   if (_random_factor > 0) then { 
      _full_heal_seconds = _full_heal_seconds - random (_random_factor * _full_heal_seconds) + random (2 * _random_factor * _full_heal_seconds); 
      _heal_bonus_multiplier = _heal_bonus_multiplier - random (_random_factor * _heal_bonus_multiplier) + random (2 * _random_factor * _heal_bonus_multiplier); 
      _heal_bonus_after_seconds = _heal_bonus_after_seconds - random (_random_factor * _heal_bonus_after_seconds) + random (2 * _random_factor * _heal_bonus_after_seconds); 
      _removeDamage_until = random [0, _removeDamage_until, _addDamage_above_damage]; 
      _addDamage_above_damage = random [_removeDamage_until, _addDamage_above_damage, _moreDamage_above_damage]; 
      _moreDamage_above_damage = random [_addDamage_above_damage, _moreDamage_above_damage, _addDamage_until]; 
      _addDamage_until = random [_moreDamage_above_damage, _addDamage_until, 1]; 
   }; 
 
   tortdoit = true; 
   while {tortdoit} do 
   { 
      _pom = 0; _modifier = 0; 
      for "_i" from 1 to 10  do 
      { 
         _player_damage = damage _this; 
         if (vehicle _this == _this) then 
         { 
            if (_player_damage >= _moredamage_above_damage) then { 
               _speed = abs(speed _this) * _stand_maxspd} 
            else { 
               _speed = abs(speed _this)}; 
            switch (stance _this) do 
            { 
               case "PRONE": { 
                  _sitsec = 0; 
                  _speedmult = ((_speed / _prone_maxspd) min 1) ^ (_prone_exponent); 
                  _pom = _prone_modifier_min + (_prone_modifier_max - _prone_modifier_min) * _speedmult;}; 
               case "CROUCH": { 
                  if (((animationstate _this) find "amovpsit") == 0) then { 
                     _sitsec = _sitsec + 1; 
                     if (_sitsec > _heal_bonus_after_seconds) then { 
                        _pom = _prone_modifier_min * _heal_bonus_multiplier; 
                     } else { 
                        _pom = _prone_modifier_min; 
                     }; 
                  } 
                  else 
                  { 
                     _sitsec = 0; 
                     _speedmult = ((_speed / _crouch_maxspd) min 1)^(_crouch_exponent); 
                     _pom = _crouch_modifier_min + (_crouch_modifier_max - _crouch_modifier_min) * _speedmult; 
                  }; 
               }; 
               case "STAND": { 
                  _sitsec = 0; 
                  _speedmult = ((_speed / _stand_maxspd) min 1)^(_stand_exponent); 
                  _pom = _stand_modifier_min + (_stand_modifier_max - _stand_modifier_min) * _speedmult;}; 
               case "UNDEFINED": { 
                  _sitsec = 0; 
                  _pom = _prone_modifier_min;}; 
               default { 
                  _sitsec = 0; 
                  _speedmult = ((_speed / _stand_maxspd) min 1)^(_stand_exponent); 
                  _pom = _stand_modifier_min + (_stand_modifier_max - _stand_modifier_min) * _speedmult;}; 
            }; 
         } else 
         { 
            _sitsec = _sitsec + 1; _speed = 0; 
            if (_sitsec > _heal_bonus_after_seconds) then { 
               _pom = _prone_modifier_min * _heal_bonus_multiplier; 
            } else { 
               _pom = _prone_modifier_min; 
            }; 
         }; 
         _modifier = _modifier + _pom; 
         sleep 1; 
      }; 
      _modifier = (_modifier / _full_heal_seconds) / abs(_prone_modifier_min); 
      _modifier = _modifier - ((random _random_factor) * _modifier) + ((random _random_factor) * 2 * _modifier); 
      if (_modifier < 0) then { 
         if (_player_damage <= _addDamage_until) then { 
            if (_sitsec < _heal_bonus_after_seconds) then { 
               if ((_player_damage + _modifier) >= _removeDamage_until) then {_this setDamage (_player_damage + _modifier)}; 
            } 
            else { 
               _this setDamage (_player_damage + _modifier); 
            }; 
         }; 
      } 
      else 
      { 
         if (_player_damage > _addDamage_above_damage) then {_this setDamage (((_player_damage + _modifier) min _addDamage_until) max _player_damage)}; 
      }; 
      if (tortdebug) then {_this sideChat format ["SPD:%1 MODIFIER:%2 DAMAGE:%3 SITSEC:%4 %5", _speed, _modifier, (damage _this), _sitsec, animationstate _this]}; 
      if ((_player_damage > 0) && ((damage _this) == 0)) then {_this sideChat (["Oooooh yeah!", "So good...", "I am feeling so good now!", "I feel I am fully healed.", "I feel like superman."] select (floor (random 5)))}; 
   }; 
};

 

Bounty spawner (game logic init)

 

0 = [] spawn {waituntil {alive player}; sleep 5; 
    comment "tort_debug = true"; 
   _crates_minmax = [1, ceil (worldsize / 1500)]; 
   _weapons_minmax = [0,25]; 
   _ammo_minmax = [0,2]; 
   _handgun_probability = 0.7; 
 
   _cratesSmall = ["Box_Syndicate_Wps_F"]; 
   _cratesMedium= ["Box_NATO_Wps_F","Box_NATO_WpsSpecial_F","Box_NATO_Support_F","Box_East_Wps_F","Box_NATO_AmmoVeh_F", 
                   "Box_East_WpsSpecial_F","Box_East_Support_F","Box_IND_Wps_F","Box_IND_WpsSpecial_F", 
                   "Box_IND_Grenades_F","Box_IND_Support_F","Box_NATO_Grenades_F"]; 
   _cratesBig   = ["Box_IND_AmmoVeh_F","Box_East_AmmoVeh_F","Box_NATO_AmmoVeh_F"]; 
   _cratesHuge  = ["B_supplyCrate_F","O_supplyCrate_F","IG_supplyCrate_F","B_CargoNet_01_ammo_F","O_CargoNet_01_ammo_F", 
                   "I_CargoNet_01_ammo_F"]; 
 
   _throwables = ["HandGrenade_Stone",0.1, "HandGrenade",1, "MiniGrenade",0.7, "SmokeShell",0.2,"SmokeShellYellow",0.2, 
                 "SmokeShellGreen",0.2,"SmokeShellRed",0.2,"SmokeShellPurple",0.2,"SmokeShellOrange",0.2, 
                 "SmokeShellBlue",0.2,"Chemlight_green",0.2,"Chemlight_red",0.2,"Chemlight_yellow",0.2, 
                 "Chemlight_blue",0.2,"B_IR_Grenade",0.1,"O_IR_Grenade",0.1,"I_IR_Grenade",0.1]; 
 
 
   private ["_crateObj","_cratePos","_overland","_landpos","_markerColor"]; 
   tort_crates_array = []; 
 
   fn_rnd_num = {(_this select 0) + round(random((_this select 1) - (_this select 0)))}; 
   _crates_amount = _crates_minmax call fn_rnd_num; 
 
   for "_cratesites" from 1 to _crates_amount do { 
      _weapons_amount = _weapons_minmax call fn_rnd_num; 
      _throwables_amount = round(random [0,_weapons_amount/2,_weapons_amount]); 
      _crateObj = selectRandom (_cratesSmall + _cratesMedium + _cratesBig + _cratesHuge); _markercolor = "ColorGreen"; 
      if (_weapons_amount > 7) then {_crateObj = selectRandom (_cratesMedium + _cratesBig + _cratesHuge); _markercolor = "ColorBlue"}; 
      if (_weapons_amount > 13) then {_crateObj = selectRandom (_cratesBig + _cratesHuge); _markercolor = "ColorRed"}; 
      if (_weapons_amount > 24) then {_crateObj = selectRandom _cratesHuge; _markercolor = "ColorBlack"}; 
 
      _overland=false; 
      while {!_overland} do { 
         _landpos = [random worldsize, random worldsize, 0]; 
         _overland = !(_landpos isFlatEmpty [-1, -1, -1, -1, 0, false] isEqualTo []); 
      }; 
      _overland = _landpos findEmptyPosition [0,25,_crateObj]; 
      if (count _overland > 0) then {_cratepos = _overland} else {_cratepos = _landpos}; 
 
      _crateObj_final = _crateObj createVehicle _cratepos; 
      _crateObj_final setdir random 360; 
 
      tort_crates_array pushBack _crateObj_final; 
 
      clearWeaponCargo _crateObj_final; 
      clearMagazineCargo _crateObj_final; 
      if (0.55 > random 1) then {clearItemCargo _crateObj_final}; 
 
      if (0.9 > random 1) then 
      { 
         _grass0 = "ClutterCutter" createVehicle _cratepos; 
         _grass0 attachto [_crateObj_final, [0,0,0]]; 
         _grass1 = "ClutterCutter" createVehicle _cratepos; 
         _grass1 attachto [_crateObj_final, [5,5,0]]; 
         _grass2 = "ClutterCutter" createVehicle _cratepos; 
         _grass2 attachto [_crateObj_final, [5,-5,0]]; 
         _grass3 = "ClutterCutter" createVehicle _cratepos; 
         _grass3 attachto [_crateObj_final, [-5,5,0]]; 
         _grass4 = "ClutterCutter" createVehicle _cratepos; 
         _grass4 attachto [_crateObj_final, [-5,-5,0]]; 
      }; 
 
      _ammo_amount = _ammo_minmax call fn_rnd_num; 
 
      if (_weapons_amount > 0) then 
      { 
         for "_addLoot" from 1 to _weapons_amount do 
         { 
            _cfgWeapons = "true" configClasses (configFile >> "cfgWeapons"); 
            _weaponArray = []; 
            if (_handgun_probability < random 1) then { 
               _cfgWeapons = "getnumber (_x >> 'type') isEqualTo 1 AND getnumber (_x >> 'scope') isEqualTo 2" configClasses (configfile >> 'CfgWeapons');} 
            else { 
               _cfgWeapons = "getnumber (_x >> 'type') isEqualTo 2 AND getnumber (_x >> 'scope') isEqualTo 2" configClasses (configfile >> 'CfgWeapons' ); 
            }; 
            {  _weaponString = configName (_x); 
               _weaponArray pushBack _weaponString; 
            }  forEach _cfgWeapons; 
            _weaponsObj = selectRandom _weaponArray; 
            _ammo = getarray(configFile >> "cfgWeapons" >> _weaponsObj >> "magazines" ); 
            _crateObj_final addItemCargo [_weaponsObj, 1]; 
 
            for "_i" from 1 to _ammo_amount do 
            { 
              _crateObj_final addMagazineCargo [selectRandom _ammo, 1]; 
            }; 
         }; 
      }; 
 
      if (0.4 > random 1) then {_crateObj_final addItemCargo ["MineDetector", 1]}; 
 
      if (_throwables_amount > 0) then { 
         for "_i" from 1 to _throwables_amount do 
         { 
           _crateObj_final addMagazineCargo [selectRandomWeighted _throwables, 1]; 
         }; 
      }; 
 
      if (!(isnil "tort_debug")) then 
      { 
         if (tort_debug) then { 
            systemchat format ["%1 at %2 with %3 weapons ",_crateObj,_cratepos,_weapons_amount]; 
            _marker = createMarkerlocal [format ["CrateMarker_%1", str _cratesites], _cratepos]; 
            format ["CrateMarker_%1", str _cratesites] setMarkerTypelocal "mil_dot_noshadow"; 
            format ["CrateMarker_%1", str _cratesites] setMarkerColorlocal _markercolor; 
         }; 
      }; 
   }; 
};

 

Change AI skill (game logic init)

 

0 = [[0.2,0.4,0.8], [0.05,0.7]] spawn 
{ 
   private _sleep = 60 + random 30; 
   private _multiApply = false; 
   tortdoit = true;
   tort_debug=false;
 
   private ["_a","_b","_c","_d","_e","_f"]; 
   private _altermyside = false; 
   private _alterotherside = false; 
   private _myunits = []; 
   private _otherunits = []; 
 
   if (count (_this select 0) == 3) then 
   { 
      _altermyside = true; 
      _a = _this select 0 select 0; 
      _b = _this select 0 select 1; 
      _c = _this select 0 select 2; 
   }; 
 
   if (count (_this select 0) == 2) then 
   { 
      _altermyside = true; 
      _a = _this select 0 select 0; 
      _b = _this select 0 select 1; 
   }; 
 
   if (count (_this select 1) == 3) then 
   { 
      _alterotherside = true; 
      _d = _this select 1 select 0; 
      _e = _this select 1 select 1; 
      _f = _this select 1 select 2; 
   }; 
 
   if (count (_this select 1) == 2) then 
   { 
      _alterotherside = true; 
      _d = _this select 1 select 0; 
      _e = _this select 1 select 1; 
   }; 
 
   if !(_altermyside || _alterotherside) exitWith {}; 
 
   while {tortdoit} do 
   { 
      { 
         if ((side player) == (side _x)) then 
         { 
            if (_altermyside) then 
            { 
               if (_multiApply || ((_myunits find _x) == -1)) then 
               { 
                  _myunits pushBack _x; 
 
                  if (count (_this select 0) == 3) then 
                  { 
                     _x setskill random [_a,_b,_c]; 
                     _x setskill ["aimingAccuracy", random [_a,_b,_c]]; 
                     _x setskill ["aimingShake", _a + random (_c-_a)]; 
                     _x setskill ["aimingSpeed", random [_a,_b,_c]]; 
                     _x setskill ["commanding", random [_a,_c,_c]]; 
                     _x setskill ["courage", random [_a,_c,_c]]; 
                     _x setskill ["reloadSpeed", _a + random (_c-_a)]; 
                     _x setskill ["spotDistance", random [_b,_b,_c]]; 
                     _x setskill ["spotTime", random [_b,_b,_c]]; 
                  } 
                  else 
                  { 
                     _x setskill _a + random (_b - _a); 
                     _x setskill ["aimingAccuracy", _a + random (_b - _a)]; 
                     _x setskill ["aimingShake", _a + random (_b - _a)]; 
                     _x setskill ["aimingSpeed", _a + random (_b - _a)]; 
                     _x setskill ["commanding", random [_a,_b,_b]]; 
                     _x setskill ["courage", _a + random (_b - _a)]; 
                     _x setskill ["reloadSpeed", _a + random (_b - _a)]; 
                     _x setskill ["spotDistance", _a + random (_b - _a)]; 
                     _x setskill ["spotTime", _a + random (_b - _a)]; 
                  }; 
                  sleep 0.2; 
               }; 
            }; 
         } 
         else 
         { 
            if (_alterotherside) then 
            { 
               if (_multiApply || ((_otherunits find _x) == -1)) then 
               { 
                  _otherunits pushBack _x; 
                  if (count (_this select 1) == 3) then 
                  { 
                     _x setskill random [_d,_e,_f]; 
                     _x setskill ["aimingAccuracy", random [_d,_e,_f]]; 
                     _x setskill ["aimingShake",  _d + random (_f-_d)]; 
                     _x setskill ["aimingSpeed", random [_d,_e,_f]]; 
                     _x setskill ["commanding", random [_d,_e,_f]]; 
                     _x setskill ["courage", random [_d,_e,_f]]; 
                     _x setskill ["reloadSpeed", _d + random (_f-_d)]; 
                     _x setskill ["spotDistance", random [_e,_e,_f]]; 
                     _x setskill ["spotTime", random [_e,_e,_f]]; 
                  } 
                  else 
                  { 
                     _x setskill _d + random (_e - _d); 
                     _x setskill ["aimingAccuracy", _d + random (_e - _d)]; 
                     _x setskill ["aimingShake",  _d + random (_e - _d)]; 
                     _x setskill ["aimingSpeed", _d + random (_e - _d)]; 
                     _x setskill ["commanding", _d + random (_e - _d)]; 
                     _x setskill ["courage", _d + random (_e - _d)]; 
                     _x setskill ["reloadSpeed", _d + random (_e - _d)]; 
                     _x setskill ["spotDistance", _d + random (_e - _d)]; 
                     _x setskill ["spotTime", _d + random (_e - _d)]; 
                  }; 
                  sleep 0.2; 
               }; 
            }; 
         }; 
         sleep 0.05; 
      if(tort_debug) then {systemchat format ["%1(%2): %3",_x, side _x, skill _x]}} forEach allUnits; 
   sleep _sleep; 
   if (_multiApply) then {_myunits = []}; 
   }; 
};

 

Random position at mission start (unit init)

 

0 = player spawn { 
   waituntil {alive _this}; 
   private ["_overland","_landpos"]; _overland=false; 
   while {!_overland} do 
   { 
      _landpos = [random worldsize, random worldsize, 0]; 
      _overland = !(_landpos isFlatEmpty [-1, -1, -1, -1, 0, false] isEqualTo []); 
   }; 
   _landpos = _landpos findEmptyPosition [0,25,(typeof _this)]; 
   _this setPosATL [_landpos select 0, _landpos select 1, (getPosATL _this) select 2]; 
   _this setdir random 360; 
};

 

Parachute player into game (code goes into a game logic)

 

comment "minHeight, maxHeight, autoOpenAtMin, autoOpenAtMax, failureAutoChance"; 
0 = [500, 1000, 75, 100, 0.1] spawn { 
   cutText ["Parachuting in...","BLACK FADED",0];sleep 1; cutText ["","BLACK IN", 3]; 
   _autoOpenChuteATL = (_this select 2) + random ((_this select 3) - (_this select 2)); 
   if ((random 1) < (_this select 4)) then {_autoOpenChuteATL = (random (_this select 2))*(random 1)}; 
   waituntil {alive player}; 
   private _loadout = getUnitLoadout player; 
   removebackpack player; player addbackpack "B_Parachute"; 
   player setdir random 360; 
   player setposATL [position player select 0, position player select 1, (_this select 0) + random ((_this select 1) - (_this select 0))]; 
   waitUntil {getPosATL player select 2 < _autoOpenChuteATL}; 
   player action ["openParachute"]; 
   waituntil {isTouchingGround player}; 
   player setUnitLoadout [_loadout, true]; 
};

 

Spawn player as random soldier type (player units init)

 

comment "east west resistance civilian sideEnemy sideFriendly sideUnknown"; 
 
0 = [player, west, ""] spawn { 
   private _thisObject = _this select 0; 
   waituntil {alive _thisObject}; 
   private _filter = ""; 
   if ((count _this) == 2) then {_filter = tolower(_this select 2)}; 
   _sideID = [_this select 1] call BIS_fnc_sideID; 
   _output = []; 
   _units = ((format ["getNumber (_x >> 'scope') isequalto 2 AND getText( _x >> 'author' ) == 'Bohemia Interactive' AND getNumber (_x >> 'side') isequalto %1 AND configName _x iskindof 'CAManBase' AND (tolower(getText (_x >> 'displayName')) find _filter) >= 0",_sideID]) configclasses (configfile >> "CfgVehicles")); 
   if ((count _units) > 0) then 
   { 
      {_output pushback (configname _x)} forEach _units; 
      _randomSoldier = selectRandom _output; 
      _thisObject setUnitLoadout [getUnitLoadout _randomSoldier, true]; 
   }; 
};

 

 

Limit unit loadout at mission start (any units init)

 

0 = [player] spawn { 
   private _removeAllNav = 0.05; 
   private _removeAllWeapons = 0; 
 
   private _removeGPS = 0.7; 
   private _removeCompass = 0.5; 
   private _removeMap = 0.2; 
   private _removeWatch = 0.2; 
   private _removeRangefinder = 0.2; 
   private _removeNVG = 0.65; 
   private _removeBino = 0.1; 
 
   private _removePrimaryWeapon = 0.3; 
   private _removePrimaryWeaponAmmo = 0; 
   private _removeHandgunWeapon = 0; 
   private _removeHandgunWeaponAmmo = 0; 
   private _removeSecondaryWeapon = 0.95; 
   private _removeSecondaryWeaponAmmo = 0; 
 
   private _thisObject = _this select 0; 
 
   sleep 5; waitUntil {isTouchingGround _thisObject}; sleep 3; 
   private _rw = false; if (_removeAllWeapons > random 1) then {_rw = true}; 
   private _rn = false; if (_removeAllNav > random 1) then {_rn = true}; 
 
   if (alive _thisObject) then 
   { 
      if ((_removePrimaryWeapon > random 1) || _rw) then {_thisObject removeWeapon (primaryWeapon _thisObject)}; 
      if ((_removeHandgunWeapon > random 1) || _rw) then {_thisObject removeWeapon (handgunWeapon _thisObject)}; 
      if ((_removeSecondaryWeapon > random 1) || _rw) then {_thisObject removeWeapon (secondaryWeapon _thisObject)}; 
      if ((_removeCompass > random 1)  || _rn) then {_thisObject removeWeapon "itemCompass"}; 
      if ((_removeGPS > random 1) || _rn) then {_thisObject removeWeapon "itemGPS"}; 
      if ((_removeMap > random 1)  || _rn) then {_thisObject removeWeapon "itemMap"}; 
      if ((_removeWatch > random 1)  || _rn) then {_thisObject removeWeapon "itemWatch"}; 
      if ((_removeBino > random 1)  || _rn) then {_thisObject removeWeapon "Binocular"}; 
      if ((_removeRangefinder > random 1)  || _rn) then {_thisObject removeWeapon "Rangefinder"}; 
      if ((_removeNVG > random 1)  || _rn) then {_thisObject unassignItem "NVGoggles"; _thisObject removeItem "NVGoggles"}; 
 
   }; 
};

 

  • Like 1
  • Thanks 7

Share this post


Link to post
Share on other sites
2 hours ago, tortuosit said:

scripts here - which I use in Ravage

 

Thank you very much for sharing these tortuosit !

  • Like 1

Share this post


Link to post
Share on other sites

Anyone knowing if there were changes to the fatigue system at some point? I change fatigue as below because I don't like it in SP, but it does not work. Player unit gets slower as he runs.

player enableStamina false; player forceWalk false; player allowSprint true;

Share this post


Link to post
Share on other sites
1 hour ago, tortuosit said:

fatigue

 

You mean this?

player enableFatigue FALSE;
  • Like 1

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

×