Jump to content

Long Pig tweak crashing, subscribed from Steam?


Recommended Posts

Hi! I have a Long Pig mod tweak that's kind of a personal mod, and I posted it as a hidden private mod on the Steam workshop so I could host servers with it. Yet when I pull up my mod lists while trying to host a server it shows that it's crashed and disabled. Here's the code and stuff.

From modmain:

--[[
 /-----------------------------------\
|           Version History           |
 \-----------------------------------/

1.2 - Released
]]

local require = GLOBAL.require
local cooking = require("cooking")
local Action = GLOBAL.Action
local ActionHandler = GLOBAL.ActionHandler 
local STRINGS = GLOBAL.STRINGS
local State = GLOBAL.State
local EventHandler = GLOBAL.EventHandler

GLOBAL.HUMAN_MEAT_ENABLED = true

STRINGS.CHARACTERS.WILSON.DESCRIBE.HUMANMEAT = "Flesh is flesh. Where do I draw the line?"
STRINGS.CHARACTERS.WILSON.DESCRIBE.HUMANMEAT_COOKED = "Cooked nice and pink, but still morally gray."
STRINGS.CHARACTERS.WILSON.DESCRIBE.HUMANMEAT_DRIED = "Letting it dry makes it not come from a human, right?"

STRINGS.CHARACTERS.WAXWELL.DESCRIBE.HUMANMEAT = "Now there's nothing for it but to rot. Or is there?"
STRINGS.CHARACTERS.WAXWELL.DESCRIBE.HUMANMEAT_COOKED = "Sautéed to take the civilized route."
STRINGS.CHARACTERS.WAXWELL.DESCRIBE.HUMANMEAT_DRIED = "Now bereft of moisture but not of moral ambiguity."

STRINGS.CHARACTERS.WILLOW.DESCRIBE.HUMANMEAT = "You could still cremate it!"
STRINGS.CHARACTERS.WILLOW.DESCRIBE.HUMANMEAT_COOKED = "Dead flesh improved by fire."
STRINGS.CHARACTERS.WILLOW.DESCRIBE.HUMANMEAT_DRIED = "I think it could still burn."

STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.HUMANMEAT = "Autolysis will soon give way to putrefaction."
STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.HUMANMEAT_COOKED = "Metmyoglobin gives it its unique color."
STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.HUMANMEAT_DRIED = "Human flesh dried by osmosis."

STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.HUMANMEAT = "Better them than Wolfgang."
STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.HUMANMEAT_COOKED = "Babcia's secret recipe!"
STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.HUMANMEAT_DRIED = "Is like shoe, but better for belly!"

STRINGS.CHARACTERS.WOODIE.DESCRIBE.HUMANMEAT = "Should probably put it away somewhere nice and respectful."
STRINGS.CHARACTERS.WOODIE.DESCRIBE.HUMANMEAT_COOKED = "That's not exactly what we had in mind."
STRINGS.CHARACTERS.WOODIE.DESCRIBE.HUMANMEAT_DRIED = "Desperate times, eh?"

STRINGS.CHARACTERS.WEBBER.DESCRIBE.HUMANMEAT = "Would eating this kind of make us like a turducken?"
STRINGS.CHARACTERS.WEBBER.DESCRIBE.HUMANMEAT_COOKED = "We're sure this is cooked human meat."
STRINGS.CHARACTERS.WEBBER.DESCRIBE.HUMANMEAT_DRIED = "Dried human meat."

STRINGS.CHARACTERS.WX78.DESCRIBE.HUMANMEAT = "A FURTHER IMPROVEMENT OF THE HUMAN CONDITION."
STRINGS.CHARACTERS.WX78.DESCRIBE.HUMANMEAT_COOKED = "FINALLY, A PURPOSE FOR THE FLESHY PESTILENCE."
STRINGS.CHARACTERS.WX78.DESCRIBE.HUMANMEAT_DRIED = "NICE AND DRY."

STRINGS.CHARACTERS.WENDY.DESCRIBE.HUMANMEAT = "Once a mortal coil, now discarded."
STRINGS.CHARACTERS.WENDY.DESCRIBE.HUMANMEAT_COOKED = "Would the soul even question your purpose?"
STRINGS.CHARACTERS.WENDY.DESCRIBE.HUMANMEAT_DRIED = "Long removed from the vessel it once was."

STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.HUMANMEAT = "Honor yöur fallen combatants!"
STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.HUMANMEAT_COOKED = "They perished blazing, and cööked the same."
STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.HUMANMEAT_DRIED = "Hard and unyielding, even in death!"



AddIngredientValues({"humanmeat"}, {meat=1, monster=1}, true, true)

local function humanmeat()
    local inst = common("meat_human", "meat_human", "raw", "idle", { "humanmeat" }, { product = "humanmeat_dried", time = TUNING.DRY_FAST }, { product = "humanmeat_cooked" })

    if not TheWorld.ismastersim then
        return inst
    end

    inst.components.edible.ismeat = true    
    inst.components.edible.foodtype = FOODTYPE.MEAT
    inst.components.edible.healthvalue = -TUNING.HEALING_MED
    inst.components.edible.hungervalue = TUNING.CALORIES_SMALL
    inst.components.edible.sanityvalue = -TUNING.SANITY_LARGE
    inst.components.perishable:SetPerishTime(TUNING.PERISH_FAST)

    inst.components.tradable.goldvalue = 0

    inst:AddComponent("selfstacker")

    return inst
end

local function humanmeat_cooked()
    local inst = common("meat_human", "meat_human", "cooked", { "humanmeat" })

    if not TheWorld.ismastersim then
        return inst
    end

    inst.components.tradable.goldvalue = 0

    inst.components.edible.healthvalue = -TUNING.HEALING_SMALL
    inst.components.edible.hungervalue = TUNING.CALORIES_MEDSMALL
    inst.components.edible.sanityvalue = -TUNING.SANITY_LARGE

    inst.components.perishable:SetPerishTime(TUNING.PERISH_SLOW)

    return inst
end

local function humanmeat_dried()
    local inst = common("meat_rack_food", "meat_rack_food", "idle_dried_human", { "humanmeat" })

    if not TheWorld.ismastersim then
        return inst
    end

    inst.components.edible.healthvalue = -TUNING.HEALING_SMALL
    inst.components.edible.hungervalue = TUNING.CALORIES_SMALL
    inst.components.edible.sanityvalue = -TUNING.SANITY_MED

    inst.components.perishable:SetPerishTime(TUNING.PERISH_PRESERVED)

    return inst
end

And modinfo:

--The name of the mod displayed in the 'mods' screen.
name = "Long Pig Reworked"

--A description of the mod.
description = "Enables Long Pig to drop from player."

--Who wrote this awesome mod?
author = "Zampano"

--A version number so you can ask people if they are running an old version of your mod.
version = "1.3"

--This lets other players know if your mod is out of date. This typically needs to be updated every time there's a new game update.
api_version = 10

--Compatible with both the base game and Reign of Giants
dont_starve_compatible = true
reign_of_giants_compatible = true
dst_compatible = true

--This lets clients know if they need to get the mod from the Steam Workshop to join the game
all_clients_require_mod = true
clients_only_mod = false

--This lets people search for servers with this mod by these tags
server_filter_tags = {}

icon_atlas = "modicon.xml"
icon = "modicon.tex"

forumthread = "http://forums.kleientertainment.com/files/file/923-dst-status-announcements"

I'd appreciate any help, thanks in advance y'all.

Link to comment
Share on other sites

Wilson uses STRING.CHARACTER.GENERIC.DESCRIBE. He already has those lines, though.

It looks to me like you copied the humanmeat, humanmeat_cooked and humanmeat_dried functions from meats.lua, but they aren't being called, so they're doing nothing. If they were called, the common function is missing, so it'd crash. There's also an extra "idle" and a comma in humanmeat's call to common, which would also cause issues. No need for umlauts in Wigfrid's speech, the game handles it (yöur and cööked).

Unless you are adding more stuff, you could remove all of the GLOBAL's and require's and simplify all of the code after adding the descriptions to

AddIngredientValues({"humanmeat"}, {meat=1, monster=1}, true, true)

local function addhumanmeattag(inst) inst:AddTag("humanmeat") end

AddPrefabPostInit("humanmeat", addhumanmeattag)
AddPrefabPostInit("humanmeat_cooked", addhumanmeattag)
AddPrefabPostInit("humanmeat_dried", addhumanmeattag)

 

Link to comment
Share on other sites

1 hour ago, alainmcd said:

Wilson uses STRING.CHARACTER.GENERIC.DESCRIBE. He already has those lines, though.

It looks to me like you copied the humanmeat, humanmeat_cooked and humanmeat_dried functions from meats.lua, but they aren't being called, so they're doing nothing. If they were called, the common function is missing, so it'd crash. There's also an extra "idle" and a comma in humanmeat's call to common, which would also cause issues. No need for umlauts in Wigfrid's speech, the game handles it (yöur and cööked).

Unless you are adding more stuff, you could remove all of the GLOBAL's and require's and simplify all of the code after adding the descriptions to


AddIngredientValues({"humanmeat"}, {meat=1, monster=1}, true, true)

local function addhumanmeattag(inst) inst:AddTag("humanmeat") end

AddPrefabPostInit("humanmeat", addhumanmeattag)
AddPrefabPostInit("humanmeat_cooked", addhumanmeattag)
AddPrefabPostInit("humanmeat_dried", addhumanmeattag)

 

Thank you! Just this?

 

--[[
 /-----------------------------------\
|           Version History           |
 \-----------------------------------/

1.3 - Released
]]

GLOBAL.HUMAN_MEAT_ENABLED = true

STRINGS.CHARACTERS.WAXWELL.DESCRIBE.HUMANMEAT = "Now there's nothing for it but to rot. Or is there?"
STRINGS.CHARACTERS.WAXWELL.DESCRIBE.HUMANMEAT_COOKED = "Sautéed to take the civilized route."
STRINGS.CHARACTERS.WAXWELL.DESCRIBE.HUMANMEAT_DRIED = "Now bereft of moisture but not of moral ambiguity."

STRINGS.CHARACTERS.WILLOW.DESCRIBE.HUMANMEAT = "You could still cremate it!"
STRINGS.CHARACTERS.WILLOW.DESCRIBE.HUMANMEAT_COOKED = "Dead flesh improved by fire."
STRINGS.CHARACTERS.WILLOW.DESCRIBE.HUMANMEAT_DRIED = "I think it could still burn."

STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.HUMANMEAT = "Autolysis will soon give way to putrefaction."
STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.HUMANMEAT_COOKED = "Metmyoglobin gives it its unique color."
STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.HUMANMEAT_DRIED = "Human flesh dried by osmosis."

STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.HUMANMEAT = "Better them than Wolfgang."
STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.HUMANMEAT_COOKED = "Babcia's secret recipe!"
STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.HUMANMEAT_DRIED = "Is like shoe, but better for belly!"

STRINGS.CHARACTERS.WOODIE.DESCRIBE.HUMANMEAT = "Should probably put it away somewhere nice and respectful."
STRINGS.CHARACTERS.WOODIE.DESCRIBE.HUMANMEAT_COOKED = "That's not exactly what we had in mind."
STRINGS.CHARACTERS.WOODIE.DESCRIBE.HUMANMEAT_DRIED = "Desperate times, eh?"

STRINGS.CHARACTERS.WEBBER.DESCRIBE.HUMANMEAT = "Would eating this kind of make us like a turducken?"
STRINGS.CHARACTERS.WEBBER.DESCRIBE.HUMANMEAT_COOKED = "We're sure this is cooked human meat."
STRINGS.CHARACTERS.WEBBER.DESCRIBE.HUMANMEAT_DRIED = "Dried human meat."

STRINGS.CHARACTERS.WX78.DESCRIBE.HUMANMEAT = "A FURTHER IMPROVEMENT OF THE HUMAN CONDITION."
STRINGS.CHARACTERS.WX78.DESCRIBE.HUMANMEAT_COOKED = "FINALLY, A PURPOSE FOR THE FLESHY PESTILENCE."
STRINGS.CHARACTERS.WX78.DESCRIBE.HUMANMEAT_DRIED = "NICE AND DRY."

STRINGS.CHARACTERS.WENDY.DESCRIBE.HUMANMEAT = "Once a mortal coil, now discarded."
STRINGS.CHARACTERS.WENDY.DESCRIBE.HUMANMEAT_COOKED = "Would the soul even question your purpose?"
STRINGS.CHARACTERS.WENDY.DESCRIBE.HUMANMEAT_DRIED = "Long removed from the vessel it once was."

STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.HUMANMEAT = "Honor yöur fallen combatants!"
STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.HUMANMEAT_COOKED = "They perished blazing, and cööked the same."
STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.HUMANMEAT_DRIED = "Hard and unyielding, even in death!"

AddIngredientValues({"humanmeat"}, {meat=1, monster=1}, true, true)

local function addhumanmeattag(inst) inst:AddTag("humanmeat") end

AddPrefabPostInit("humanmeat", addhumanmeattag)
AddPrefabPostInit("humanmeat_cooked", addhumanmeattag)
AddPrefabPostInit("humanmeat_dried", addhumanmeattag)

The meat value would make it crockpot friendly, right?

Link to comment
Share on other sites

1 hour ago, alainmcd said:

Yup, AddIngredientValues makes it a valid ingredient, and its third and fourth parameters (cancook and candry) makes the cooked and dried versions valid ingredients too.

Awesome. Thank you so much!

Link to comment
Share on other sites

Aaand it still crashes. Sigh. Not sure what I'm messing up.

Current modmain,lua:

 

--[[
 /-----------------------------------\
|           Version History           |
 \-----------------------------------/

1.5 - Released
]]

GLOBAL.HUMAN_MEAT_ENABLED = true

STRINGS.CHARACTERS.WAXWELL.DESCRIBE.HUMANMEAT = "Now there's nothing for it but to rot. Or is there?"
STRINGS.CHARACTERS.WAXWELL.DESCRIBE.HUMANMEAT_COOKED = "Sautéed to take the civilized route."
STRINGS.CHARACTERS.WAXWELL.DESCRIBE.HUMANMEAT_DRIED = "Now bereft of moisture but not of moral ambiguity."

STRINGS.CHARACTERS.WILLOW.DESCRIBE.HUMANMEAT = "You could still cremate it!"
STRINGS.CHARACTERS.WILLOW.DESCRIBE.HUMANMEAT_COOKED = "Dead flesh improved by fire."
STRINGS.CHARACTERS.WILLOW.DESCRIBE.HUMANMEAT_DRIED = "I think it could still burn."

STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.HUMANMEAT = "Autolysis will soon give way to putrefaction."
STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.HUMANMEAT_COOKED = "Metmyoglobin gives it its unique color."
STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.HUMANMEAT_DRIED = "Human flesh dried by osmosis."

STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.HUMANMEAT = "Better them than Wolfgang."
STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.HUMANMEAT_COOKED = "Babcia's secret recipe!"
STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.HUMANMEAT_DRIED = "Is like shoe, but better for belly!"

STRINGS.CHARACTERS.WOODIE.DESCRIBE.HUMANMEAT = "Should probably put it away somewhere nice and respectful."
STRINGS.CHARACTERS.WOODIE.DESCRIBE.HUMANMEAT_COOKED = "That's not exactly what we had in mind."
STRINGS.CHARACTERS.WOODIE.DESCRIBE.HUMANMEAT_DRIED = "Desperate times, eh?"

STRINGS.CHARACTERS.WEBBER.DESCRIBE.HUMANMEAT = "Would eating this kind of make us like a turducken?"
STRINGS.CHARACTERS.WEBBER.DESCRIBE.HUMANMEAT_COOKED = "We're sure this is cooked human meat."
STRINGS.CHARACTERS.WEBBER.DESCRIBE.HUMANMEAT_DRIED = "Dried human meat."

STRINGS.CHARACTERS.WX78.DESCRIBE.HUMANMEAT = "A FURTHER IMPROVEMENT OF THE HUMAN CONDITION."
STRINGS.CHARACTERS.WX78.DESCRIBE.HUMANMEAT_COOKED = "FINALLY, A PURPOSE FOR THE FLESHY PESTILENCE."
STRINGS.CHARACTERS.WX78.DESCRIBE.HUMANMEAT_DRIED = "NICE AND DRY."

STRINGS.CHARACTERS.WENDY.DESCRIBE.HUMANMEAT = "Once a mortal coil, now discarded."
STRINGS.CHARACTERS.WENDY.DESCRIBE.HUMANMEAT_COOKED = "Would the soul even question your purpose?"
STRINGS.CHARACTERS.WENDY.DESCRIBE.HUMANMEAT_DRIED = "Long removed from the vessel it once was."

STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.HUMANMEAT = "Honor your fallen combatants!"
STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.HUMANMEAT_COOKED = "They perished blazing, and cooked the same."
STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.HUMANMEAT_DRIED = "Hard and unyielding, even in death!"

AddIngredientValues({"humanmeat"}, {meat=1, monster=1}, true, true)

local function addhumanmeattag(inst) inst:AddTag("humanmeat") end

AddPrefabPostInit("humanmeat", addhumanmeattag)
AddPrefabPostInit("humanmeat_cooked", addhumanmeattag)
AddPrefabPostInit("humanmeat_dried", addhumanmeattag)

 

Link to comment
Share on other sites

28 minutes ago, alainmcd said:

My bad, you do need the line


local STRINGS = GLOBAL.STRINGS

before the descriptions. Sorry!

Oh, I did add that when messing with it, my bad! But it's still crashing anyway. I'm wondering if it's something with the modinfo, maybe? I'm just uploading the whole folder because I dunno what's up.

Here's the Steam link, too. http://steamcommunity.com/sharedfiles/filedetails/?id=934446116

lpr.rar

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...