Page 1 of 1
First time doing any modding. Bad file Descriptor
Posted: Tue Nov 04, 2014 7:10 pm
by XenoZiden
I'm working on a mod that adds some things from Necromancy+ to the Eternal Darkness mod.
when I try to load I get this error.
Code: Select all
Lua Error: /engine/DamageType.lua:36: cannot open /data-eternalnecromancy/damage_types.lua: Bad file descriptor
At [C]:-1
At [C]:-1 error
At /engine/DamageType.lua:36 loadDefinition
At /hooks/eternaldnecromancy/load.lua:10
At [string "return function(l, self, data) local ok=false..."]:1
At /mod/load.lua:300
At [C]:-1 require
At /engine/Module.lua:158 load
At /engine/Module.lua:921 instanciate
At /engine/utils.lua:2235 showMainMenu
At /engine/init.lua:156
At [C]:-1 dofile
At /loader/init.lua:196
Line 10 of my load.lua
Code: Select all
DamageType:loadDefinition("/data-eternalnecromancy/damage_types.lua")
Don't really know what the issue is.
Using notepad++ to edit things in case I'm doing something stupid with that and using Winzip to Pack the files.
Re: First time doing any modding. Bad file Descriptor
Posted: Wed Nov 05, 2014 2:14 pm
by Doctornull
Don't pack the files. Just make a directory structure. The game now packs and checksums and uploads for you.
Also post your directory structure, it sounds like you've got a file in the wrong place.
Re: First time doing any modding. Bad file Descriptor
Posted: Wed Nov 05, 2014 5:52 pm
by XenoZiden
Ok so I moved the file stuff to the addon folder. That did not fix it me problem so on with the other thing that was asked of me.
Since I had no idea how to post my directory structure
here's a Google Drive of the Addon.
Re: First time doing any modding. Bad file Descriptor
Posted: Wed Nov 05, 2014 6:11 pm
by Doctornull
In your init.lua, you misspell your addon's name.
short_name = "eternaldnecromancy"
Re: First time doing any modding. Bad file Descriptor
Posted: Wed Nov 05, 2014 6:18 pm
by XenoZiden

derpderpderpderpderp:oops:
Man do I feel stupid. Thanks for that.
Code: Select all
Lua Error: /loader/init.lua:151: Error while superloading '/mod/addons/eternalnecromancy/superload/mod/class/Actor.lua':
/mod/addons/eternalnecromancy/superload/mod/class/Actor.lua:893: 'end' expected (to close 'function' at line 185) near 'local'
At [C]:-1
At [C]:-1 error
At /loader/init.lua:151
At [C]:-1 require
At /mod/class/Game.lua:44
At [C]:-1 require
At /mod/load.lua:322
At [C]:-1 require
At /engine/Module.lua:158 load
At /engine/Module.lua:921 instanciate
At /engine/utils.lua:2235 showMainMenu
At /engine/init.lua:156
At [C]:-1 dofile
At /loader/init.lua:196
SDL_WINDOWEVENT_MOVED: ignored due to fullscreen
SDL_WINDOWEVENT_RESIZED: ignored due to fullscreen
Lua Error: attempt to call a nil value
At [C]:-1
A new error so that's progress.
EDIT: Removed "Return Value" and the Function for the Meat Shield entry and got it to the character creation screen.
So That's awesome. Now to just make sure everything is in working order.
Thanks for the help because I never would have checked the init file for a typo.
EDIT2: Testing in game. Enemies who even attempt to deal damage cause a cascading wall of errors
Code: Select all
[PROJECTOR] starting dam 16.294456863998
[PROJECTOR] after difficulty dam 16.294456863998
[PROJECTOR] res 2 0.98 on dam 16.294456863998
[PROJECTOR] after resists dam 15.968567726718
[PROJECTOR] after flat damage armor 15.968567726718
[PROJECTOR] final dam after static checks 15.968567726718
[PROJECTOR] final dam after hooks and callbacks 15.968567726718
Lua Error: /mod/class/interface/ActorLife.lua:41: attempt to compare nil with number
At [C]:-1 __le
At /mod/class/interface/ActorLife.lua:41 takeHit
At /mod/class/Actor.lua:2720 takeHit
At /data/damage_types.lua:436 defaultProjector
At /data/damage_types.lua:675 projector
At /data/damage_types.lua:1111 projector
At /engine/interface/ActorProject.lua:376 projectDoAct
At /engine/interface/ActorProject.lua:463 projectDoStop
At /engine/Projectile.lua:228 act
At /engine/GameEnergyBased.lua:126 tickLevel
At /engine/GameEnergyBased.lua:62 tick
At /engine/GameTurnBased.lua:46 tick
At /mod/class/Game.lua:1181
I don't even know where to begin on this.
Re: First time doing any modding. Bad file Descriptor
Posted: Wed Nov 05, 2014 7:31 pm
by Doctornull
XenoZiden wrote:
I don't even know where to begin on this.
Glad I could help with the previous one. Dunno what's going on this time, so you're on your own.
Look through those files in the stack trace, at those lines in specific. See if you can figure out what you changed that broke attacks.
Welcome to the glamorous world of coding.

Re: First time doing any modding. Bad file Descriptor
Posted: Wed Nov 05, 2014 8:15 pm
by XenoZiden
The only file that exist in the addon is the class/actor.lua which doesn't have a line 2720.
Only addition to this file from the working eternal Darkness file was the Addition of
Code: Select all
--MEATSHIELD
if dead and src then
if src:getEntityKind() == "actor" then
local summoner = src.summoner
if src:isTalentActive(src.T_HP_MEAT_SHIELD) then
local t = src:getTalentFromId(src.T_HP_MEAT_SHIELD)
src:setEffect(src.EFF_HP_MEAT_SHIELDED, t.getDur(src, t), {power=10})
elseif summoner then
if summoner:isTalentActive(summoner.T_HP_MEAT_SHIELD) then
local t = summoner:getTalentFromId(summoner.T_HP_MEAT_SHIELD)
summoner:setEffect(summoner.EFF_HP_MEAT_SHIELDED, t.getDur(summoner, t), {power=10})
end
end
end
end
At the end of the "function _M:onTakeHit(value, src, death_note)"
Also I found another errors that appears first that I missed.
Code: Select all
[PROJECTOR] starting dam 4
[PROJECTOR] after difficulty dam 4
[PROJECTOR] res 0 1 on dam 4
[PROJECTOR] after resists dam 4
[PROJECTOR] after flat damage armor 4
[PROJECTOR] final dam after static checks 4
[PROJECTOR] final dam after hooks and callbacks 4
stack traceback:
[C]: in function 'error'
/engine/interface/ActorTalents.lua:153: in function </engine/interface/ActorTalents.lua:135>
Lua Error: /engine/interface/ActorTalents.lua:175: /engine/interface/ActorTalents.lua:153: /mod/class/interface/ActorLife.lua:41: attempt to compare nil with number
stack traceback:
/mod/class/interface/ActorLife.lua:41: in function 'takeHit'
/mod/class/Actor.lua:2720: in function 'takeHit'
/data/damage_types.lua:436: in function 'projector'
/mod/class/interface/Combat.lua:528: in function 'attackTargetWith'
/mod/class/interface/Combat.lua:202: in function 'attackTarget'
/data/talents/misc/misc.lua:71: in function </data/talents/misc/misc.lua:51>
[C]: in function 'xpcall'
/engine/interface/ActorTalents.lua:148: in function </engine/interface/ActorTalents.lua:135>
At [C]:-1
At [C]:-1 error
At /engine/interface/ActorTalents.lua:175 bumpInto
At /mod/class/Actor.lua:3370 attack
At /engine/interface/ActorLife.lua:41 check
At [string "return function(self, x, y, what, ...) local ..."]:1 checkAllEntities
At /engine/interface/ActorAI.lua:63 aiCanPass
At /engine/interface/ActorAI.lua:85 runAI
At /engine/ai//simple.lua:205 runAI
At /engine/ai//talented.lua:64 doAI
At /mod/class/NPC.lua:61 act
At /engine/GameEnergyBased.lua:126 tickLevel
At /engine/GameEnergyBased.lua:62 tick
At /engine/GameTurnBased.lua:46 tick
At /mod/class/Game.lua:1181
I think that it points towards an issue with "data/spells/spells.lua"
But if it is an issue there I don't know where the problem is coming from.
Re: First time doing any modding. Bad file Descriptor
Posted: Wed Nov 05, 2014 10:53 pm
by XenoZiden
I solved the problem just just removing the charnel Talents.
I know it was caused by Meat Shield but not why it was causing the issue.
In any case I believe I have dealt with the issue and have a working product.