Page MenuHomeFeedback Tracker

Define ALL config objects in scripted class
Assigned, UrgentPublic

Description

Please define all class objects found in config.bin(cpp) in the scripted class as well.
EXAMPLE
CONFIG CLASS

class CfgVehicles
{
	class House;
	class Land_Wreck_Volha_Police: House { basic config stuff here };

it should also be in scripted class in 4_World>Entities somewhere

class Land_Wreck_Volha_Police {} // this can be emtpy

This forces ALL modders to use

modded class

moving forward.
currently if there are multiple mods with the same defines in scripted class. there is no TRUE conformity and server owners suffer from having to choose one mod over another when there is a conflict.
Expansion is one of many examples that conflict with multiple mods in such a way.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

Zedmag created this task.Oct 18 2020, 11:43 PM
Liven added a subscriber: Liven.Oct 19 2020, 1:20 AM

Be carefull, look at the end of this post : https://feedback.bistudio.com/T149789
Too many classes seems to lead to 'DEFAULT' error.

For Expansion mod the modder can use #ifdef EXPANSIONMOD to check if this mod is loaded (they just have to not forget to add "DayZExpansion/Scripts/Common", in the game/world/mission ScriptModules path lists in their root config.cpp)

This is definitely becoming a big issue :Z

This is indeed an issue since most modders are too lazy to think about cross-compatibility. I am not sure what the best solution would be.
Having all Cfg entries as script classes might not work out well in terms of startup time and performance. There are quit a lot of them.

Additionally right now there is a known issue that is provoked by having more script classes present. This ticket can only be dealt with, once that is sorted -> https://feedback.bistudio.com/T149789

Its not really an issue of modders being lazy.
we as creators need a base format we can all build off of.
having 20 diff mods, with the same class define would be ridiculous to have 20 diff #defines and #ifDefs just for one class object. you cant ask modders to do this.
i understand creating a scripted class would be alot, but its WAY less than the compile limit of 2158 or whatever its. it could just be all the standard already defined plus all the buildings. House and HouseNoDestruct. in one fail swoop, ALL modders with defined class objects would just need to switch to 'modded class' and its done.

Definitely an issue, maybe even bigger issue into the future. I agree.

I think not good idea change some already defined behavior. When I talked with Sumrak, they told me that BI want maintain backward compatibility.

Geez changed the task status from New to Assigned.Oct 21 2020, 10:27 AM

Doing this will save hassle with backwards compatibility in the future @Hunterz as the devs add more classes slowly

I would be more worried about this somehow affecting the 65k limit for classes, maybe that should be raised just in case? Last time it was raised was for 1.05 from 4k-> https://forums.dayz.com/topic/245888-experimental-update-105/

Zedmag added a comment.EditedNov 14 2020, 12:16 AM

Is there ANY progress on this issue.. mods are becoming more and more conflicting with each other for this VERY reason...

I would not expect something to happen quickly in this regard.

Zedmag added a comment.EditedNov 16 2020, 6:20 AM

Thats a bummer since SOO many modders are effected by this.. and its only getting worse as more mods are being released..
here... this will do most of it on the vanilla side..

	void z_CfgClassToScriptClass()
	{
		ref TStringArray cfg_Array = {"CfgDestroy" ,"CfgLanguages" ,"CfgVideoOptions" ,"CfgSurfaceCharacters" ,"CfgSounds" ,"CfgActionSounds" ,"CfgLocationTypes" ,"CfgHorticulture" ,"CfgSoundTables" ,"CfgEffectSets" ,"CfgNoMipmapTextures" ,"CfgOpticsEffect" ,"CfgCloudletShapes" ,"CfgCoreData" ,"CfgVehicleClasses" ,"cfgLiquidDefinitions" ,"cfgCharacterScenes" ,"cfgCharacterCreation" ,"CfgDifficulties" ,"CfgMaterials" ,"CfgHeads" ,"CfgFaces" ,"CfgAimHelperParameters" ,"CfgIdentities" ,"CfgFSMs" ,"CfgTasks" ,"CfgPatches" ,"CfgAIBehaviours" ,"CfgNoises" ,"CfgDamages" ,"CfgVehicles" ,"CfgNonAIVehicles" ,"CfgMods" ,"CfgSlots" ,"CfgWorlds" ,"CfgAmmo" ,"cfgWeapons" ,"cfgAmmoTypes" ,"CfgMagazines"};
		string z_ConfigClass_To_ScriptClass = "$profile:\\Zedmag_Cfg2Script\\PrimaryCfgClass.c";
		string z_ConfigClass_To_ScriptClass_Old = "$profile:\\Zedmag_Cfg2Script\\PrimaryCfgClass_OLD.c";
		string z_ConfigClass_To_ScriptClass_DIR = "$profile:\\Zedmag_Cfg2Script\\";
		
		if ( !FileExist(z_ConfigClass_To_ScriptClass_DIR))
		{
			MakeDirectory(z_ConfigClass_To_ScriptClass_DIR);
		}
		if ( !FileExist(z_ConfigClass_To_ScriptClass))
		{
			OpenFile(z_ConfigClass_To_ScriptClass, FileMode.WRITE);
		}
		else
		{
			CopyFile(z_ConfigClass_To_ScriptClass, z_ConfigClass_To_ScriptClass_Old);
		}
			FileHandle logFile = OpenFile(z_ConfigClass_To_ScriptClass, FileMode.WRITE); //WRITE, APPEND	
		
			array<string> class_names = new array<string>;
			string child_name = "";

			for (int z_Main = 0; z_Main < cfg_Array.Count(); z_Main++)
			{			
				string strConfigName = cfg_Array[z_Main];
				string message2 = string.Format("//--------------------<< %1 >>--------------------<<//", strConfigName );						
				FPrintln(logFile, message2);
			
				int count_1 = GetGame().ConfigGetChildrenCount ( strConfigName );
				for (int p = 0; p < count_1; p++)
				{
					GetGame().ConfigGetChildName ( strConfigName, p, child_name );
					class_names.Insert(child_name);
					class_names.Sort();
			
				}
				PrintString( "Array count: " + class_names.Count().ToString() );
				for ( int i = 0; i < class_names.Count(); i++ )
				{
			
					if ( class_names[i].Contains("All") || class_names[i].Contains("access") )
					{
						class_names.RemoveItem(class_names[i]);
					}
					else
					{
						string item = class_names[i];
						PrintString( "["+i.ToString()+"] => " + string.ToString(item) );
						string message = string.Format("class %1 {};", string.ToString(item) );				
						int replace = message.Replace("'", "");
						FPrintln(logFile, message);
					}
				}
				string message3 = string.Format("//--------<<~~~~~~~~~~~~~~~~~~~~~~~~~~>>--------<<//");				
				FPrintln(logFile, message3);
				class_names.Clear();
			}
			CloseFile(logFile);
	}
NATION added a subscriber: NATION.May 25 2021, 1:02 PM