Jump to content

Error with Mod


Recommended Posts

Sorry if this is the wrong place, hardly use this forum. Had been away from modding for awile now and having an issue. See error in the picture, also if anyone can tell me how to open the compiler in cmd prompt would help, had saw old threads but then i copy past the code into it it just says its invalid, im rusty XD

keayrin error.png

Link to comment
Share on other sites

You seem to be missing a file, from what I can see here. go into your prefabs folder, make a notepad, name it keayrin.lua and paste this spoiler into it:

Spoiler


local MakePlayerCharacter = require "prefabs/player_common"


local assets = {
    Asset("SCRIPT", "scripts/prefabs/player_common.lua"),
}
local prefabs = {}

-- Custom starting items
--local start_inv = {
--    "placeitemshere",

--}

-- When the character is revived from human
local function onbecamehuman(inst)
    -- Set speed when reviving from ghost (optional)
    inst.components.locomotor:SetExternalSpeedMultiplier(inst, "keayrin_speed_mod", 1)
end

local function onbecameghost(inst)
    -- Remove speed modifier when becoming a ghost
   inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "keayrin_speed_mod")
end

-- When loading or spawning the character
local function onload(inst)
    inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman)
    inst:ListenForEvent("ms_becameghost", onbecameghost)

    if inst:HasTag("playerghost") then
        onbecameghost(inst)
    else
        onbecamehuman(inst)
    end
end


-- This initializes for both the server and client. Tags can be added here.
local common_postinit = function(inst) 
    -- Minimap icon
    inst.MiniMapEntity:SetIcon( "keayrin.tex" )
end

-- This initializes for the server only. Components are added here.
local master_postinit = function(inst)
    -- choose which sounds this character will play
    inst.soundsname = "wilson"
    
    -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used
    --inst.talker_path_override = "dontstarve_DLC001/characters/"
    
    -- Stats    
    inst.components.health:SetMaxHealth(150)
    inst.components.hunger:SetMax(150)
    inst.components.sanity:SetMax(150)
    
    -- Damage multiplier (optional)
    inst.components.combat.damagemultiplier = 1
    
    -- Hunger rate (optional)
    inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE
    -- Night sanity drain
    inst.components.sanity.night_drain_mult = 1
    --Monster Sanity Drain
    inst.components.sanity.night_drain_mult =1
    
    inst.OnLoad = onload
    inst.OnNewSpawn = onload
    
end

return MakePlayerCharacter("keayrin", prefabs, assets, common_postinit, master_postinit, start_inv)
 

if it crashes again, paste the log file here

Move this to modding section, @ImDaMisterL ?

 

Edited by ReubuxxInc
whoops, missed some things
Link to comment
Share on other sites

1 minute ago, ReubuxxInc said:

Thanks, I dunno how to do that yet.

When you type the @ and then put some letters after it, a prompt should come up. If not, just press space and the backspace key, then try typing said letters again, and the prompt should come up.

Edited by Weirdobob
Link to comment
Share on other sites

Spoiler


local MakePlayerCharacter = require "prefabs/player_common"


local assets = {
    Asset("SCRIPT", "scripts/prefabs/player_common.lua"),
}
local prefabs = {}

-- Custom starting items
local start_inv = {"meat","monstermeat"
}


-- When the character is revived from human
local function onbecamehuman(inst)
    -- Set speed when reviving from ghost (optional)
    inst.components.locomotor:SetExternalSpeedMultiplier(inst, "keayrin_speed_mod", 1.3)
end

local function onbecameghost(inst)
    -- Remove speed modifier when becoming a ghost
   inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "keayrin_speed_mod")
end

-- When loading or spawning the character
local function onload(inst)
    inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman)
    inst:ListenForEvent("ms_becameghost", onbecameghost)

    if inst:HasTag("playerghost") then
        onbecameghost(inst)
    else
        onbecamehuman(inst)
    end
end

 

-- This initializes for both the server and client. Tags can be added here.
local common_postinit = function(inst)
    -- Minimap icon
    inst.MiniMapEntity:SetIcon( "keayrin.tex" )
end

-- This initializes for the server only. Components are added here.
local master_postinit = function(inst)
    -- choose which sounds this character will play
    inst.soundsname = "wendy"
    
    -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used
    --inst.talker_path_override = "dontstarve_DLC001/characters/"
    
    -- Stats    
    inst.components.health:SetMaxHealth(130)
    inst.components.hunger:SetMax(200)
    inst.components.sanity:SetMax(150)
    
    -- Damage multiplier (optional)
    inst.components.combat.damagemultiplier = 1.0
    
    -- Hunger rate (optional)
    inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE
    
        inst:AddComponent("sanityaura")
    inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALL
    
        inst.components.eater.strongstomach = true
        inst.components.eater:SetDiet( { FOODGROUP.OMNI }, { FOODTYPE.MEAT, FOODTYPE.MONSTERMEAT, FOODTYPE.GENERIC } )

    
    inst.OnLoad = onload
    inst.OnNewSpawn = onload
    end

return MakePlayerCharacter("keayrin", prefabs, assets, common_postinit, master_postinit, start_inv)

I do have it set up as the friend just wanted the same thing as another friend with slightly changed stat numbers, so idk where the issue is coming from, even when i copy pasted yours in same window so not sure.

Link to comment
Share on other sites

18 minutes ago, Kairiyu said:
  Hide contents


local MakePlayerCharacter = require "prefabs/player_common"


local assets = {
    Asset("SCRIPT", "scripts/prefabs/player_common.lua"),
}
local prefabs = {}

-- Custom starting items
local start_inv = {"meat","monstermeat"
}


-- When the character is revived from human
local function onbecamehuman(inst)
    -- Set speed when reviving from ghost (optional)
    inst.components.locomotor:SetExternalSpeedMultiplier(inst, "keayrin_speed_mod", 1.3)
end

local function onbecameghost(inst)
    -- Remove speed modifier when becoming a ghost
   inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "keayrin_speed_mod")
end

-- When loading or spawning the character
local function onload(inst)
    inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman)
    inst:ListenForEvent("ms_becameghost", onbecameghost)

    if inst:HasTag("playerghost") then
        onbecameghost(inst)
    else
        onbecamehuman(inst)
    end
end

 

-- This initializes for both the server and client. Tags can be added here.
local common_postinit = function(inst)
    -- Minimap icon
    inst.MiniMapEntity:SetIcon( "keayrin.tex" )
end

-- This initializes for the server only. Components are added here.
local master_postinit = function(inst)
    -- choose which sounds this character will play
    inst.soundsname = "wendy"
    
    -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used
    --inst.talker_path_override = "dontstarve_DLC001/characters/"
    
    -- Stats    
    inst.components.health:SetMaxHealth(130)
    inst.components.hunger:SetMax(200)
    inst.components.sanity:SetMax(150)
    
    -- Damage multiplier (optional)
    inst.components.combat.damagemultiplier = 1.0
    
    -- Hunger rate (optional)
    inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE
    
        inst:AddComponent("sanityaura")
    inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALL
    
        inst.components.eater.strongstomach = true
        inst.components.eater:SetDiet( { FOODGROUP.OMNI }, { FOODTYPE.MEAT, FOODTYPE.MONSTERMEAT, FOODTYPE.GENERIC } )

    
    inst.OnLoad = onload
    inst.OnNewSpawn = onload
    end

return MakePlayerCharacter("keayrin", prefabs, assets, common_postinit, master_postinit, start_inv)

I do have it set up as the friend just wanted the same thing as another friend with slightly changed stat numbers, so idk where the issue is coming from, even when i copy pasted yours in same window so not sure.

Is it still crashing? paste your client log here and I can see why its crashing.

Link to comment
Share on other sites

[00:00:23]: Disabling keayrin mod (Keayrin) because it had an error.    
[00:00:23]: [string "scripts/mainfunctions.lua"]:90: Error loading file prefabs/Keayrin

    no file '../mods/keayrin mod/scripts/prefabs/Keayrin.lua' (checked with custom loader)
    no file 'scripts/prefabs/Keayrin.lua' (checked with custom loader)
    no file 'scriptlibs/prefabs/Keayrin.lua' (checked with custom loader)
    no file 'scripts/prefabs/Keayrin.lua' (checked with custom loader)

The mod either cant find the lua file or its not there. check inside the prefab folder. if its not there then I don't know why its happening.

Link to comment
Share on other sites

Whelp im a good apparently. It would appear last night before I went to sleep I must of hit it with a K not a k, which through it off, have to fix some other issues not but it actually did let me play as an outdated version i did first. So thank you for the help, prob wouldn't of realized it without you <3 forgot how goofy this game gets one a single letter x.x

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...