pantacle Posted November 13, 2024 Share Posted November 13, 2024 Finding the cause is really a headache for me, even if it's not harmful (maybe) The character I created caused the world to drop "2 butterfly wings" when someone killed a butterfly. Whether my custom character was used or not. But I removed the code that caused the "double loot". Why did it happen? A little contradictory. My goal is to make the "double loot" controllable. And know where the code is. Previously used codes Quote local function onkilled(inst, data) local victim = data.victim if victim~= nil and victim:HasTag("monster") then data.victim.components.lootdropper:DropLoot() end end under master_postinit Quote inst:ListenForEvent("killed", onkilled) I'm not sure if it's related because I deleted it. Sorry for my weird language. testpantacle.rar Link to comment https://forums.kleientertainment.com/forums/topic/160649-what-happened-to-my-character/ Share on other sites More sharing options...
yanecc Posted November 14, 2024 Share Posted November 14, 2024 In your main/lootdrop_api.lua, the LootDropper:GenerateLoot() method of the lootdropper component has been modified, which causes any character to receive double the loot. You can enter c_announce(TUNING.TESTPANTACLE_EXTRADROP) in the console to confirm that the modification to these components is still in effect. 1 Link to comment https://forums.kleientertainment.com/forums/topic/160649-what-happened-to-my-character/#findComment-1757037 Share on other sites More sharing options...
pantacle Posted November 14, 2024 Author Share Posted November 14, 2024 (edited) 3 hours ago, yanecc said: In your main/lootdrop_api.lua, the LootDropper:GenerateLoot() method of the lootdropper component has been modified, which causes any character to receive double the loot. You can enter c_announce(TUNING.TESTPANTACLE_EXTRADROP) in the console to confirm that the modification to these components is still in effect. Thank you for replying to me. Ah yes I forgot it too but this is not it. I used the command you told me and it did not find it and later I tried deleting the main folder but it is still the same. It seems like this only happens to butterflies. Edited November 14, 2024 by pantacle Link to comment https://forums.kleientertainment.com/forums/topic/160649-what-happened-to-my-character/#findComment-1757050 Share on other sites More sharing options...
pantacle Posted November 27, 2024 Author Share Posted November 27, 2024 (edited) I've found a problem. It's because I made a crafting recipe, addrecipe, addrecipe 2 or GLOBAL.Recipe butterfly Therefore, unusual errors like double drops occur. I found the reason why butterfly droploot 2x, but I don't understand why that is. It's because I created a recipe for crafting butterflies to come back to life. ``` AddRecipe2("butterfly", { GLOBAL.Ingredient("butterflywings", 2), GLOBAL.Ingredient(GLOBAL.CHARACTER_INGREDIENT.HEALTH, 25), }, GLOBAL.TECH.NONE, { product = "butterfly", builder_tag = "panda", numtogive = 1 }, { "CHARACTER" } ) ``` Edited November 27, 2024 by pantacle Link to comment https://forums.kleientertainment.com/forums/topic/160649-what-happened-to-my-character/#findComment-1762627 Share on other sites More sharing options...
ClumsyPenny Posted November 27, 2024 Share Posted November 27, 2024 Any prefab that has a recipe that matches in name to its prefab name will drop half the recipe ingredients as its loot, that's how it works for craftable structures for example. This is likely what's also happening here. The solution is simple, simply rename your recipe. You already have the product as "butterfly", so the recipe will return a Butterfly just fine even if the name doesn't match. Link to comment https://forums.kleientertainment.com/forums/topic/160649-what-happened-to-my-character/#findComment-1763080 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