Eranthis Posted March 18, 2018 Share Posted March 18, 2018 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? Link to comment https://forums.kleientertainment.com/forums/topic/88832-custom-item-randomly-generated-in-world/ Share on other sites More sharing options...
Lumina Posted March 19, 2018 Share Posted March 19, 2018 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 ? Link to comment https://forums.kleientertainment.com/forums/topic/88832-custom-item-randomly-generated-in-world/#findComment-1016906 Share on other sites More sharing options...
Eranthis Posted March 21, 2018 Author Share Posted March 21, 2018 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. Link to comment https://forums.kleientertainment.com/forums/topic/88832-custom-item-randomly-generated-in-world/#findComment-1017844 Share on other sites More sharing options...
IronHunter Posted March 21, 2018 Share Posted March 21, 2018 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. Link to comment https://forums.kleientertainment.com/forums/topic/88832-custom-item-randomly-generated-in-world/#findComment-1017858 Share on other sites More sharing options...
Eranthis Posted March 21, 2018 Author Share Posted March 21, 2018 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. Link to comment https://forums.kleientertainment.com/forums/topic/88832-custom-item-randomly-generated-in-world/#findComment-1017959 Share on other sites More sharing options...
IronHunter Posted March 22, 2018 Share Posted March 22, 2018 (edited) 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 March 22, 2018 by IronHunter Clarification Link to comment https://forums.kleientertainment.com/forums/topic/88832-custom-item-randomly-generated-in-world/#findComment-1017983 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now