Jump to content

Recommended Posts

As the title explains it. I have a custom backpack item that I've noticed appears in randomly generated worlds at least once unintentionally. The item is suppose to be uniquely crafted by a custom character and having one spawn in a world for others to use kind of ruins its uniqueness. To make things worse, the backpack also spawns in oceans beyond land limitations. Does anyone know what strings causes it to randomly generate?

On 3/19/2018 at 10:34 AM, Lumina said:

Without the code, it's not possible to tell. Look at your code searching for the occurence of the "name of your backpack" to see what could spawn it ?

I wouldn't know what code is causing it to generate in the world. It's not very obviously stated.

After a quick look at your mod on the workshop,

I noticed you still have the healthkit in your starting inventory, this is likely the cause of the issue

local start_inv = {"healthkit"}

Because the item can't go into containers we had to make that work around from another thread. The item still technically spawns but, it won't auto equip as it is trying to go into your hotbar which it can't.

4 hours ago, IronHunter said:

After a quick look at your mod on the workshop,

I noticed you still have the healthkit in your starting inventory, this is likely the cause of the issue


local start_inv = {"healthkit"}

Because the item can't go into containers we had to make that work around from another thread. The item still technically spawns but, it won't auto equip as it is trying to go into your hotbar which it can't.

Well that's a shame. Weird that it makes a duplicate randomly placed into the world. I might have to cut the starting code if it means resolving the item issue.

8 hours ago, Eranthis said:

Well that's a shame. Weird that it makes a duplicate randomly placed into the world. I might have to cut the starting code if it means resolving the item issue.

Take note right now you are spawning the item twice right now, I don't think I made that clear. One from your starting inventory which is unneccessary and one from your newspawn function which is what you want to keep.

Just want to make that clear.

The newspawn function is a workaround for your backpack to spawn equipped in your inventory.

If you remove the healthkit from your starting inventory it should resolve the issue. As it is the only other source of spawning it I have found in your code.

Edit:

I noticed you updated your mod, but you commented out the newspawn function. You only needed to remove the healthkit from the starting inventory not the newspawn function. As that should work fine.

Edited by IronHunter
Clarification

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