Jump to content

Need help solving client crash when character sleeps


Recommended Posts

Just when I thought my character mod was stable, I received a crash report after a subscriber attempted to eat a mandrake root. This is the log they provided, and I can't make head or tails of it.

Spoiler

 

[02:59:04]: [string "scripts/components/playervision.lua"]:43: attempt to index field 'inventory' (a nil value)
LUA ERROR stack traceback:
scripts/components/playervision.lua:43 in (local) fn (Lua) <41-56>
scripts/entityscript.lua:998 in (method) PushEvent (Lua) <985-1012>
scripts/prefabs/inventory_classified.lua:306 in (field) fn (Lua) <301-312>
scripts/scheduler.lua:177 in (method) OnTick (Lua) <155-207>
scripts/scheduler.lua:371 in (global) RunScheduler (Lua) <369-377>
scripts/update.lua:170 in () ? (Lua) <149-228>

[02:59:06]: Error deserializing lua state for entity apidae[100076] - Failed to read net var data
[02:59:25]: [Connect] PendingConnection::Reset(true)
[02:59:25]: PushNetworkDisconnectEvent With Reason: "ID_DISCONNECTION_NOTIFICATION", reset: true
[02:59:25]: Serializing user: session/70F826E6D70D2F26/A7GDNPFIBH5F/0000000001
[02:59:25]: [Steam] Game Connection terminated (1408868475|11000)

 

I had my friend help me recreate the crash this morning, so I know it only affects the client. Same action, same result, but the logs are different.

Spoiler

[00:02:07]: DeserializeHandShakeServerListing
[00:02:07]: Network tick rate: U=10(3), D=15
[00:02:07]: Version: 233071
[00:02:07]: SendClientInventoryHandShakePacket to <6242942867557420971>
[00:02:08]: Begin Session: 7AF65AD3B92C7803
[00:02:08]: Done Downloading Client Object Data
[00:02:08]: DownloadMods and temp disable	
[00:02:08]: We now have the required mods, enable them for server	
[00:02:08]: Temp Enabling workshop-1145848156	
[00:02:08]: ModIndex:SetTempModConfigData	
[00:02:08]: Setting temp mod config for mod 	workshop-1145848156	
[00:02:08]: Mods are setup for server, save the mod index and proceed.	
[00:02:08]: Downloading [0] From: server_temp
[00:02:09]: 0 (39%) 1/1 server_temp\server_save 114000b / 286147b
[00:02:10]: 0 (79%) 1/1 server_temp\server_save 228000b / 286147b
[00:02:10]: 0 (100%) 1/1 server_temp\server_save 286147b / 286147b
[00:02:10]: Download complete[0] Files: 1 Size: 286147
[00:02:12]: Collecting garbage...
[00:02:12]: lua_gc took 0.03 seconds
[00:02:12]: ~ShardLuaProxy()
[00:02:12]: ~ItemServerLuaProxy()
[00:02:12]: ~InventoryLuaProxy()
[00:02:12]: ~NetworkLuaProxy()
[00:02:12]: ~SimLuaProxy()
[00:02:12]: ModWorkshop::CancelDownloads clearing all unfinished downloads
[00:02:13]: lua_close took 0.05 seconds
[00:02:13]: ReleaseAll
[00:02:13]: ReleaseAll Finished
[00:02:13]: cGame::StartPlaying
[00:02:13]: LOADING LUA
[00:02:13]: DoLuaFile scripts/main.lua
[00:02:13]: DoLuaFile loading buffer scripts/main.lua
[00:02:13]: running main.lua
	
[00:02:13]: loaded modindex	
[00:02:13]: ModIndex: Beginning normal load sequence.
	
[00:02:13]: ModIndex:GetModsToLoad inserting moddir, 	workshop-1145848156	
[00:02:13]: Could not load mod_config_data/modconfiguration_workshop-1145848156_CLIENT	
[00:02:13]: Loading mod: workshop-1145848156 (Pollen) Version:1.2.0	
[00:02:13]: Mod: workshop-1145848156 (Pollen)	Loading modworldgenmain.lua	
[00:02:13]: Mod: workshop-1145848156 (Pollen)	  Mod had no modworldgenmain.lua. Skipping.	
[00:02:13]: Mod: workshop-1145848156 (Pollen)	Loading modmain.lua	
[00:02:13]: LOADING LUA SUCCESS
[00:02:13]: PlayerDeaths loaded morgue	1388	
[00:02:13]: PlayerHistory loaded player_history	486	
[00:02:13]: bloom_enabled	false	
[00:02:13]: loaded saveindex	
[00:02:13]: OnFilesLoaded()	
[00:02:13]: OnUpdatePurchaseStateComplete	
[00:02:13]: 	Unload FE	
[00:02:13]: 	Unload FE done	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	Registering prefabs	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	  Registering prefab file: prefabs/apidae	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	    apidae	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	  Registering prefab file: prefabs/apidae_none	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	    apidae_none	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	  Registering prefab file: prefabs/light_bees	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	    light_bees	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	  Registering prefab file: prefabs/happy_bees	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	    happy_bees	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	  Registering prefab file: prefabs/angry_bees	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	    angry_bees	
[00:02:14]: Mod: workshop-1145848156 (Pollen)	  Registering default mod prefab	
[00:02:15]: ../mods/workshop-1145848156/images/saveslot_portraits/apidae.tex is 120x104 but compressed textures must have power of 2 dimensions.
[00:02:15]: ERROR: HWTexture::DeserializeTexture failed on ../mods/workshop-1145848156/images/saveslot_portraits/apidae.tex. glGetError returned 0x501
[00:02:15]: 120x104 format: 0x83f3 mips: 7
[00:02:15]: ../mods/workshop-1145848156/images/selectscreen_portraits/apidae.tex is 188x284 but compressed textures must have power of 2 dimensions.
[00:02:15]: ERROR: HWTexture::DeserializeTexture failed on ../mods/workshop-1145848156/images/selectscreen_portraits/apidae.tex. glGetError returned 0x501
[00:02:15]: 188x284 format: 0x83f3 mips: 9
[00:02:15]: ../mods/workshop-1145848156/images/selectscreen_portraits/apidae_silho.tex is 188x284 but compressed textures must have power of 2 dimensions.
[00:02:15]: ERROR: HWTexture::DeserializeTexture failed on ../mods/workshop-1145848156/images/selectscreen_portraits/apidae_silho.tex. glGetError returned 0x501
[00:02:15]: 188x284 format: 0x83f3 mips: 9
[00:02:15]: 	LOAD BE	
[00:02:19]: 	LOAD BE: done	
[00:02:20]: Loading world: client_temp/server_save	
[00:02:20]: Save file is at version 4.77	
[00:02:20]: MiniMapComponent::AddAtlas( minimap/minimap_data.xml )
[00:02:20]: MiniMapComponent::AddAtlas( ../mods/workshop-1145848156/images/map_icons/apidae.xml )
[00:02:21]: Loading Nav Grid	
[00:02:21]: setting 	summerlength	15	
[00:02:21]: setting 	isnightmaredawn	false	
[00:02:21]: setting 	elapseddaysinseason	7	
[00:02:21]: setting 	isfullmoon	false	
[00:02:21]: setting 	moisture	638.90045166016	
[00:02:21]: setting 	springlength	20	
[00:02:21]: setting 	isnightmarewild	false	
[00:02:21]: setting 	moonphase	threequarter	
[00:02:21]: setting 	precipitationrate	0	
[00:02:21]: setting 	iswet	false	
[00:02:21]: setting 	isnewmoon	false	
[00:02:21]: setting 	iswinter	false	
[00:02:21]: setting 	israining	false	
[00:02:21]: setting 	issummer	false	
[00:02:21]: setting 	time	0.093640931447347	
[00:02:21]: setting 	wetness	0	
[00:02:21]: setting 	moistureceil	5661.0322265625	
[00:02:21]: setting 	isday	true	
[00:02:21]: setting 	nightmaretimeinphase	0	
[00:02:21]: setting 	season	autumn	
[00:02:21]: setting 	isnight	false	
[00:02:21]: setting 	cycles	7	
[00:02:21]: setting 	isnightmarecalm	false	
[00:02:21]: setting 	timeinphase	0.18728186289469	
[00:02:21]: setting 	isdusk	false	
[00:02:21]: setting 	iscavedusk	false	
[00:02:21]: setting 	isautumn	true	
[00:02:21]: setting 	iscaveday	true	
[00:02:21]: setting 	remainingdaysinseason	13	
[00:02:21]: setting 	phase	day	
[00:02:21]: setting 	snowlevel	0	
[00:02:21]: setting 	iswaxingmoon	true	
[00:02:21]: setting 	autumnlength	20	
[00:02:21]: setting 	pop	0.021987341009039	
[00:02:21]: setting 	nightmaretime	0	
[00:02:21]: setting 	isspring	false	
[00:02:21]: setting 	winterlength	15	
[00:02:21]: setting 	nightmarephase	none	
[00:02:21]: setting 	issnowcovered	false	
[00:02:21]: setting 	issnowing	false	
[00:02:21]: setting 	iscavenight	false	
[00:02:21]: setting 	temperature	27.908331041879	
[00:02:21]: setting 	cavephase	day	
[00:02:21]: setting 	precipitation	none	
[00:02:21]: setting 	isnightmarewarn	false	
[00:02:21]: Reconstructing topology	
[00:02:21]: 	...Sorting points	
[00:02:21]: 	...Sorting edges	
[00:02:21]: 	...Connecting nodes	
[00:02:21]: 	...Validating connections	
[00:02:21]: 	...Housekeeping	
[00:02:21]: 	...Done!	
[00:02:21]: ModIndex: Load sequence finished successfully.	
[00:02:21]: Reset() returning
[00:02:23]: Attempting to send resume request
[00:02:23]: ReceiveResumeNotification
[00:02:23]: Deleting user: session/7AF65AD3B92C7803/A7JUEUHNLG4D/0000000001
[00:02:28]: WARNING! Could not find region 'FROMNUM' from atlas 'FROMNUM'. Is the region specified in the atlas?
[00:02:28]: Looking for default texture '' from atlas 'FROMNUM'.
[00:02:28]: Error Looking for default texture in from atlas 'FROMNUM'.
[00:02:36]: Movement prediction enabled	
[00:02:36]: Could not find anim bank [happy_bees]
[00:02:36]: Deserializing tile data (425 x 425)
[00:03:05]: Deserialized invalid parent for entity apidae[100395]
[00:03:06]: [string "scripts/components/hallucinations.lua"]:136: attempt to index field 'sanity' (a nil value)
LUA ERROR stack traceback:
scripts/components/hallucinations.lua:136 in (field) fn (Lua) <135-156>
   inst = 100023 - world (valid:true)
   hallucination = table: 401D3978
scripts/scheduler.lua:177 in (method) OnTick (Lua) <155-207>
   self =
      running = table: 1809F178
      waitingfortick = table: 1809F470
      tasks = table: 1809F308
      waking = table: 280D0A78
      attime = table: 1809F218
      hibernating = table: 1809F268
   tick = 1285
   k = PERIODIC 100023: 9.109775
   v = true
   already_dead = false
scripts/scheduler.lua:371 in (global) RunScheduler (Lua) <369-377>
   tick = 1285
scripts/update.lua:170 in () ? (Lua) <149-228>
   dt = 0.033333335071802
   tick = 1285
   i = 1285

[00:03:06]: [string "scripts/components/hallucinations.lua"]:136: attempt to index field 'sanity' (a nil value)
LUA ERROR stack traceback:
    scripts/components/hallucinations.lua:136 in (field) fn (Lua) <135-156>
    scripts/scheduler.lua:177 in (method) OnTick (Lua) <155-207>
    scripts/scheduler.lua:371 in (global) RunScheduler (Lua) <369-377>
    scripts/update.lua:170 in () ? (Lua) <149-228>
	
[00:03:14]: Deserialized invalid parent for entity apidae[101411]
[00:04:09]: [Connect] PendingConnection::Reset(true)
[00:04:09]: PushNetworkDisconnectEvent With Reason: "ID_DISCONNECTION_NOTIFICATION", reset: true
[00:04:09]: Serializing user: session/7AF65AD3B92C7803/A7JUEUHNLG4D/0000000001
[00:04:09]: [Shard] Stopping shard mode
[00:04:09]: ModWorkshop::CancelDownloads clearing all unfinished downloads

This is my first time coding and I am completely out of my depth with this error. If anyone could please help me troubleshoot and solve this, I will be grateful beyond words.

Here's the workshop link to my mod:
http://steamcommunity.com/sharedfiles/filedetails/?id=1145848156

Here are the modmain and character .lua files, respectively.

Spoiler

TUNING.HAT_BEES = 999999999
TUNING.HAT_BEES_ABSORBTION = 1

PrefabFiles = {
    "apidae",
    "apidae_none",
    "light_bees",
    "happy_bees",
    "angry_bees",
}

Assets = {
    Asset( "IMAGE", "images/saveslot_portraits/apidae.tex" ),
    Asset( "ATLAS", "images/saveslot_portraits/apidae.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/apidae.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/apidae.xml" ),
    
    Asset( "IMAGE", "images/selectscreen_portraits/apidae_silho.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/apidae_silho.xml" ),

    Asset( "IMAGE", "bigportraits/apidae.tex" ),
    Asset( "ATLAS", "bigportraits/apidae.xml" ),
    
    Asset( "IMAGE", "images/map_icons/apidae.tex" ),
    Asset( "ATLAS", "images/map_icons/apidae.xml" ),
    
    Asset( "IMAGE", "images/avatars/avatar_apidae.tex" ),
    Asset( "ATLAS", "images/avatars/avatar_apidae.xml" ),
    
    Asset( "IMAGE", "images/avatars/avatar_ghost_apidae.tex" ),
    Asset( "ATLAS", "images/avatars/avatar_ghost_apidae.xml" ),
    
    Asset( "IMAGE", "images/avatars/self_inspect_apidae.tex" ),
    Asset( "ATLAS", "images/avatars/self_inspect_apidae.xml" ),
    
    Asset( "IMAGE", "images/names_apidae.tex" ),
    Asset( "ATLAS", "images/names_apidae.xml" ),
    
    Asset( "IMAGE", "bigportraits/apidae_none.tex" ),
    Asset( "ATLAS", "bigportraits/apidae_none.xml" ),
    
    Asset("IMAGE", "images/inventoryimages/happy_bees.tex"),
    Asset("ATLAS", "images/inventoryimages/happy_bees.xml"),
        
    Asset("IMAGE", "images/inventoryimages/light_bees.tex"),
    Asset("ATLAS", "images/inventoryimages/light_bees.xml"),
        
    Asset("IMAGE", "images/inventoryimages/angry_bees.tex"),
    Asset("ATLAS", "images/inventoryimages/angry_bees.xml"),
}

local require = GLOBAL.require
local STRINGS = GLOBAL.STRINGS

-- The character select screen lines
STRINGS.CHARACTER_TITLES.apidae = "A Friendly Bee"
STRINGS.CHARACTER_NAMES.apidae = "Pollen"
STRINGS.CHARACTER_DESCRIPTIONS.apidae = "*Bees defend her\n*Stronger in spring\n*Weak in the winter"
STRINGS.CHARACTER_QUOTES.apidae = "\"Hear that buzzing?\""

-- Custom speech strings
STRINGS.CHARACTERS.APIDAE = require "speech_apidae"

-- The character's name as appears in-game
STRINGS.NAMES.APIDAE = "Pollen"

STRINGS.NAMES.HAPPY_BEES = "Bumble Hat"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.HAPPY_BEES = "It's buzzing."
STRINGS.CHARACTERS.APIDAE.DESCRIBE.HAPPY_BEES = "They're so happy!"
STRINGS.NAMES.LIGHT_BEES = "Bright Bumble Hat"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.LIGHT_BEES = "It's buzzing... and glowing."
STRINGS.CHARACTERS.APIDAE.DESCRIBE.LIGHT_BEES = "They're so bright!"
STRINGS.NAMES.ANGRY_BEES = "Dangerous Bumble Hat"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.ANGRY_BEES = "That seems like a bad idea."
STRINGS.CHARACTERS.APIDAE.DESCRIBE.ANGRY_BEES = "Avenge them!"
 


AddMinimapAtlas("images/map_icons/apidae.xml")

-- Add mod character to mod character list. Also specify a gender. Possible genders are MALE, FEMALE, ROBOT, NEUTRAL, and PLURAL.
AddModCharacter("apidae", "FEMALE")

--Huge thank you and shout-out to DarkKingBoo on the forums for solving this one for me!!
local function FriendlyWaspInit(prefab)
    local function OnNearBy(prefab, target)
    if prefab.components.childspawner ~= nil and not target:HasTag("bee") then
        prefab.components.childspawner:ReleaseAllChildren(target, "killerbee")
    end

    end
    
    if prefab.components.playerprox then
    prefab.components.playerprox:SetOnPlayerNear(OnNearBy)
    end
end

AddPrefabPostInit("wasphive", FriendlyWaspInit)

--not presently working. Here for reference.

--local function FriendlyBeeInit(prefab)
--    local function onharvest(prefab, picker)
--        if not inst:HasTag("burnt") then
--        updatelevel(inst)
--    if prefab.components.childspawner ~= nil and not TheWorld.state.iswinter and not picker:HasTag("bee") then
--        inst.components.childspawner:ReleaseAllChildren(picker)
--    end
--    end
--end
--end

--AddPrefabPostInit("beebox", FriendlyBeeInit)

--AddRecipe( "angry_bees",
--{Ingredient("stinger", 200),Ingredient("flower", 12),Ingredient("honey", 30)},
--GLOBAL.RECIPETABS.DRESS,
--GLOBAL.TECH.SCIENCE_TWO,
--"images/inventoryimages/angry_bees.xml",
--"angry_bees.tex")

Spoiler


local MakePlayerCharacter = require "prefabs/player_common"


local assets = {
    Asset("SCRIPT", "scripts/prefabs/player_common.lua"),
    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" ),
}
local prefabs = {
"bee", "killerbee",}

-- Custom starting items
local start_inv = {
"bee",
"bee",
"bee",
"bee",
"bee",
"bee",
"bee",
"bee",
"butterfly",
"butterfly",
"butterfly",
"butterfly",
"butterfly",
"butterfly",
"butterfly",
"butterfly",
"butterfly",
"butterfly",
"honeycomb",
"honeycomb",
"boards",
"boards",
"boards",
"boards",
"beebox_blueprint",
"happy_bees",
}

-- When the character is revived from human
local function onbecamehuman(inst)
    -- Set speed when reviving from ghost (optional)
end

local function onbecameghost(inst)
    -- Remove speed modifier when becoming a ghost
   inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "apidae_speed_mod", 1)
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( "apidae.tex" )
    
    inst:AddTag("bee")
    inst:AddTag("insect")
    inst:AddTag("smallcreature")
    inst:AddTag("flying")
    inst:AddTag ("worker")
    inst:AddTag ("pollinator")
    inst:AddTag ("flower")
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 = "wx78"
    
    -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used
    --inst.talker_path_override = "dontstarve_DLC001/characters/"
    
    -- Damage multiplier (optional)
    inst.components.combat.damagemultiplier = 1
    
    -- Hunger rate (optional)
    inst.components.hunger.hungerrate = 0.5 * TUNING.WILSON_HUNGER_RATE
    
    -- Stats
    inst.components.temperature.mintemp = 2
    inst.components.temperature.maxtemp_mult = 0.5

local function OnHit(inst, attacker, damage)
    if inst.components.childspawner ~= nil then
        inst.components.childspawner:ReleaseAllChildren(attacker, "killerbee")
        inst.components.childspawner.childname = "killerbee"
        inst.components.childspawner:SetMaxChildren(10)
        inst.components.childspawner.emergencychildname = "killerbee"
        inst.components.childspawner.emergencychildrenperplayer = 1
        inst.components.childspawner:SetMaxEmergencyChildren(10)
        inst.components.childspawner:SetEmergencyRadius(TUNING.WASPHIVE_EMERGENCY_RADIUS)
    end
end

local function SeasonalSpawnChanges(inst, season)
    if inst.components.childspawner ~= nil then
        if season == SEASONS.SPRING then
            inst.components.health:SetMaxHealth(150)
            inst.components.hunger:SetMax(100)
            inst.components.sanity:SetMax(150)
            inst.components.combat.damagemultiplier = 1.5
            inst.components.locomotor.walkspeed = 9
            inst.components.locomotor.runspeed = 10
        elseif season == SEASONS.SUMMER then
            inst.components.health:SetMaxHealth(125)
            inst.components.hunger:SetMax(90)
            inst.components.sanity:SetMax(125)
            inst.components.combat.damagemultiplier = 1
            inst.components.locomotor.walkspeed = 8
            inst.components.locomotor.runspeed = 9
        elseif season == SEASONS.AUTUMN then
            inst.components.health:SetMaxHealth(100)
            inst.components.hunger:SetMax(80)
            inst.components.sanity:SetMax(100)
            inst.components.combat.damagemultiplier = 0.5
            inst.components.locomotor.walkspeed = 7
            inst.components.locomotor.runspeed = 8
        elseif season == SEASONS.WINTER then
            inst.components.health:SetMaxHealth(75)
            inst.components.hunger:SetMax(70)
            inst.components.sanity:SetMax(75)
            inst.components.combat.damagemultiplier = 0        
            inst.components.locomotor.walkspeed = 6
            inst.components.locomotor.runspeed = 7
        end
    end
end

    inst:AddComponent("childspawner")
    inst.components.childspawner.childname = "killerbee"
    SeasonalSpawnChanges(inst, TheWorld.state.season)
    inst:WatchWorldState("season", SeasonalSpawnChanges)
    inst.components.childspawner.emergencychildname = "killerbee"
    inst.components.childspawner.emergencychildrenperplayer = 1
    inst.components.childspawner:SetMaxEmergencyChildren(10)
    inst.components.childspawner:SetEmergencyRadius(TUNING.BEEHIVE_EMERGENCY_RADIUS)
    
    inst.components.combat:SetOnHit(OnHit)
    
    MakeLargePropagator(inst)
        
    inst.OnLoad = onload
    inst.OnNewSpawn = onload
end

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

 

 

I'm also attaching the complete .zip for a more direct download than the workshop provides.

Pollen compressed.zip

Link to comment
Share on other sites

According to the log the main error causing the crash is this.

[00:03:06]: [string "scripts/components/hallucinations.lua"]:136: attempt to index field 'sanity' (a nil value)

I don't see anything in your code that calls on this component. Are the one's testing your mods using any additional mods or the Beta version of Don't Starve Together?

Link to comment
Share on other sites

35 minutes ago, RedHairedHero said:

According to the log the main error causing the crash is this.


[00:03:06]: [string "scripts/components/hallucinations.lua"]:136: attempt to index field 'sanity' (a nil value)

I don't see anything in your code that calls on this component. Are the one's testing your mods using any additional mods or the Beta version of Don't Starve Together?

Therein lies my confusion. I don't know about the user who first reported it, but when I recreated the crash with my friend it was the only mod we had on the server. Neither of us are using the Beta version.

Link to comment
Share on other sites

9 minutes ago, FeatherFallen said:

You saved me again. That was the problem. Thanks!!

Just a extra tip, if you need to make a custom thing to use for functions or whatever: Don't make custom tags unless absolutely necessary, use custom variables instead. Tags have a limit of 31(iirc) which players and states already use a large portion of, variables don't have such a low limit and you can do more with it in functions. 

If you don't know what a customvariable is, it'll look like this in your masterpostinit: inst.im_a_bee_you_guys_no_really = true 

It doesn't have to be true or false, you can store it with a string or a number. Just make sure you check the variable is ~= nil in your functions to avoid crashes.

 

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