Jump to content

Recommended Posts

In your modmain.lua:

AddPrefabPostInit("krampus_sack", function(inst)	inst.components.inventoryitem.cangoincontainer = trueend)

In your character.lua:

local start_inv = { "krampus_sack",}

Although that will make it so everyone can put the krampus sack in their inventories instead of it dropping on the ground. Not that big of a deal, considering how rare it is.

In your modmain.lua:

AddPrefabPostInit("krampus_sack", function(inst)	inst.components.inventoryitem.cangoincontainer = trueend)

In your character.lua:

local start_inv = { "krampus_sack",}

Although that will make it so everyone can put the krampus sack in their inventories instead of it dropping on the ground. Not that big of a deal, considering how rare it is.

 

 Apparently I did so, it worked on a offline server and while I am the host, but when I used it as client, this is what I received

post-688791-0-64513400-1443991356_thumb.

@halfrose:

AddPrefabPostInit("krampus_sack", function(inst)    if not GLOBAL.TheWorld.ismastersim then return end    inst.components.inventoryitem.cangoincontainer = trueend)

Because clients run the postinit because they also load the mod because it's a character mod.

 

 

Also, I suggest:

	inst.OnNewSpawn = function(inst)		local sack = SpawnPrefab("krampus_sack")		inst.components.inventory:Equip(sack)	end

in the master_postinit of the mod character, so the backpack retains its backpack properties.

@halfrose:

AddPrefabPostInit("krampus_sack", function(inst)    if not GLOBAL.TheWorld.ismastersim then return end    inst.components.inventoryitem.cangoincontainer = trueend)

Because clients run the postinit because they also load the mod because it's a character mod.

 

 

Also, I suggest:

	inst.OnNewSpawn = function(inst)		local sack = SpawnPrefab("krampus_sack")		inst.components.inventory:Equip(sack)	end

in the master_postinit of the mod character, so the backpack retains its backpack properties.

 

Oh thanks it is working fine now! dude you are really good at coding!

Any update to this?

I tried it today, and after going to the Character Selection screen, the game stalls out loading the world.

It doesn't crash, it's fully responsive when I move the window around, but it sticks on the pale yellow gradient that is used as a backdrop. 

It just sits there indefinitely.

 

Any one else having that issue?

I don't know enough about this stuff to try and change it myself.  

Any update to this?

I tried it today, and after going to the Character Selection screen, the game stalls out loading the world.

It doesn't crash, it's fully responsive when I move the window around, but it sticks on the pale yellow gradient that is used as a backdrop. 

It just sits there indefinitely.

 

Any one else having that issue?

I don't know enough about this stuff to try and change it myself.  

 

Nevermind! 

 

I moved the modmain piece from the bottom of the lua to the top, and it works perfectly.

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