Jump to content

Recommended Posts

4 hours ago, DanteMccloud said:

run it from the initServer.sqf

 

https://community.bistudio.com/wiki/Initialization_Order

 

If you want to set the code for specific depending  on side or classnames , you can just edit the script like :

 

above

&& (typeOf _x in GF_HandleDamage_List) 

or

/*
		//________________	You can filter the side here	________________	
		&& {((side group _x) == west || 
			(side group _x) == east || 
			(side group _x) == independent || 
			(side group _x) == civilian)}
		*/
		
		//	&& (side group _x == playerSide)
		//	&& (!(side group _x == playerSide))

if i understand correctly what you mean.

  • Like 1

Share this post


Link to post
Share on other sites

Damn... My squad buddy, some Czech dude I picked up in Cherno (AI) lasted 3 days with me... Sadly, we had a UAZ drive by with a mounted MG, and they lit up our cover position... May he rest in piece. If the Zombies weren't gonna get him it was bound to be those damn banditos... Poor bastard. We had a good run buddy... I'm gonna need that HK416 back though since ya won't be needing it anymore. :razz:

 

 

Who else had some good runs with AI? I was honestly shocked at how long he lasted... :shocked: :shoot:

  • Like 2
  • Haha 1

Share this post


Link to post
Share on other sites

got an ai to drive once. Straight into the ocean. Not sure why he did that. He didnt even try and get out of the car. I swam back to the shore and waited. He never came out. I put it down to he just couldnt handle living in a world full of zombies and decided to end it, would of been nice if he did it without me.

 

Other than that they seem to shoot through me to get to there target. So i dont group with Ai much anymore and i definitely dont let them drive me,

  • Haha 2

Share this post


Link to post
Share on other sites
On 9.1.2019 at 9:49 AM, Vandeanson said:

hi @tourist

 

i didnt really follow the forums recently and only notice now that you seem to be working in a persistency system that provides a solution also for my scripts. let me know if i can assist:)

 

also, what exactly are you up to? you referenced a next iteration of something by me but i am not sure if the post was cut off by accident, hence i am not sure what you mean:) just me being curious

 

cheers

vd

 

@Vandeanson  I had indeed a problem with posting to the forums from my mobile and got cut off.  What I wanted to type is that I wait for your solution to basebuilding to be incorporated into the next version of your spawning scripts.  Once that is out, I intend to try if I can save the units & objects generated by your scripts with either ALIVE or GRAD persistency systems "as they are" - I'm faaar out from being a scripter and try to use existing mods, scripts or code to make my mission ideas come true. 

 

If you, per chance, were to create an alternative persistency anyway for your basebuilding, that would be awesome!  I can - and gladly so -  help you with testing in SP and dedicated server environment, but not with code writing due to lack of expertise.  The only feather I can stick to my hat is a rather creative, "McGyver/Duct Tape" style of (ab-)using the ALIVE persistency for my missions to create tasks that are persistent over a server restart by checking for certain items in player or box or vehicle inventories.  ALIVE saves quite reliably the inventories of all players and all the vehicles & boxes accessed by them. So I can add items to those inventories upon quest completion which get checked by triggers at mission start - and then set task states as complete if I load the persistent save.  Also ALIVE allows to move around editor pre-placed fortification parts like sandbag walls, razorwire pieces and the like.  If I build some base with that stuff after moving it to another part of the map, it is persistent and also non-passable for AI.

 

Hope to hear from you & exchange thoughts

 

tourist 

  • Like 3

Share this post


Link to post
Share on other sites
On 08/01/2019 at 8:42 PM, MuRaZorWitchKING said:

So I don't know if anyone else is experiencing this but I'm playing one of my scenarios, and I found an old bus that is in good running condition, I've been going for a good solid 2 days now and I got to green mountain to take a break because it became nightfall, well, that night a trader ran up to my bus and was standing in front of it (gave me a startle at first almost shot him... :]) and it's the next morning and now him and his buddies are guaranteed following the bus when I'm driving, he's calling out the movements and everything to them and they're following, is this a bug? Or is it because I have mass amounts of loot in the bus? :icon3:

Ughhhhhh, yeah, I've been finding Ikaurs bus to be always in a good shape, a l w a y s. Also, I've added a T-90 parked in an enemy base. T90 has a modified, increased storage capacity so I'm carrying like 30 guns, 10 rpgs, millions of magazines and items... and traders follow my vehicle hypnotically with constant "waiting" & "ready" talk...

  • Haha 1

Share this post


Link to post
Share on other sites
On 11/01/2019 at 7:53 AM, MuRaZorWitchKING said:

Damn... My squad buddy, some Czech dude I picked up in Cherno (AI) lasted 3 days with me... Sadly, we had a UAZ drive by with a mounted MG, and they lit up our cover position... May he rest in piece. If the Zombies weren't gonna get him it was bound to be those damn banditos... Poor bastard. We had a good run buddy... I'm gonna need that HK416 back though since ya won't be needing it anymore. :razz:

 

 

Who else had some good runs with AI? I was honestly shocked at how long he lasted... :shocked: :shoot:

I once found Ikarus, just like you found one; in good shape. And I took a nice steady slow uphill road. This was on Cherno. I met with bandit group that was patroling and to my unfortunate luck, the first dude was carrying a rpg7, so it met face to face with my bus, so pretty much nothing has left of me... or my bus.

 

Second good run was on Namalsk, there were 5 of us, we got surrounded by 15 bandits or more and a bmp1, and we hid in a church near the main town of Namalsk. To make things worse, mi24 appeared but it was hostile to everyone, bandits and BMP sprayed it but it launched a couple of rockets before landing due to damage (dont know if they hit anyone). Then the bmp rushed at us but I had an rpg ready, hit & dismount but it cooked off killing its nearby dismounted crew, then the rest of the bandits approached us and it was pretty much throwing grenades across the wall and peeking around the corner. Lost one man, killed all the bandits, found a tool box and repaired the mi24, main rotor damage only.

 

Quite a Hollywood action story, but it was insane af!

  • Haha 1

Share this post


Link to post
Share on other sites
On 08/01/2019 at 8:42 PM, MuRaZorWitchKING said:

So I don't know if anyone else is experiencing this but I'm playing one of my scenarios, and I found an old bus that is in good running condition, I've been going for a good solid 2 days now and I got to green mountain to take a break because it became nightfall, well, that night a trader ran up to my bus and was standing in front of it (gave me a startle at first almost shot him... :]) and it's the next morning and now him and his buddies are guaranteed following the bus when I'm driving, he's calling out the movements and everything to them and they're following, is this a bug? Or is it because I have mass amounts of loot in the bus? :icon3:

 

Unintended behaviour - the AI isn't supposed to love you that much. ^^'

It'll be fixed for the next update.

  • Like 2
  • Haha 5

Share this post


Link to post
Share on other sites

It does has a Hit EH idk is using the Hit EH would work or if I should just create a sqf and have it called via the Init EH within the Zombie that could maybe work too. If I'm reading this code right the current is _damageRecieved divided by 10? so they should have a ton of health and to adjust we just alter the 10 to a number we want like 3 or 4 maybe.

 

On 1/6/2019 at 5:21 PM, GEORGE FLOROS GR said:

I don't remember if there is an eventhandler for damage , if there is just add the code from the EH , else :


GF_HandleDamage_List = [
	"B_RangeMaster_F"	// test		
];


GF_HandleDamage = {

_this addEventHandler ["HandleDamage", {
	params ["_unit", "_selection", "_damage","_source","","_index"];
		
	if ( _index > -1 ) then {
		private _selectionDamage = _unit getHit _selection;
		private _damageRecieved = (_damage - _selectionDamage) max 0;
		_damageRecieved = _damageRecieved / 10;	// test	change this	
		_damage = _damageRecieved + _selectionDamage;
	};	
_damage	
}];
};


[] spawn {
	while {true} do {	
		{	
		if (
			(!(_x getVariable ["Var_GF_HandleDamage",false])) 
			&& (typeOf _x in GF_HandleDamage_List)
														
			) then {		
			_x call GF_HandleDamage;
			};				
				
			{waitUntil ((damage _x == 1));
			_x setVariable ["Var_GF_HandleDamage",false]; 
			};			
			
		}forEach allunits;	
		sleep 3;	// test		
	};
};

 

 

Share this post


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

If I'm reading this code right the current is _damageRecieved divided by 10?

 

as you see in the code , i have also have added :

2 hours ago, DanteMccloud said:

_damageRecieved = _damageRecieved / 10; // test change this

 

by the way since there is a hit evenhandler , maybe ( i don't really know )  but probably you can then create a separate .sqf and add the HandleDamage EH when hit , did you test this ?

set also a variable so that the script don't run more than one time .

Basically there might be this as an option for zombie spawn ?

If not it would be a very nice addition , to have a damage factor in the spawn modules.

  • Like 1

Share this post


Link to post
Share on other sites

With @GEORGE FLOROS GR's Help I updated the weather effects script, and there are now 2 parts to the script, the second script is for Frigid waters if anyone is looking to add it into their maps. Enjoy! :)

 

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Hey guys first time posting here but been loving Ravage for a while now and decided to take on the endeavor of creating my own mission with the modules.

 

I have a few questions

 

First, how can I place ravage items like food or water in the world through the editor? I can't seem to find them in any lists in the editor. 

 

Second, I'm creating an AI that the player is to meet up with at a camp and lead but I would like for them to be a survivor but I can't seem to find a way to place survivors in the editor. And a spinoff question to that is, if I do make them a survivor, will they just immediately start running around as survivors normally do? 

 

Thanks in advance for any responses and the help and thank you most of all Haleks for the great mod. Hands down my most used. 

Share this post


Link to post
Share on other sites

@HerestotheGears I’m unsure as to if you can place down food/drink items into the world, but I do know you can easily add them into containers or players inventory’s/bags...

 

I recommend taking a look into the Ravage Wiki for further help :)

 

you can find it here:

 

http://ravage.wikia.com/wiki/Tools_for_Mission_Makers

 

Welcome to the forums, and I wish you luck woth your future projects!

:rthumb:

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the info! Unfortunately I've scanned the wiki pretty thoroughly and haven't been able to find an answer about my survivor question and situation. Any idea about that? 

  • Like 1

Share this post


Link to post
Share on other sites
57 minutes ago, MuRaZorWitchKING said:

 I’m unsure as to if you can place down food/drink items into the world

 

Hello there HerestotheGears !

 

I f you want to place manually ravage item or any other etc you can check here :

Spoiler
On 7/4/2018 at 8:55 PM, GEORGE FLOROS GR said:

 

gf-custom-loot-position-spawn-script-vergf-custom-loot-position-spawn-script-vergf-custom-loot-position-spawn-script-vergf-custom-loot-position-spawn-script-ver

gf-custom-loot-position-spawn-script-vergf-custom-loot-position-spawn-script-ver

gf-custom-loot-position-spawn-script-ver

or else you can also use a loot script.

  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, HerestotheGears said:

Second, I'm creating an AI that the player is to meet up with at a camp and lead but I would like for them to be a survivor but I can't seem to find a way to place survivors in the editor. And a spinoff question to that is, if I do make them a survivor, will they just immediately start running around as survivors normally do?

 

Firstly, are you talking about the Player leading this AI Unit? If so you can use this code in the AI's init and they'll become a recruit-able unit:  

 

Spoiler

this addaction ["Recruit Unit", "\ravage\actions\recruit.sqf","", 1, false, true, "", "alive _target && {group _target != group _this}"];  this addaction ["Dismiss Unit", "\ravage\actions\dismiss.sqf","", 1, false, true, "", "alive _target && {group _target == group _this}"];

 

And I recommend after setting up this AI You give them some sort of path, with either the //bis_fnc_taskPatrol// script or with just a simple movement path you create... Unless you want them standing still of course...

 

You can then attach a Trigger to the AI that you hand placed with the //attachTo// command and the trigger will follow them around on their walk path this way you can add some cool text dialog to the AI you wanna meet up with!

 

“Survivor” Units should be listed under each category of factions under infantry units, and no placing a “Survivor” unit on the map will not make them instantly start running around

 

I hope I answered your question! 

 

References: Ravage Tools for mission Makers for "Recruit Unit" script :)

  • Like 3

Share this post


Link to post
Share on other sites

Spawning Ravage items via the survival crates in Zeus is possible, but it will require a small patch...

...could be useful for a future update.

  • Like 1

Share this post


Link to post
Share on other sites

 

Hey, guys. I'm back to work on my Ravage scenario and I've got server hosting it running. Feel free to join in and explore anytime.

 

Plus, I've added couple new scripts to it.

One of them is simple Dust Sickness script, which might be useful on it's own.

It's doesn't damage health or anything, just makes character cough in a very annoying manner, if not protected from dust.
 

Spoiler



/*/////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                               //
//  B2 Dust Sickness Script                                                                      //
//  by Bl2ck Dog                                                                                 //
//                                                                                               //
// Player character will be spitting dust and coughing, if not protected from dust               //
// Sickness goes away by itself after some time in a mask or inside a protected vehicle          //
//                                                                                               //
// Add to initPlayerLocal.sqf:                                                                   //
// [] execVM "scripts\b2_dustSick.sqf";                                                          //
//                                                                                               //
/////////////////////////////////////////////////////////////////////////////////////////////////*/

private ["_v","_dustSickZero","_dustSickMod","_dustSickCrit","_dustSickMax","_dustChanceSpit","_dustChanceMod","_dustChanceCrit","_debug","_dustMasks","_dustVeh","_dustSickCurrent"];

_v = 1.04; //version

_dustSickZero   = 0;    //Starting Dust Sickness value, could be used for debug purposes (defaut - 0)
_dustSickMod    = 60;   //Seconds without mask before Moderate Sickness Stage (defaut - 60)
_dustSickCrit   = 120;  //Seconds without mask before Critical Sickness Stage (defaut - 120)
_dustSickMax    = 180;  //Seconds before Maximum Sickness Stage, when it's not going to be any worse (defaut - 180)
_dustChanceSpit = 20;   //%, chance of spitting dust in Healthy Stage every 10 seconds without mask (defaut - 20)
_dustChanceMod  = 40;   //%, chance of coughing in Moderate Sickness Stage every 10 seconds (defaut - 40)
_dustChanceCrit = 60;   //%, chance of coughing in Critical Sickness Stage every 10 seconds (defaut - 60)
_debug          = false;

//Array of dust protection masks
_dustMasks = [
  "G_Balaclava_TI_blk_F",
  "G_Balaclava_TI_G_blk_F",
  "G_Balaclava_TI_G_tna_F",
  "G_Balaclava_TI_tna_F",
  "G_Bandanna_aviator",
  "g_Bandanna_beast",
  "G_Bandanna_blk",
  "g_Bandanna_khk",
  "g_Bandanna_oli",
  "g_Bandanna_shades",
  "G_Bandanna_sport",
  "g_Bandanna_tan",
  "Mask_M40",
  "Mask_M40_OD",
  "Mask_M50",
  "PU_shemagh_GryBLK",
  "PU_shemagh_GryCLR",
  "PU_shemagh_GryO",
  "pu_shemagh_OD",
  "PU_shemagh_ODBLK",
  "PU_shemagh_ODCLR",
  "PU_shemagh_ODO",
  "pu_shemagh_Tan",
  "PU_shemagh_TanBLK",
  "PU_shemagh_TanCLR",
  "PU_shemagh_TanO",
  "PU_shemagh_White",
  "PU_shemagh_WhiteBLK",
  "PU_shemagh_WhiteCLR",
  "PU_shemagh_WhiteO",
  "rhs_scarf",
  "rhsusf_shemagh2_gogg_grn",
  "rhsusf_shemagh2_gogg_od",
  "rhsusf_shemagh2_gogg_tan",
  "rhsusf_shemagh2_gogg_white",
  "rhsusf_shemagh2_grn",
  "rhsusf_shemagh2_od",
  "rhsusf_shemagh2_tan",
  "rhsusf_shemagh2_white",
  "rvg_bandana_1",
  "rvg_bandana_2",
  "rvg_bandana_3",
  "rvg_bandana_4",
  "rvg_bandanaAvi_1",
  "rvg_bandanaAvi_2",
  "rvg_bandanaAvi_3",
  "rvg_bandanaAvi_4",
  "rvg_bandanaShades_1",
  "rvg_bandanaShades_2",
  "rvg_bandanaShades_3",
  "rvg_bandanaShades_4",
  "rvg_bandanaSport_1",
  "rvg_bandanaSport_2",
  "rvg_bandanaSport_3",
  "rvg_bandanaSport_4",
  "rvg_respirator_1",
  "rvg_respirator_2",
  "rvg_respirator_3",
  "rvg_respirator_4",
  "rvg_respirator_5",
  "TRYK_kio_balaclava_BLK",
  "TRYK_kio_balaclava_BLK_ear",
  "TRYK_kio_balaclava_ear",
  "TRYK_kio_balaclava_ESS",
  "TRYK_kio_balaclavas"
  //"rhs_balaclava",
  //"rhs_balaclava1_olive",
  //"rvg_balaclava_1",
  //"rvg_balaclava_2",
  //"rvg_balaclava_3",
  //"rvg_balaclava_4",
  //"rvg_balaclava_5",
  //"rvg_balaclavaCombat_1",
  //"rvg_balaclavaCombat_2",
  //"rvg_balaclavaCombat_3",
  //"rvg_balaclavaCombat_4",
  //"rvg_balaclavaCombat_5",
  //"rvg_balaclavaLow_1",
  //"rvg_balaclavaLow_2",
  //"rvg_balaclavaLow_3",
  //"rvg_balaclavaLow_4",
  //"rvg_balaclavaLow_5",
];

//Array of dust protected vehicle
_dustVeh = [
  "O_Truck_03_device_F",
  "rhs_gaz66_ap2_msv",
  "rhs_gaz66_repair_msv",
  "RHS_Ural_Repair_MSV_01"
];

while {true} do {
  enableCamShake true;
  player setVariable ["dustSick",_dustSickZero];
  waitUntil {alive player};
  while {alive player} do {
    UIsleep 10;
    _dustSickCurrent = player getVariable "dustSick";

    //Checking for dust protection
    if ((goggles player in _dustMasks) || (typeOf (vehicle player) in _dustVeh)) then {
      if (_debug) then {hint format ["B2 Dust Sickness Script %1\nYou're protected from dust\n%2/%3",_v,_dustSickCurrent,_dustSickMax];};
      if (_dustSickCurrent > 0) then {player setVariable ["dustSick",(_dustSickCurrent-10)];};
    } else {
      if (_debug) then {hint format ["B2 Dust Sickness Script %1\nYou're NOT protected from dust\n%2/%3",_v,_dustSickCurrent,_dustSickMax];};
      if (_dustSickCurrent < _dustSickMax) then {player setVariable ["dustSick",(_dustSickCurrent+10)];};
      if ((_dustSickCurrent < _dustSickMod) && (_dustChanceSpit > ceil random 100)) then {
        titleText ["<t color='#ffffff' size='1' align='center' valign='middle'>*Spitting dust*</t><br/>","PLAIN DOWN",0.5,true,true];
      };
    };

    //Moderate Sickness State
    if ((_dustSickCurrent >= _dustSickMod) && (_dustSickCurrent < _dustSickCrit) && (_dustChanceMod > ceil random 100)) then {
      titleText ["<t color='#ffffff' size='1' align='center' valign='middle'>*Coughing*</t><br/>","PLAIN DOWN",0.5,true,true];
      addCamShake [2+random 3,2+random 5,5+random 10];
    };

    //Critical Sickness State
    if ((_dustSickCurrent > _dustSickCrit) && (_dustChanceCrit > ceil random 100)) then {
      titleText ["<t color='#ff0000' size='1' align='center' valign='middle'>*Coughing blood*</t><br/>","PLAIN DOWN",0.5,true,true];
      player setFatigue 1;
      enableCamShake true;
      addCamShake [5+random 5,2+random 5,5+random 10];
      [1000] call BIS_fnc_bloodEffect;
    };
  };
};

systemchat "B2 Dust Sickness Script Initialized";


 

 

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites
On ‎1‎/‎13‎/‎2019 at 4:25 PM, HerestotheGears said:

Thanks for the info! Unfortunately I've scanned the wiki pretty thoroughly and haven't been able to find an answer about my survivor question and situation. Any idea about that? 

 

On ‎1‎/‎13‎/‎2019 at 1:24 PM, HerestotheGears said:

Hey guys first time posting here but been loving Ravage for a while now and decided to take on the endeavor of creating my own mission with the modules.

 

I have a few questions

 

First, how can I place ravage items like food or water in the world through the editor? I can't seem to find them in any lists in the editor. 

 

Second, I'm creating an AI that the player is to meet up with at a camp and lead but I would like for them to be a survivor but I can't seem to find a way to place survivors in the editor. And a spinoff question to that is, if I do make them a survivor, will they just immediately start running around as survivors normally do? 

 

Thanks in advance for any responses and the help and thank you most of all Haleks for the great mod. Hands down my most used. 

There is a small script on the Ravage Wikia that you can place inside the AI Init Field the script is under tools for mission makers The script will make the AI you placed a recruit/survivor that you can then approach and have join your team. Now if you would like to place some ravage loot inside a crate paste the script inside the spoiler to the crate init field the number one represents how many items will be placed.

Spoiler

this additemCargo ["rvg_antiRad", 1];

 

Share this post


Link to post
Share on other sites
On 12/1/2019 at 8:57 AM, haleks said:

It'll be fixed for the next update.

 

Hey Haleks, just in case you want to re check the ambient zombie spawning mechanic (script) I wanted to share with you a neat system I just recently found.

Since some players have been complaining of zombies not spawning close to them (or at all) when there are many players around maybe this can improve things on that subject.

 

You basically need 3 simple functions:

Spoiler

 


// Function runs periodically on server to spawn zombies randomly near group of players.
// First we group players who are close to eachother (300 mtrs) into a single array as a "group".
// So we later spawn zombies near random groups of players instead of single players. (Seems more efficient this way). 

SpawnRndNearPlayerGroups = {
Private _playersGroup = [];
Private _allPlayers = playableUnits;
  {
	_allPlayers = _allPlayers - [_x];
	_closestPlayer = [_allPlayers,_x,true,"1"] call closestObject;
	if (_closestPlayer distance2d _x > 300) then
		{
		_playersGroup pushback _x;
		};
  } forEach playableUnits;
  
// Lets select a random player:  
Private _rdmPlayer = selectRandom _playersGroup;
Private _rdmPlayerPos = getPos _rdmPlayer;

// Now lets create a Pos to spawn the zombie: Min distance away from random player = 75, max 175, random direction)
Private _orgPos = _rdmPlayer getRelPos [(75 + (random 100)), (random 360)];
Private _finalPos = [_orgPos, 1, 100, 0, 0, 1, 0,[],[_orgPos,_orgPos]] call BIS_fnc_findSafePos;

// Check if _finalPos is not too close to another player, if it is then run the function again.
private _closestPlayer = _finalPos call closestPlayer;
if (_finalPos distance2d _closestPlayer < 75) exitWith {[] call SpawnRndNearPlayerGroups;};

// Now we create a random zombie at that pos.
Private _zombie = createAgent [(selectRandom ["Running_Zombie_1","Walking_Zombie_1"]), _finalPos, [], 0, "NONE"];
};

 

That main function needs this two other functions:

Spoiler

 


closestObject = {
params ["_list","_object","_order","_script"];

if (isNil "_order") then {_order = true};
if (isNil "_script") then {_script = "Nil";};

private _position = [0,0,0];
if (isNil "_object" || {isNil "_list"}) exitWith {_closestObject = [0,0,0];_closestObject};

switch (TypeName _object) do 
{
    case "OBJECT": {_position = getPosATL _object;};
    case "STRING": {_position = getMarkerPos _object;}; 
    case "ARRAY": {_position = _object;}; 
    case "GROUP": {_position = (getPosATL (leader _object));}; 
};

private _distanceArray = [];
if (typeName _list isEqualTo "SCALAR") then {systemChat format ["_script: %1",_script];};
private _newObjectDistance = 0;
{
	if !(isNil "_x") then
	{
		_compareObjectPos = [0,0,0];
		switch (TypeName _x) do 
		{
				case "OBJECT": {_compareObjectPos = getPosATL _x;};
				case "STRING": {_compareObjectPos = getMarkerPos _x;}; 
				case "ARRAY": {_compareObjectPos = _x;}; 
				case "GROUP": {_compareObjectPos = (getPosATL (leader _x));}; 
		};
		_newObjectDistance = _compareObjectPos distance2D _position;
		_distanceArray pushback [_newObjectDistance,_x];
	};
} forEach _list;

_distanceArray sort _order;

private _closestObject = ((_distanceArray select 0) select 1);

if (isNil "_closestObject") then {_closestObject = [0,0,0];};
_closestObject
};

closestPlayer = {
Private _allPlayables = playableUnits;
private _closestPlayer = [_allPlayables,_this,true,"1"] call closestObject;
if (isNil "_closestPlayer") then {_closestPlayer = [0,0,0]};
_closestPlayer
};

 

PS

 

: I commented the 1st Function "SpawnRndNearPlayerGroups" because it is the most important one and the previous two are mostly self explanatory.

 

Anyways, I hope this helps you find the best possible solution in terms of zombie spawning for our dear Ravage.

 

PS2: Please note that some lines are completely examples and will need to be modified to work with Ravage, example this line: Private _zombie = createAgent [(selectRandom ["Running_Zombie_1","Walking_Zombie_1"]), _finalPos, [], 0, "NONE"];

 

  • Thanks 1

Share this post


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

Since some players have been complaining of zombies not spawning close to them (or at all) when there are many players around maybe this can improve things on that subject.

Yeah it could be great for dedicated server mission, cause if i set up a cap of 50 by player and 150 for the server if there a group of 3 player at the same place there is to much Zombies, or not enough if there more player in different place of the map.

 

But whats happen if a group of 5 player are not at the same place, only the leader will spawn Z ?

The player should be forced to ungroup if they are not close from eachother, or maybe allow different setting, for exemple "amount" for each player, "amount" for each group player, and global amount.

I don't know if its possible.

 

But i think the more simple thing to do its to add a spawner similar to Zombies and demon where the mission maker can define how much Z will spawn in an area

  • Like 1

Share this post


Link to post
Share on other sites
16 minutes ago, damsous said:

Yeah it could be great for dedicated server mission, cause if i set up a cap of 50 by player and 150 for the server if there a group of 3 player at the same place there is to much Zombies, or not enough if there more player in different place of the map.

 

But whats happen if a group of 5 player are not at the same place, only the leader will spawn Z ?

The player should be forced to ungroup if they are not close from eachother, or maybe allow different setting, for exemple "amount" for each player, "amount" for each group player, and global amount.

I don't know if its possible.

 

But i think the more simple thing to do its to add a spawner similar to Zombies and demon where the mission maker can define how much Z will spawn in an area

 

In the functions I suggested the script selects a random player inside an array of random groups of players to spawn zombies near them and not only the leader of a group.

 

This set of functions were made specifically for equitative distribution of ambient zombies, animals etc.

 

The functions are very simple right now but can be easily expanded to fit most of Ravage's needs.

 

I've used these 3 functions to spawn ambien animals and they works like a charm! Each group of players get randomly placed animals around them periodically and large group of players not necessarily get more ambien spawns than lone players.

  • Like 1

Share this post


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

In the functions I suggested the script selects a random player inside an array of random groups of players to spawn zombies near them and not only the leader of a group.

Thats really nice, ravage mod really need something like this.

  • Thanks 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

×