Jump to content

Recommended Posts

My character's prefab is fighting with me. I thought I did everything right, but it still crashes. I'm trying to make her have the knowledge like Wickerbottom, and level up with veggies, but it doesn't work.

local MakePlayerCharacter = require "prefabs/player_common"

 
 
local assets = {
 
        Asset( "ANIM", "anim/player_basic.zip" ),
        Asset( "ANIM", "anim/player_idles_shiver.zip" ),
        Asset( "ANIM", "anim/player_actions.zip" ),
        Asset( "ANIM", "anim/player_actions_axe.zip" ),
        Asset( "ANIM", "anim/player_actions_pickaxe.zip" ),
        Asset( "ANIM", "anim/player_actions_shovel.zip" ),
        Asset( "ANIM", "anim/player_actions_blowdart.zip" ),
        Asset( "ANIM", "anim/player_actions_eat.zip" ),
        Asset( "ANIM", "anim/player_actions_item.zip" ),
        Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ),
        Asset( "ANIM", "anim/player_actions_bugnet.zip" ),
        Asset( "ANIM", "anim/player_actions_fishing.zip" ),
        Asset( "ANIM", "anim/player_actions_boomerang.zip" ),
        Asset( "ANIM", "anim/player_bush_hat.zip" ),
        Asset( "ANIM", "anim/player_attacks.zip" ),
        Asset( "ANIM", "anim/player_idles.zip" ),
        Asset( "ANIM", "anim/player_rebirth.zip" ),
        Asset( "ANIM", "anim/player_jump.zip" ),
        Asset( "ANIM", "anim/player_amulet_resurrect.zip" ),
        Asset( "ANIM", "anim/player_teleport.zip" ),
        Asset( "ANIM", "anim/wilson_fx.zip" ),
        Asset( "ANIM", "anim/player_one_man_band.zip" ),
        Asset( "ANIM", "anim/shadow_hands.zip" ),
        Asset( "SOUND", "sound/sfx.fsb" ),
        Asset( "SOUND", "sound/wilson.fsb" ),
        Asset( "ANIM", "anim/beard.zip" ),
 
        Asset( "ANIM", "anim/rosaleana.zip" ),
        Asset( "ANIM", "anim/ghost_rosaleana_build.zip" ),
}
local prefabs = {}
local start_inv = {
-- Custom starting items
}
 
local function applyupgrades(inst)
 
local max_upgrades = 30
local upgrades = math.min(inst.level, max_upgrades)
 
local hunger_percent = inst.components.hunger:GetPercent()
local health_percent = inst.components.health:GetPercent()
local sanity_percent = inst.components.sanity:GetPercent()
 
inst.components.hunger.max = math.ceil (150 + upgrades * 5) --300
inst.components.health.maxhealth = math.ceil (100 + upgrades * 4) --220
inst.components.sanity.max = math.ceil (90 + upgrades * 2) --150
 
inst.components.health:StartRegen(1, 11 - upgrades / 5) --1-5
 
inst.components.talker:Say("Level : ".. (inst.level))
 
if inst.level >29 then
inst.components.talker:Say("Level : Max!")
end
 
inst.components.hunger:SetPercent(hunger_percent)
inst.components.health:SetPercent(health_percent)
inst.components.sanity:SetPercent(sanity_percent)
 
end
 
local function oneat(inst, food)
 
--if food and food.components.edible and food.components.edible.foodtype == "HELLO" then
if food and food.components.edible and food.components.edible.foodtype=="VEGGIE" then
 
--give an upgrade!
inst.level = inst.level + 1
applyupgrades(inst)
inst.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup")
--inst.HUD.controls.status.heart:PulseGreen()
--inst.HUD.controls.status.stomach:PulseGreen()
--inst.HUD.controls.status.brain:PulseGreen()
 
--inst.HUD.controls.status.brain:ScaleTo(1.3,1,.7)
--inst.HUD.controls.status.heart:ScaleTo(1.3,1,.7)
--inst.HUD.controls.status.stomach:ScaleTo(1.3,1,.7)
end
end
local function onpreload(inst, data)
if data then
if data.level then
inst.level = data.level
applyupgrades(inst)
--re-set these from the save data, because of load-order clipping issues
if data.health and data.health.health then inst.components.health.currenthealth = data.health.health end
if data.hunger and data.hunger.hunger then inst.components.hunger.current = data.hunger.hunger end
if data.sanity and data.sanity.current then inst.components.sanity.current = data.sanity.current end
inst.components.health:DoDelta(0)
inst.components.hunger:DoDelta(0)
inst.components.sanity:DoDelta(0)
end
end
 
end
-- This initializes for both clients and the host
local common_postinit = function(inst) 
-- Minimap icon
inst.MiniMapEntity:SetIcon( "rosaleana.tex" )
end
 
-- This initializes for the host only
local master_postinit = function(inst)
inst.level = 0
inst.components.eater:SetOnEatFn(oneat)
applyupgrades(inst)
inst.components.builder.science_bonus = 1
-- choose which sounds this character will play
inst.soundsname = "willow"
-- Stats
inst.components.health:SetMaxHealth(150)
inst.components.hunger:SetMax(150)
inst.components.sanity:SetMax(200)
end
 
return MakePlayerCharacter("rosaleana", prefabs, assets, common_postinit, master_postinit, start_inv)
Link to comment
https://forums.kleientertainment.com/forums/topic/49886-game-crash/
Share on other sites

@Jjmarco  I think this is what the issue is

 
[00:03:05]: loaded modindex
[00:03:05]: ModIndex: Beginning normal load sequence.
 
[00:03:05]: ModIndex:GetModsToLoad inserting moddir, Rosaleana
[00:03:05]: Could not load mod_config_data/modconfiguration_Rosaleana
[00:03:05]: Loading mod: Rosaleana
[00:03:05]: Mod: Rosaleana Loading modworldgenmain.lua
[00:03:05]: Mod: Rosaleana  Mod had no modworldgenmain.lua. Skipping.
[00:03:05]: Mod: Rosaleana Loading modmain.lua
[00:03:05]: Warning: Mod Character rosaleana does not currently specify a gender. Please update the call to AddModCharacter to include a gender. "FEMALE", "MALE", "ROBOT", or "NEUTRAL", or "PLURAL"
[00:03:05]: LOADING LUA SUCCESS
[00:03:05]: PlayerDeaths loaded morgue 4177
[00:03:05]: loaded profile
[00:03:05]: bloom_enabled false
[00:03:05]: loaded saveindex
[00:03:05]: OnFilesLoaded()
[00:03:05]: OnUpdatePurchaseStateComplete
[00:03:05]: Unload BE
[00:03:05]: Unload BE done
[00:03:07]: Mod: Rosaleana Registering prefabs
[00:03:07]: Mod: Rosaleana  Registering prefab file: prefabs/rosaleana
[00:03:07]: error calling LoadPrefabFile in mod Rosaleana: 
[string "scripts/util.lua"]:292: Could not find an asset matching anim/ghost_rosaleana_build.zip in any of the search paths.
LUA ERROR stack traceback:
        =[C] in function 'assert'
        scripts/util.lua(292,1) in function 'resolvefilepath'
        scripts/mainfunctions.lua(72,1) in function 'RegisterPrefabs'
        scripts/mainfunctions.lua(99,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        scripts/mods.lua(165,1)
        scripts/mods.lua(460,1) in function 'RegisterPrefabs'
        scripts/gamelogic.lua(158,1) in function 'LoadAssets'
        scripts/gamelogic.lua(943,1) in function 'DoResetAction'
        scripts/gamelogic.lua(961,1) in function 'complete_callback'
...
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(90,1) in function 'Load'
        scripts/gamelogic.lua(982,1) in function 'callback'
        scripts/playerprofile.lua(671,1) in function 'Set'
        scripts/playerprofile.lua(553,1)
        =[C] in function 'GetPersistentString'
        scripts/playerprofile.lua(551,1) in function 'Load'
        scripts/gamelogic.lua(981,1) in main chunk
        =[C] in function 'require'
        scripts/mainfunctions.lua(681,1)
[00:03:07]: Disabling Rosaleana because it had an error.
[00:03:07]: [string "scripts/util.lua"]:292: Could not find an asset matching anim/ghost_rosaleana_build.zip in any of the search paths.
LUA ERROR stack traceback:
        =[C] in function 'assert'
        scripts/util.lua(292,1) in function 'resolvefilepath'
        scripts/mainfunctions.lua(72,1) in function 'RegisterPrefabs'
        scripts/mainfunctions.lua(99,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        scripts/mods.lua(165,1)
        scripts/mods.lua(460,1) in function 'RegisterPrefabs'
        scripts/gamelogic.lua(158,1) in function 'LoadAssets'
        scripts/gamelogic.lua(943,1) in function 'DoResetAction'
        scripts/gamelogic.lua(961,1) in function 'complete_callback'
...
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(90,1) in function 'Load'
        scripts/gamelogic.lua(982,1) in function 'callback'
        scripts/playerprofile.lua(671,1) in function 'Set'
        scripts/playerprofile.lua(553,1)
        =[C] in function 'GetPersistentString'
        scripts/playerprofile.lua(551,1) in function 'Load'
        scripts/gamelogic.lua(981,1) in main chunk
        =[C] in function 'require'
        scripts/mainfunctions.lua(681,1)
[00:03:07]: SCRIPT ERROR! Showing error screen
[00:03:07]: Mod: Rosaleana  Registering default mod prefab
[00:03:07]: Load FE
[00:03:08]: Load FE: done
[00:03:08]: platform_motd table: 120DDAC0
[00:03:08]: SimLuaProxy::QueryServer()
[00:03:08]: update_date table: 120DE830
[00:03:08]: SimLuaProxy::QueryServer()
[00:03:08]: ModIndex: Load sequence finished successfully.
 
[00:03:08]: Reset() returning
[00:03:08]: QueryServerComplete no callback
[00:03:08]: QueryServerComplete no callback
[00:03:08]: platform_motd table: 132BB438
[00:03:08]: update_date table: 132BC400
[00:03:18]: unloading prefabs for mod MOD_Rosaleana
[00:03:18]: Collecting garbage...
[00:03:18]: lua_gc took 0.02 seconds
[00:03:18]: ~NetworkLuaProxy()
[00:03:18]: ~SimLuaProxy()
[00:03:18]: lua_close took 0.03 seconds
[00:03:18]: HttpClient::ClientThread::Main() complete
[00:03:18]: HttpClient::ClientThread::Main() complete
[00:03:18]: HttpClient::ClientThread::Main() complete
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:18]: HttpClient::ClientThread::Main() complete
[00:03:18]: Shutting down

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
×
  • Create New...