Jump to content

Can't pick up chester bone and can't open it


Recommended Posts

To make your character unable to open chester we simply need to remove the component which makes him work as a chest. (that would be the "container" component.)
So again, just like with the food, we will alter chester by using the AddPrefabPostInit in your modmain.lua and we will also need to remove the tag "chester" from it to avoid complications with the eyebone.
    
    AddPrefabPostInit("chester", function(inst)
        if GetPlayer().prefab == "YourCharacterHere" then            
            inst:RemoveComponent("container")
            inst:RemoveTag("chester")
        end
    end)

Now your character shouldn't be able to open up chester.
As for the inventory of your character to work like a fridge, is a very simple solution. We simply need to add the tag "fridge" to it.
Go to your character's prefab file and add this somewhere along with your character's stats.

    inst:AddTag("fridge")
    
Now any item in your character's inventory should spoil at the same rate as if it would be inside the fridge.
    
Ok So... 
Now as for the chester's eyebone... that was a little bit tricky. Normaly we would be able to simply remove from the item the component which makes it pickable (which is the "inventoryitem" component) but the problem is that the eyebone is programmed to keep on calling for the inventoryitem component and crushing the game. BUT! I found a solution! XD 
I'm not sure if there is an easier way of doing this, but if there won't be anybody else to enlighten us both, then I guess you can give it a try XD lol.
We will need to mod/alter the eyebones prefab file.
(And no worries, we won't touch the original one, we will work on a copy instead)
I'll try to lay it down simply xD

Step 1:
    - Go to the folder of the Don't starve game.
    - Then go to the folder: data >> scripts >> prefabs
    - Find the prefab file "chester_eyebone" and copy it.
    
Step 2:
    - Go to the folder of your mod that you're working on.
    - In the folder "scripts" create a new folder named "prefabs" (if you don't have one)
    - Paste the copy of the "chester_eyebone" file in there.
    - Open the copied prefab file and go to the line 253
    - Then simply turn off the function which keeps crushing the game by adding "--" in front of it
      So basically change the:
        inst.fixtask = inst:DoTaskInTime(1, function() FixChester(inst) end)
      to
        --inst.fixtask = inst:DoTaskInTime(1, function() FixChester(inst) end)
    - Then just save the file.
    
Step 3: 
    - Head to your modmain.lua and add into the PrefabFiles the moded eyebone. Like so:
        PrefabFiles = { "chester_eyebone" }


    - And also add into your modmain.lua
    
        AddPrefabPostInit("chester_eyebone", function(inst)
            if GetPlayer().prefab == "YourCharacterHere" then
                inst:RemoveComponent("inventoryitem")
            end
        end)
        
    (This is just so we wouldn't need to look for each line that calls the "inventoryitem" component inside the main function)

I'm sorry if this was too much step-by-step explanation. I do not know how experienced you are with coding ^^;      
But hey! We are done! XD now your character shouldn't be able to pick up the eyebone and the game shouldn't crush!
(The only bad thing about doing it like this, is that now none of the other character's will be able to pick the eyebone up neither for as long as you have your mod turned on xD; )
But I still hope that this helped you in any way possible xD

Link to comment
Share on other sites

4 hours ago, BraveChicken said:

To make your character unable to open chester we simply need to remove the component which makes him work as a chest. (that would be the "container" component.)
So again, just like with the food, we will alter chester by using the AddPrefabPostInit in your modmain.lua and we will also need to remove the tag "chester" from it to avoid complications with the eyebone.
    
    AddPrefabPostInit("chester", function(inst)
        if GetPlayer().prefab == "YourCharacterHere" then            
            inst:RemoveComponent("container")
            inst:RemoveTag("chester")
        end
    end)

Now your character shouldn't be able to open up chester.
As for the inventory of your character to work like a fridge, is a very simple solution. We simply need to add the tag "fridge" to it.
Go to your character's prefab file and add this somewhere along with your character's stats.

    inst:AddTag("fridge")
    
Now any item in your character's inventory should spoil at the same rate as if it would be inside the fridge.
    
Ok So... 
Now as for the chester's eyebone... that was a little bit tricky. Normaly we would be able to simply remove from the item the component which makes it pickable (which is the "inventoryitem" component) but the problem is that the eyebone is programmed to keep on calling for the inventoryitem component and crushing the game. BUT! I found a solution! XD 
I'm not sure if there is an easier way of doing this, but if there won't be anybody else to enlighten us both, then I guess you can give it a try XD lol.
We will need to mod/alter the eyebones prefab file.
(And no worries, we won't touch the original one, we will work on a copy instead)
I'll try to lay it down simply xD

Step 1:
    - Go to the folder of the Don't starve game.
    - Then go to the folder: data >> scripts >> prefabs
    - Find the prefab file "chester_eyebone" and copy it.
    
Step 2:
    - Go to the folder of your mod that you're working on.
    - In the folder "scripts" create a new folder named "prefabs" (if you don't have one)
    - Paste the copy of the "chester_eyebone" file in there.
    - Open the copied prefab file and go to the line 253
    - Then simply turn off the function which keeps crushing the game by adding "--" in front of it
      So basically change the:
        inst.fixtask = inst:DoTaskInTime(1, function() FixChester(inst) end)
      to
        --inst.fixtask = inst:DoTaskInTime(1, function() FixChester(inst) end)
    - Then just save the file.
    
Step 3: 
    - Head to your modmain.lua and add into the PrefabFiles the moded eyebone. Like so:
        PrefabFiles = { "chester_eyebone" }


    - And also add into your modmain.lua
    
        AddPrefabPostInit("chester_eyebone", function(inst)
            if GetPlayer().prefab == "YourCharacterHere" then
                inst:RemoveComponent("inventoryitem")
            end
        end)
        
    (This is just so we wouldn't need to look for each line that calls the "inventoryitem" component inside the main function)

I'm sorry if this was too much step-by-step explanation. I do not know how experienced you are with coding ^^;      
But hey! We are done! XD now your character shouldn't be able to pick up the eyebone and the game shouldn't crush!
(The only bad thing about doing it like this, is that now none of the other character's will be able to pick the eyebone up neither for as long as you have your mod turned on xD; )
But I still hope that this helped you in any way possible xD

wow thanks again. I can't feel my brain anymore but thanks again.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...