kuplion

[RELEASE] ExileZ Mod by [FPS]kuplion - Based on ExileZ 2.0 by Patrix87

374 posts in this topic

4 hours ago, glam4x said:

Добрый день! :P Immediately sorry for my English)
When I started tweaking addon settings, I also ran into the same problem. The algorithm for choosing a class of zombies by weight did not work correctly and produced crawling zombies in huge numbers. It did not suit me and I decided to solve this problem...
The reason for the problem is that the algorithm for recalculating weights for zombie spawn does not suggest that you will use one zClass in several types of triggers. And you did it, right? And I, too, and it's logical to use the already set up class in towns and villages. 9_9

For each type of trigger there is a recalculation of the weights for zombie spawn and if there are one zClass in several triggers, then it is recalculated several times, creating incorrect weights (this is simple). I corrected the algorithm slightly by prohibiting it from processing already recalculated zClasses. 

Now everything works well and you can use one zClass in all triggers.

Replace this piece of code in the file fn_postInit.sqf :


//Create Triggers
_zgroupsArray = [];
if (EZM_UseTriggers) then
{
	{
		_useThisTrigger = _x select 0;
		_triggerPositions = _x select 1;
		if (_useThisTrigger) then
		{
			
			//Weight Zombie Group
			_currentTrigger = _x;
			_zgroup = _currentTrigger select 13;
			if (EZM_Debug) then
			{
				diag_log format["ExileZ Mod: Compounding Zombie Group Weight, Selected Group Trigger Index : %1",_forEachIndex];
			};
			
			if !(_zgroup in _zgroupsArray) then
			{
				_count = 0;
				{
					_count = _count + (_x select 1);
					if (EZM_Debug) then
					{
						diag_log format["ExileZ Mod: Zombie Type Index : %1		Weight : %2		Compound Weight Value : 	%3",_forEachIndex,_x select 1,_count];
					};
					(_zgroup select _forEachIndex) set [1,_count];
				}
				foreach (_zgroup);
				
				_zgroupsArray append [_zgroup];
			}
			else
			{
				if (EZM_Debug) then
				{
					diag_log "ExileZ Mod: Compounding Weight For This Zombie Group Already Done!";
				};
			};

			//Create triggers
			{
				nul = [_x,_CurrentTrigger] spawn EZM_CreateTriggers;
				sleep 0.01;
			}foreach (_triggerPositions);
		};
	}foreach EZM_Triggers;
};

Or replace all:

  Reveal hidden contents

This is not the most correct solution, it would be more elegant to place all zClasses in a common array and recalculate separately from the triggers. But this is init code and it works once, so it's not so important.

Good luck :rock:

Thank you for this, it's been on my fix list for a while. Would you be ok if I add it to the main repo?

Share this post


Link to post
Share on other sites

Sorry if I'm misunderstanding, but you say replace the code in "fn_postInit.sqf" and then you say  " Or replace all: "

Which would be better and where would the code after " Or replace all: " go?

Share this post


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

Thank you for this, it's been on my fix list for a while. Would you be ok if I add it to the main repo?

Yes of course) I was pleased to help, I love when people help each other 9_9
I still have some small changes, but they are still raw and maybe not much needed by people. Surprised that RZ zombies do not have inventory and can not wear clothes ... :|

25 minutes ago, gfourth said:

Sorry if I'm misunderstanding, but you say replace the code in "fn_postInit.sqf" and then you say  " Or replace all: "

Which would be better and where would the code after " Or replace all: " go?

You can replace only the changed piece of code that I posted, or open the spoiler below and copy everything from it and replace everything in the file fn_postInit.sqf. Maybe I'm not speaking correctly in English, my native language is Russian ...
Just download and replace the file)

http://rgho.st/8PFVXY5GN

1 person likes this

Share this post


Link to post
Share on other sites

@glam4x Your english is great!  It was me not correctly understanding what you meant :)

Thanks again!

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now