NobodyCares69 Posted January 23, 2017 Share Posted January 23, 2017 I wrote my first mod for DST and it mostly works. Mostly, because I get crashes like "Tried to index a field (component name goes here) a nil value" doing random stuff, and I can't get the inst.components.workable to work either. These are all problems with my mod (I think, I only tested it on my old singleplayer server, because I don't care if I lose it, no clue if it works in multiplayer) I managed to make DST crash with out of memory error too, but I fixed that by myself. Can anyone help me to fix these bugs please, I attached the mod here: Better DST.zip Link to comment Share on other sites More sharing options...
MF99K Posted January 24, 2017 Share Posted January 24, 2017 when it gives you the crash message, what exactly does it say? aka, which code file, which line of code, etc? Link to comment Share on other sites More sharing options...
NobodyCares69 Posted January 24, 2017 Author Share Posted January 24, 2017 (edited) When it crashes it either says that there is a problem with lines 63-65 or lines 72-74. Seems like this thing: if inst.components.edible == nil then inst:AddComponent("edible") end isn't a good workaround . And when these lines don't exist.... it always crashes. And because these lines modify how cooked mushrooms work, when I cook mushrooms, it sometimes works and sometimes it crashes. And these lines do not work at all, they don't even crash: local function breakcave(inst) inst:AddComponent("workable") inst:AddComponent("lootdropper") inst.components.workable:SetWorkAction(GLOBAL.ACTIONS.MINE) inst.components.workable:SetWorkLeft(5) inst.components.workable:SetOnFinishCallback(onmined) local function onmined(inst) local fx = SpawnPrefab("collapse_big") fx.Transform:SetPosition(inst.Transform:GetWorldPosition()) fx:SetMaterial("metal") inst.components.lootdropper:DropLoot() inst:Remove() end end AddPrefabPostInit("batcave", breakcave) Edited January 24, 2017 by NobodyCares69 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now