Jump to content

Checking for Hamlet compatibility with "IsDLCEnabled(PORKLAND_DLC)" causes the game to immediately crash.


Recommended Posts

EDIT: Ignore this. I managed to resolve the issue on my own.

I'm trying to make my mod work with Hamlet, but I'm having a bit of trouble. The problematic section of my mod file is this:

require "map/terrain"
	
if IsDLCEnabled(CAPY_DLC) then
	require "map/water"
	require "map/treasurehunt"
end

if IsDLCEnabled(PORKLAND_DLC) then
	require "map/city_builder"
	require "map/bunch_spawner"
	require "map/border_finder"
	require "map/bramble_spawner"
end

When I use IsDLCEnabled(PORKLAND_DLC) to check whether Hamlet is enabled or not, the game just quits. No errors, just an immediate crash to desktop. The log file shows this error:

[00:01:17]: scripts/frontend.lua(776,1) SCRIPT ERROR! Showing error screen	
[00:01:17]: Assert failure 'text_len < MAX_NUM_CHARS' at ..\source\game\render\BitmapFontRenderer.cpp(195): Trace follows...

I'm a bit stumped here. The mod works fine with Vanilla, RoG and SW, but as soon as I enable Hamlet it just won't work. For example, if I remove the IsDLCEnabled(PORKLAND_DLC) line, like this...

require "map/terrain"
	
if IsDLCEnabled(CAPY_DLC) then
	require "map/water"
	require "map/treasurehunt"
end

require "map/city_builder"
require "map/bunch_spawner"
require "map/border_finder"
require "map/bramble_spawner"

The mod works fine. The issue here is that now it won't work without Hamlet, because the various "require" files aren't present in other DLCs. 

Does anyone know what's going on here?

EDIT: It also only seems to affect RoG worlds that are compatible with Hamlet. Hamlet-compatible SW worlds, as well as Hamlet itself work fine.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...