Page 1 of 1

Possible bug with monster_level_info?

Posted: Wed Jan 26, 2022 12:56 am
by Gambit37
The converted CSB dungeon uses a table called monster_level_info to specify the levels where each creature type can exist. I tried using the same feature in the (now heavily modified) converted DM dungeon with this table:

Code: Select all

monster_level_info = {
	[0] = { "" },
	[1] = { "mummy", "screamer" },
	[2] = { "mummy", "screamer", "rockpile", "trolin" },
	[3] = { "mummy", "screamer", "rockpile", "worm", "ghost", "wasp" },
	[4] = { "screamer", "swampslime", "couatl", "mummy" },
	[5] = { "skeleton", "wizardeye" },
	[6] = { "golem" },
	[7] = { "giggler", "ghost", "mummy", "skeleton" },
	[8] = { "giggler", "rat", "ruster", "vexirk" },
	[9] = { "giggler", "scorpion", "wizardeye", "skeleton" },
	[10] = { "trolin", "wasp", "giggler", "waterelem"},
	[11] = { "knight_armour", "oitu", "materializer" },
	[12] = { "blackflame", "demon", "lordchaos", "knight_armour" },
	[13] = { "dragon" }
}
However, DSB crashes during startup with this error:

Code: Select all

OBJ: 453 total archs
DUNGEON: Attempting to load
Parsing ..\2_build/dungeon.lua
PROGRAM CRASH!
Location: -5 0 0
Reason: Segmentation Fault
Stack Dump:
DSBmain
load_dungeon
src_lua_file(..\2_build/dungeon.lua)
src_lua_file.pcall
lua.dsb_spawn(dragon)
create_instance

Re: Possible bug with monster_level_info?

Posted: Wed Jan 26, 2022 1:30 am
by Sophia
The C code doesn't know about the monster_level_info table; it just calls sys_monster_enter_level and the rest is handled with Lua code. So from that stack trace I don't really see a connection to monster_level_info but clearly something isn't working right. At this point I don't know if it's something you did wrong or a bug in DSB, so I'll probably have to look at the dungeon files themselves. (Though if you did do something wrong I should probably fix it to give a more elegant error message than just blowing up!)

Re: Possible bug with monster_level_info?

Posted: Wed Jan 26, 2022 1:38 am
by Gambit37
OK thanks, I'll come back to this one after I've cleaned up my project -- it's rather complex, messy and weird right now and not easy to share...