Jump to content

Is this correct?


Recommended Posts

Quote

--In modmain.lua

AddPrefabPostInit("hambat", function(inst)
        if GetPlayer().prefab == "hwasa" then
            inst:AddComponent("sanityaura")
            inst.components.sanityaura.aura = TUNING.SANITYAURA_MED
            inst:AddComponent("edible")
            inst.components.edible.foodtype = "MEAT"
            inst.components.edible.healthvalue = -10
            inst.components.edible.hungervalue = 50
            inst.components.edible.sanityvalue = 20
        end
    end)

I followed this tutorial to make Hambat edible for my character.

 

It worked fine yesterday but somehow not today.
The game keeps crashing with "attempt to index a nil value"

Here's the client log: 

Quote

[00:00:57]: [string "../mods/workshop-2270789417/modmain.lua"]:69: attempt to index a nil value
LUA ERROR stack traceback:
        ../mods/workshop-2270789417/modmain.lua(69,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        scripts/mods.lua(164,1) in function 'mod'
        scripts/mainfunctions.lua(267,1)
        =[C] in function 'SpawnPrefab'
        scripts/mainfunctions.lua(306,1) in function 'SpawnPrefab'
        scripts/mainfunctions.lua(323,1) in function 'SpawnSaveRecord'
        scripts/gamelogic.lua(557,1) in function 'PopulateWorld'
        scripts/gamelogic.lua(807,1) in function 'DoInitGame'
        scripts/gamelogic.lua(920,1) in function 'cb'
    ...
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(282,1) in function 'Load'
        scripts/gamelogic.lua(1150,1) in function 'callback'
        scripts/playerprofile.lua(1151,1) in function 'Set'
        scripts/playerprofile.lua(1002,1)
        =[C] in function 'GetPersistentString'
        scripts/playerprofile.lua(1000,1) in function 'Load'
        scripts/gamelogic.lua(1149,1) in main chunk
        =[C] in function 'require'
        scripts/mainfunctions.lua(952,1)    
[00:00:57]: Reconstructing topology    
[00:00:57]:     ...Sorting points    
[00:00:57]:     ...Sorting edges    
[00:00:57]:     ...Connecting nodes    
[00:00:57]:     ...Validating connections    
[00:00:58]:     ...Housekeeping    
[00:00:58]:     ...Done!    
[00:00:58]: 1 uploads added to server. From server_temp
[00:00:58]: Telling Client our new session identifier: 307ECD31C9379FB0
[00:00:58]: Check for write access: TRUE
[00:00:58]: Check for read access: TRUE
[00:00:58]: Available disk space for save files: I64u MB
[00:00:58]: ModIndex: Load sequence finished successfully.    
[00:00:58]: Reset() returning
[00:01:00]: Setting lobby region to default: US
[00:01:00]: Registering master server in US lobby
[00:01:01]: Warning: Widget:SetFocusFromChild is happening on a widget outside of the screen/widget hierachy. This will cause focus moves to fail. Is     ScriptErrorWidget    not a screen?    
[00:01:01]: stack traceback:
    scripts/widgets/widget.lua:605 in (method) SetFocusFromChild (Lua) <602-627>
    scripts/widgets/widget.lua:656 in (method) SetFocus (Lua) <629-665>
    scripts/widgets/scripterrorwidget.lua:107 in (method) OnUpdate (Lua) <102-119>
    scripts/update.lua:95 in () ? (Lua) <33-134>    
[00:01:10]: Warning: Widget:SetFocusFromChild is happening on a widget outside of the screen/widget hierachy. This will cause focus moves to fail. Is     ScriptErrorWidget    not a screen?    
[00:01:10]: stack traceback:
    scripts/widgets/widget.lua:605 in (method) SetFocusFromChild (Lua) <602-627>
    scripts/widgets/widget.lua:624 in (method) SetFocusFromChild (Lua) <602-627>
    scripts/widgets/widget.lua:624 in (method) SetFocusFromChild (Lua) <602-627>
    scripts/widgets/widget.lua:624 in (method) SetFocusFromChild (Lua) <602-627>
    scripts/widgets/widget.lua:656 in (method) SetFocus (Lua) <629-665>
    scripts/widgets/scripterrorwidget.lua:107 in (method) OnUpdate (Lua) <102-119>
    scripts/update.lua:95 in () ? (Lua) <33-134>    
[00:01:10]: Force aborting...
[00:01:10]: Removing server from US lobby
[00:01:10]: ModWorkshop::CancelDownloads clearing all unfinished downloads
[00:01:11]: Collecting garbage...
[00:01:11]: lua_gc took 0.19 seconds
[00:01:11]: ~ShardLuaProxy()
[00:01:11]: ~cEventLeaderboardProxy()
[00:01:11]: ~ItemServerLuaProxy()
[00:01:11]: ~InventoryLuaProxy()
[00:01:11]: ~NetworkLuaProxy()
[00:01:11]: ~SimLuaProxy()
[00:01:11]: ModWorkshop::CancelDownloads clearing all unfinished downloads
[00:01:11]: lua_close took 0.46 seconds
[00:01:11]: ModWorkshop::CancelDownloads clearing all unfinished downloads
[00:01:11]: [Steam] Auth ticket cancelled
[00:01:11]: Could not unload undefined prefab (brokenwall_stone_2)
[00:01:11]: Could not unload undefined prefab (brokenwall_ruins_2)
[00:01:12]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:01:12]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:01:12]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:01:12]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:01:12]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:01:12]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:01:12]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:01:12]: CurlRequestManager::ClientThread::Main() complete
[00:01:12]: HttpClient2 discarded 0 callbacks.
[00:01:12]: Shutting down

 

Ảnh chụp Màn hình 2020-11-24 lúc 17.44.20.png

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