Page MenuHomeFeedback Tracker

server wont start - error in scripts - Can't find variable 'DEFAULT'
Closed, ResolvedPublic

Description

on log is this error:

SCRIPT (E): @"scripts/4_World/classes\useractionscomponent\actiontargets.c,685": Can't find variable 'DEFAULT'
SCRIPT (E): Can't compile "World" script module!

scripts/4_World/classes\useractionscomponent\actiontargets.c(685): Can't find variable 'DEFAULT'
SCRIPT (E): Failed to load entities script!

Also look to https://steamcommunity.com/sharedfiles/filedetails/comments/1991570984

to comments at 3.March 2020

I think it some issue of modding.

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
General

Event Timeline

Hunterz created this task.Mar 14 2020, 7:45 PM

This is most likely an issue within the mod? Not sure why you are reporting it here.

Maybe someone accidentally deleted the UAMaxDistances. in front of default?

Hunterz added a comment.EditedMar 15 2020, 8:27 AM

Excactly same error are reported on others mods. I think it is some problem of modding interface.

3.march - user T2OJAN - https://steamcommunity.com/sharedfiles/filedetails/comments/1991570984
another mod: https://steamcommunity.com/workshop/filedetails/discussion/1566911166/1743358239842014775/?ctp=20#c175015018848828791
my own mod: https://steamcommunity.com/sharedfiles/filedetails/?id=1982919196&searchtext=

I dont know who touching this variable, maybe there are some limitation to modded actions when we have modded class ActionConstructor for example. I dont know, thats why I report this issue which leads to server crash.

In your own mod. Does this error appear when you load your mod without an other mods active?

I testing only together with CF, Zomberry and Treasure mod and this error not appear. Also my mod is on several server running without problems.

I think there are maybe some limit to modded actions. My modded class:

modded class ActionConstructor
{

override void RegisterActions(TTypenameArray actions)
{
    super.RegisterActions(actions);
    actions.Insert(ActionExaminePhotoTR);
    actions.Insert(ActionExamineTRMapPart);
    actions.Insert(ActionExamineTRCache);
}

}

worked in previous vesion (there was only one registered action)

Maybe in big modpacks with too many registered actions we meet some internal limit/bug.

That should not be the case and also that would not cause a compile-time error. I rather suspect a syntax issue in one of the mods. Identify which mod causes it then I can have a look on how to fix it there.

Look to other links which I added to this issue. I think problem is not syntax. Problem was reported on MuchStuffPack, MassManyItemOverhaul, Treasure. Interesting is reply of Helkhiana: there are propably too many mods referencing that UaMaxDistances.DEFAULT..... comments from 3.march on his mod MuchStuffPack.

AWG added subscribers: Psycho, AWG.EditedJul 5 2020, 9:51 PM

I had this exact same error when trying to load the following mods together. Adding the BaseBuildingPlus mod seemed to cause it, soon as I removed that mod, it went away. Others report this mod working with DayZ Expansion and other mods, but I can't seem to get it working with this mod combination. I know it's caused by some combo of mods, but figured I'd report here since it's the exact same error.

Mods: @CF;@Community-Online-Tools;@DayZ-Expansion;@DayZ-Expansion-Licensed;@BuilderItems;@GoreZ;@Bounty_fix;@zSpawnSelection;@BaseBuildingPlus;@Base Furniture Mods 3.0;@Code Lock;@MVS_Fix;@SQUAD MSF-C;@Munghardsitempack;@WeaponReduxPack;@Remastered Arma Weapon Pack;@Cl0uds Military Gear;@Cl0uds Military Gear Expansion;@FIDOv PACK 4;@MoreGuns;@MassManyItemOverhaul;@Advanced Weapon Scopes;@WindstridesClothingPack;@OP_BaseItems;@RaG_Hummer_Refresh;@IRP-Land-Rover-Defender-110;@PsychoDayZ Vehicle Expansion;@Psycho Gaming Vehicle Expansion 2;@FixCarPacks;@CannabisPlus;@Devils Dandruff;@ToxicZone;@No Glove Or Shoe Damage;@No-Vehicle-Damage;@BetterSuppressors;@BulletStacksPlusPlus;@BuildAnywhere_v3;@ItemCollisionNerf;@FlipTransport;@TimeDestruction;@Banking;@HeliPad;@Treasure;@dbo_surfaces;@CarsFix;@InventoryPlus;@InventoryPlusPlus;@Trader;@KillFeed

Can't compile "World" script module!

scripts/4_World/classes\useractionscomponent\actiontargets.c(685): Can't find variable 'DEFAULT'

killermantv added a subscriber: killermantv.EditedJul 12 2020, 4:47 PM

Removing OPBaseItems solved it for me

StrifeRaZoR added a subscriber: StrifeRaZoR.EditedJul 14 2020, 12:35 AM

I started receiving this same error when I added the @Advanced Weapon Scopes mod. I had configured my types and spawnabletypes and activated the mod. Upon loading the server, it throws up the "Can't compile "World" script module!

scripts/4_World/classes\useractionscomponent\actiontargets.c(685): Can't find variable 'DEFAULT'". I opened up the PBO and found the file/line referenced, and even took a look at the PBO of the newly added mod. Can't really find anything that would cause this, and even the mod author has said it isn't his mod causing it. Server starts without the mod, so I'm guessing it's some sort of conflict.

Edit: Decided to try what @killermantv suggested above and removed OP BaseItems. Guess what...it loads. Now to figure out where that conflict is.

komer added a subscriber: komer.Jul 14 2020, 8:47 AM

here is an easy way to solve this problem
this error is apparently due to the fact that you can not pass the value of const to const.
Add a fix to 4_World
modded class ActionTargets
{

private const float c_MaxActionDistance = 2;

}

AWG added a comment.Jul 14 2020, 6:20 PM

Thank you @komer , That seems like good info. I am still loading OP_BaseItems and other mods, and resolved the error another way. Recently this same error popped up again after a recent mod updated, and removing CodeLock fixed the issue. I did not want to remove CodeLock so I tested removing other mods, and strangely enough, removing the KillFeed mod actually resolved it, and I was able to keep OP_BaseItems and CodeLock, and BBP loaded.

As stated previously, must be some conflict between multiple mods.

@komer, is there a way to implement that fix without modifying the clientside mods?

komer added a comment.Jul 15 2020, 3:25 PM

on the server just add pbo with the fix to your server.

pbo, which is without a signature, will not be requested on the client.

@komer, Hi I see you have a solution to this issue. did you make a mod for it please. or could you explain how we can accomplish this. Does it need to be a config.cpp or.

I am pretty new to this but dont mind putting time into it with some help. This is a massive issue through-out dayz servers since 1.08.
Thanks for your time.

I find if you physically change the scripts PBO file on your servers:

default: >> private const float c_MaxActionDistance = UAMaxDistances.DEFAULT;

changed: >> private const float c_MaxActionDistance = 2;

The servers boot with any mod. but it then moves to a client error and people cannot connect receiving the same error as owners previously did when adding mods that conflicted prior to the change of code in the pbo.

komer added a comment.Jul 22 2020, 4:05 AM

what mistake? Are you sure you added the unsigned pbo to the server?

Im asking mate thats all, So I edited that line in the scripts file, and it works as you said, doesnt need re-signing by its dayz key, but then it throws error client side because, every client has the same file with the same setting.

default: >> private const float c_MaxActionDistance = UAMaxDistances.DEFAULT;

I am asking if we have to make a mod to make a clients game read the same file. and if so how.
I hope this makes sense Id really appreciate the help creating a fix.

AWG added a subscriber: Modular.EditedSep 9 2020, 8:25 PM

After 1.09 update, a new error similar to this one is breaking a lot of mods.

Can't compile "World" script module!
scripts/4_World/classes\useractionscomponent\targetconditionscomponents\cctobject.c(5): Can't find variable 'DEFAULT'

For example, I had to remove the following 10 mods from our server as each one of them caused the error:
2064965521 = "ChernarusRP AE86";
1932611410 = "CannabisPlus";
1912237302 = "IRP-Land-Rover-Defender-110";
1930123141 = "PsychoDayZ Vehicle Expansion";
1617874376 = "OP_BaseItems";
1982919196 = "Treasure";
1648967877 = "GoreZ";
2064159537 = "CarsFix";
1895432270 = "Dingo_Truck";
2203205088 = "Dmns_Vehicles";

Currently, the following mods are working on the server, but when I add in any one of the above mods, I get the same CCTObject.c error:
1559212036 = "CF";
1564026768 = "Community-Online-Tools";
2116151222 = "DayZ-Expansion";
2116157322 = "DayZ-Expansion-Licensed";
1565871491 = "BuilderItems";
2017605880 = "zSpawnSelection";
1710977250 = "BaseBuildingPlus";
2173711903 = "Expansion Code Locks Expanded";
1962144102 = "Modular Vest System";
1583941197 = "SQUAD MSF-C";
1734713776 = "Munghardsitempack";
1559317235 = "WeaponReduxPack";
1793351435 = "Remastered Arma Weapon Pack";
1630943713 = "Cl0uds Military Gear";
2000606064 = "Cl0uds Military Gear Expansion";
1605653648 = "FIDOv PACK 4";
1665663702 = "MoreGuns";
1566911166 = "MassManyItemOverhaul";
1705066179 = "CPBWeapons";
2143128974 = "Advanced Weapon Scopes";
1797720064 = "WindstridesClothingPack";
1879540249 = "RaG_Hummer_Refresh";
1982323784 = "Devils Dandruff";
1752669393 = "ToxicZone";
2132843684 = "MG_Colorful_Lights";
1868236039 = "No Glove Or Shoe Damage";
2135788892 = "No-Vehicle-Players-Damage";
1748044748 = "BetterSuppressors";
1711179264 = "BulletStacksPlusPlus";
1739822459 = "ItemCollisionNerf";
1836257061 = "Banking";
2123278383 = "HeliPad";
1688306459 = "dbo_surfaces";
2181951147 = "AWG Server Mod";
1572541337 = "InventoryPlus";
1663971788 = "InventoryPlusPlus";
1590841260 = "Trader";
1680673106 = "VPPNotifications";
2181531192 = "KillReward";

What is strange is, if I remove the ToxicZone mod, then add back in the IRP-Land-Rover-Defender-110 mod, it works. But if I try to add them both in with that mod selection, server crashes with the same error. So it does seem like it's not necessarily one single mod causing it, but a combination of too many mods trying to mod the same class or something like that (just a guess).

If anyone finds a solution for this, please let me know. I was able to fix the actiontargets.c error by using the method in this mod (same method @komer suggests above): https://steamcommunity.com/sharedfiles/filedetails/?id=2179379658
But I tried using a similar method to fix the cctobject.c error, but haven't had any luck.

I really hope BI can help us fix this, as it's affecting a lot of mods and modded servers currently. I know it's not their priority to support mods, but this is a very large portion of the community that is being affected by this.

Here is my current mod load order:
@CF;@Community-Online-Tools;@DayZ-Expansion;@DayZ-Expansion-Licensed;@BuilderItems;@zSpawnSelection;@BaseBuildingPlus;@Expansion Code Locks Expanded;@Modular Vest System;@SQUAD MSF-C;@Munghardsitempack;@WeaponReduxPack;@Remastered Arma Weapon Pack;@Cl0uds Military Gear;@Cl0uds Military Gear Expansion;@FIDOv PACK 4;@MoreGuns;@MassManyItemOverhaul;@CPBWeapons;@Advanced Weapon Scopes;@WindstridesClothingPack;@RaG_Hummer_Refresh;@Devils Dandruff;@ToxicZone;@MG_Colorful_Lights;@No Glove Or Shoe Damage;@No-Vehicle-Players-Damage;@BetterSuppressors;@BulletStacksPlusPlus;@ItemCollisionNerf;@Banking;@HeliPad;@dbo_surfaces;@AWG Server Mod;@InventoryPlus;@InventoryPlusPlus;@Trader;@VPPNotifications;@KillReward

Also running the following serverMods:
1576057168 = "BaseBuildingLogs";
2114540423 = "TBlogging";
1988925918 = "SurvivorMissions";

Rlyeh added a subscriber: Rlyeh.EditedSep 12 2020, 9:33 PM

I had the same Problem...
but meanwhile, I wrote a own Fix-Mod
which is fixing both "Can't find variable 'DEFAULT'"

https://steamcommunity.com/sharedfiles/filedetails/?id=2226713625

AWG added a comment.Sep 14 2020, 8:19 AM

@Rlyeh that link doesnt work for me, could you please share how you fixed the CCTObject.c DEFAULT error? Thank you for the response!

I had the same Problem...
but meanwhile, I wrote a own Fix-Mod
which is fixing both "Can't find variable 'DEFAULT'"

https://steamcommunity.com/sharedfiles/filedetails/?id=2226713625

Can we have a working link! Thanks

Rlyeh added a comment.Sep 16 2020, 1:57 AM

The Problem is following:

the changed CCTObject.c from

class CCTObject : CCTBase
{
	protected float m_MaximalActionDistanceSq;
	
	void CCTObject ( float maximal_target_distance )
	{		
		m_MaximalActionDistanceSq = maximal_target_distance * maximal_target_distance;
	}
	
	override bool Can( PlayerBase player, ActionTarget target )
	{	
		Object targetObject = target.GetObject();
		if ( !targetObject || !player )
			return false;
		
		vector playerHeadPos;
		MiscGameplayFunctions.GetHeadBonePos(player, playerHeadPos);
		
		float distanceRoot = vector.DistanceSq(targetObject.GetPosition(), player.GetPosition());
		float distanceHead = vector.DistanceSq(targetObject.GetPosition(), playerHeadPos);
		
		return ( distanceRoot <= m_MaximalActionDistanceSq || distanceHead <= m_MaximalActionDistanceSq );
	}
};

class CCTParent : CCTBase
{
	protected float m_MaximalActionDistanceSq;
	
	void CCTParent ( float maximal_target_distance )
	{		
		m_MaximalActionDistanceSq = maximal_target_distance * maximal_target_distance;
	}
	
	override bool Can( PlayerBase player, ActionTarget target )
	{	
		Object targetParent = target.GetParent();
		if ( !targetParent || !player )
			return false;
		
		vector playerHeadPos;
		MiscGameplayFunctions.GetHeadBonePos(player, playerHeadPos);
		
		float distanceRoot = vector.DistanceSq(targetParent.GetPosition(), player.GetPosition());
		float distanceHead = vector.DistanceSq(targetParent.GetPosition(), playerHeadPos);
		
		return ( distanceRoot <= m_MaximalActionDistanceSq || distanceHead <= m_MaximalActionDistanceSq );
	}
};

to 1.09:

class CCTObject : CCTBase
{
	protected float m_MaximalActionDistanceSq;
	
	void CCTObject ( float maximal_target_distance = UAMaxDistances.DEFAULT )
	{		
		m_MaximalActionDistanceSq = maximal_target_distance * maximal_target_distance;
	}
	
	override bool Can( PlayerBase player, ActionTarget target )
	{	
		Object targetObject = target.GetObject();
		if ( !targetObject || !player )
			return false;
		
		vector playerHeadPos;
		MiscGameplayFunctions.GetHeadBonePos(player, playerHeadPos);
		
		float distanceRoot = vector.DistanceSq(targetObject.GetPosition(), player.GetPosition());
		float distanceHead = vector.DistanceSq(targetObject.GetPosition(), playerHeadPos);
		
		return ( distanceRoot <= m_MaximalActionDistanceSq || distanceHead <= m_MaximalActionDistanceSq );
	}
};

class CCTParent : CCTBase
{
	protected float m_MaximalActionDistanceSq;
	
	void CCTParent ( float maximal_target_distance = UAMaxDistances.DEFAULT )
	{		
		m_MaximalActionDistanceSq = maximal_target_distance * maximal_target_distance;
	}
	
	override bool Can( PlayerBase player, ActionTarget target )
	{	
		Object targetParent = target.GetParent();
		if ( !targetParent || !player )
			return false;
		
		vector playerHeadPos;
		MiscGameplayFunctions.GetHeadBonePos(player, playerHeadPos);
		
		float distanceRoot = vector.DistanceSq(targetParent.GetPosition(), player.GetPosition());
		float distanceHead = vector.DistanceSq(targetParent.GetPosition(), playerHeadPos);
		
		return ( distanceRoot <= m_MaximalActionDistanceSq || distanceHead <= m_MaximalActionDistanceSq );
	}
};

we need to get the void CCTObject OVERRITTEN, because the add the "= UAMaxDistances.DEFAULT" after float maximal_target_distance
I haven't figured out, HOW to override the void...

void CCTObject ( float maximal_target_distance = UAMaxDistances.DEFAULT)

have to changed into

void CCTObject ( float maximal_target_distance = 3 )

or

void CCTObject ( float maximal_target_distance)
AWG added a comment.Sep 23 2020, 7:09 AM

Holy shit, nice job @Rlyeh ! :) it seems to work serverside for me too. Still testing but it started with no error after adding this mod, when it was giving the CCTObject.c error before.

AWG added a comment.Sep 23 2020, 11:48 AM

@Rlyeh your mod fixed the issue for me for a couple mods, but then when I tried to add back in others (like PsychoDayZ Vehicles), the same error started coming up again. Still, this is progress. Thanks for your help!

Rlyeh added a comment.Sep 26 2020, 4:23 PM

@AWG ... yeah I know... it's not a 100% fix of the CCTObject-Error... but it works for my Server for the most of our Mods we had before 1.09... just before I found the "fix", we droped down to 19 Mods... 2 Vehicle-Mods were left...
and now? We are BACK to about 90% of our Mods/Scripts

for PsychoDayZ:
did you tried the "PsychoDayZ Vehicle Expansion 1.09 FIXED"-Mod?
https://steamcommunity.com/sharedfiles/filedetails/?id=2231173248&searchtext=psychodayz

there are also some other Mods the fix doesn't work with... like DRUGSPLUS... some crafting-recepts...

there is also a bug that there is no error message, but the server doesn't start...
stop/freez at "Exporting inputs cfg "profiles\Users\Survivor\Server.core.xml"

I will still trying to fix the Problem 100%... but for now... it's working more or less :P

AWG added a comment.Sep 27 2020, 8:57 PM

@AWG ... yeah I know... it's not a 100% fix of the CCTObject-Error... but it works for my Server for the most of our Mods we had before 1.09... just before I found the "fix", we droped down to 19 Mods... 2 Vehicle-Mods were left...
and now? We are BACK to about 90% of our Mods/Scripts

for PsychoDayZ:
did you tried the "PsychoDayZ Vehicle Expansion 1.09 FIXED"-Mod?
https://steamcommunity.com/sharedfiles/filedetails/?id=2231173248&searchtext=psychodayz

there are also some other Mods the fix doesn't work with... like DRUGSPLUS... some crafting-recepts...

there is also a bug that there is no error message, but the server doesn't start...
stop/freez at "Exporting inputs cfg "profiles\Users\Survivor\Server.core.xml"

I will still trying to fix the Problem 100%... but for now... it's working more or less :P

Thanks for the help. I tried using that fixed version of PsychoDayZ Vehicle Expansion, same error, then I also tried loaded this "fix" mod https://steamcommunity.com/sharedfiles/filedetails/?id=2182824675, but I'm STILL getting the CCTObject error, and I've been trying to remove mods to see which one fixes it but haven't had any luck. I'm also not really willing to remove certain mods like MVS and Mass, FIDO, just because I'd pretty much have to wipe the server if I did that. So I guess I'm stuck with the mods I have until they fix this god damn issue, so frustrating.

Here's the current list of mods I have working fine:

@CF
@Community-Online-Tools
@DayZ-Expansion
@DayZ-Expansion-Licensed
@zSpawnSelection
@BaseBuildingPlus
@Expansion Code Locks Expanded
@Modular Vest System
@SQUAD MSF-C
@Munghardsitempack
@WeaponReduxPack
@Remastered Arma Weapon Pack
@Cl0uds Military Gear
@Cl0uds Military Gear Expansion
@FIDOv PACK 4
@MoreGuns
@MassManyItemOverhaul
@CPBWeapons
@Advanced Weapon Scopes
@RaG_Hummer_Refresh
@IRP-Land-Rover-Defender-110
@Dingo_Truck
@Devils Dandruff
@MG_Colorful_Lights
@No Glove Or Shoe Damage
@No-Vehicle-Players-Damage
@BetterSuppressors
@BulletStacksPlusPlus
@ItemCollisionNerf
@Banking
@HeliPad
@dbo_surfaces
@AWG Server Mod
@InventoryPlus
@InventoryPlusPlus
@Trader
@VPPNotifications
@KillReward

But when I try to add PsychoDayZ, I get the error, even with that "fixed" version, so I give up.

Anyways, thank you for the helpful info!

zysen added a subscriber: zysen.Thu, Oct 1, 11:19 AM

Hello All.
There appears to be a limit of 2140 defined classes in the modding interface.

Using the following script and nodejs i generate a c file with 2140 empty classes.
If i build a mod with this inside and run the server with no other mods i get the dreaded "scripts/4_World/classes\useractionscomponent\actiontargets.c(726): Can't find variable 'DEFAULT'"
If i remove a single class, it works just fine.

const MAX_CLASSES = 2140;
const fs = require('fs');
fs.writeFileSync("output.c", "");
for(let i=1;i<=MAX_CLASSES;i++){
	fs.appendFileSync("output.c", "class some"+i+"class {}\n");
}
Jest added a subscriber: Jest.Mon, Oct 5, 2:29 AM
AWG added a comment.EditedMon, Oct 5, 7:09 AM

Hello All.
There appears to be a limit of 2140 defined classes in the modding interface.

Using the following script and nodejs i generate a c file with 2140 empty classes.
If i build a mod with this inside and run the server with no other mods i get the dreaded "scripts/4_World/classes\useractionscomponent\actiontargets.c(726): Can't find variable 'DEFAULT'"
If i remove a single class, it works just fine.

const MAX_CLASSES = 2140;
const fs = require('fs');
fs.writeFileSync("output.c", "");
for(let i=1;i<=MAX_CLASSES;i++){
	fs.appendFileSync("output.c", "class some"+i+"class {}\n");
}

Very interesting, thank you for the info! I wonder, though, why some mods seem to cause this error yet some dont, and I assume they all use classes. I REALLY hope BI can fix this soon, it's driving the modding community nuts right now.

Lewk added a subscriber: Lewk.Mon, Oct 19, 12:28 PM

Hello All.
There appears to be a limit of 2140 defined classes in the modding interface.

Using the following script and nodejs i generate a c file with 2140 empty classes.
If i build a mod with this inside and run the server with no other mods i get the dreaded "scripts/4_World/classes\useractionscomponent\actiontargets.c(726): Can't find variable 'DEFAULT'"
If i remove a single class, it works just fine.

const MAX_CLASSES = 2140;
const fs = require('fs');
fs.writeFileSync("output.c", "");
for(let i=1;i<=MAX_CLASSES;i++){
	fs.appendFileSync("output.c", "class some"+i+"class {}\n");
}

Out of curiosity did you test if this included overrides?

Geez closed this task as Resolved.Wed, Oct 21, 12:27 PM
Geez claimed this task.
Geez added a subscriber: Geez.

Hello everyone.
The issue with Can't find variable 'DEFAULT' has been fixed internally and will be fixed on Steam in one of the upcoming updates.
Regards,
Geez