Amonarka Posted January 26, 2015 Share Posted January 26, 2015 Hey, I'm starting to mod Don't Starve. So for my learning phase, i want to create very simple mods. Despide of that, I'm still able to have bugs I created a mod to craft butterfly. It work well, but i discovered that wild butterfly now drop the ingredients of my reciep ! I don't know why and i want to change that, if anyone can help me. And i have another bug for this mod : for now, my butterfly doesn't require any machine to be crafted (TECH.NONE). I want to use the prestihatitator. So i'm using the fuction TECH.MAGIC_ONE. It work well on DS RoG but crash on DST... I thank you for your help and i appologize for my bad english. Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/ Share on other sites More sharing options...
SenL Posted January 26, 2015 Share Posted January 26, 2015 I'm also new. I think we need more info. What are the ingredients, show us snippet of code and also the crash log file. Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-606192 Share on other sites More sharing options...
Amonarka Posted January 26, 2015 Author Share Posted January 26, 2015 I use this code :Recipe("butterfly", {Ingredient("twigs", 1),Ingredient("berries", 2),Ingredient("cutgrass",2)}, RECIPETABS.FARM, TECH.NONE)It work well, without any crash. I haven't any problem with other item recipes. But the fact is that butterfly is killable. So, when I kill a butterfly with my mod, i get 1 twig, 1 berrie and 1 cut grass everytime + the usual loot (butterflywings or butter). I can change the loot table for butterfly on my mod, it work too. Except, i'll get the loot i asked on my mod + the ingredients of my recipe... So, i need a fuction to remove theses loots. Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-606244 Share on other sites More sharing options...
rezecib Posted January 26, 2015 Share Posted January 26, 2015 @Amonarka, I'm 99% sure that shouldn't be happening... Can we see the whole mod? Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-606247 Share on other sites More sharing options...
Amonarka Posted January 26, 2015 Author Share Posted January 26, 2015 (edited) STRINGS = GLOBAL.STRINGSRECIPETABS = GLOBAL.RECIPETABSRecipe = GLOBAL.RecipeIngredient = GLOBAL.IngredientTECH = GLOBAL.TECHSTRINGS.RECIPE_DESC.BUTTERFLY = "An unborn flower."Recipe("butterfly", {Ingredient("twigs", 1),Ingredient("berries", 2),Ingredient("cutgrass",2)}, RECIPETABS.FARM, TECH.NONE)Nothing else on my mod. I deleted the part with the loot table because that did not solve my problem. It's on the workshop if you want to try : Butterfly Effigy. Edited January 26, 2015 by Amonarka Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-606250 Share on other sites More sharing options...
rezecib Posted January 26, 2015 Share Posted January 26, 2015 @Amonarka, Okay, looks like lootdropper has the call to the recipe table pretty embedded. However, it looks like it also checks the finiteuses component, so you could try doing this:AddPrefabPostInit("butterfly", function(inst) if GLOBAL.TheWorld.ismastersim then inst:AddComponent("finiteuses") inst.components.finiteuses:SetPercent(0) endend)This might display a percent on the butterfly, though... Another approach you could use would be creating another prefab as a proxy, which upon being given to the player, gets replaced with a butterfly. That would be harder to do, though. Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-606288 Share on other sites More sharing options...
Amonarka Posted January 26, 2015 Author Share Posted January 26, 2015 This for your advice rezecib, I'm gonna try this. Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-606304 Share on other sites More sharing options...
Amonarka Posted January 27, 2015 Author Share Posted January 27, 2015 (edited) I's working !! Really thx rezecib ! [EDIT] Okay, and for the magic machine, on DST, TECH.MAGIC_ONE is remplaced by TECH.MAGIC_TWO... >< Edited January 27, 2015 by Amonarka Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-606482 Share on other sites More sharing options...
SenL Posted January 27, 2015 Share Posted January 27, 2015 So, making butterfly a "finiteuse" fix the issue (of it dropping recipe ingredients)?How come? So now when you kill a butterfly, what do you get? Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-606566 Share on other sites More sharing options...
rezecib Posted January 27, 2015 Share Posted January 27, 2015 (edited) @SenL, Look at the lootdropper component. It checks if there's a recipe for something, and drops a percentage of its ingredients (rounded up) based on the percentage (through finiteuses). I'm guessing it's used by the deconstruction staff. Edited January 27, 2015 by rezecib Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-606577 Share on other sites More sharing options...
Amonarka Posted January 27, 2015 Author Share Posted January 27, 2015 A butterfly drop their normal loot now. Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-606613 Share on other sites More sharing options...
Amonarka Posted January 28, 2015 Author Share Posted January 28, 2015 (edited) Mhhh, now i have a 0% under my butterfly... It's... funny => finiteuses:SetPercent(0) Edited January 28, 2015 by Amonarka Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-606939 Share on other sites More sharing options...
rezecib Posted January 28, 2015 Share Posted January 28, 2015 @Amonarka, Yeah, I thought that might happen... I think the only way around it would be to make it so you craft a proxy prefab, which then removes itself and gives the player a butterfly. Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-607145 Share on other sites More sharing options...
Maris Posted January 28, 2015 Share Posted January 28, 2015 @rezecib, it can be done easier than making prefab. For example, injecting in component. Actually it's already done. Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-607170 Share on other sites More sharing options...
rezecib Posted January 28, 2015 Share Posted January 28, 2015 @rezecib, it can be done easier than making prefab. For example, injecting in component. Actually it's already done. I'm not sure I understand. The problem here is that adding a recipe for butterflies directly causes the ingredients to be added to the butterfly's loot drops. If you're not changing the recipe to craft a non-butterfly prefab that transforms, how else would you get around that? I'm not sure what you mean by "injecting in component". Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-607179 Share on other sites More sharing options...
Maris Posted January 28, 2015 Share Posted January 28, 2015 @rezecib, "injecting" or "hook" means AddComponentPostInit (for example). If you are wondering, download the mod. This had been done about an hour ago. Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-607194 Share on other sites More sharing options...
SenL Posted January 28, 2015 Share Posted January 28, 2015 Download which mod? Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-607196 Share on other sites More sharing options...
rezecib Posted January 28, 2015 Share Posted January 28, 2015 (edited) @Maris, Yes.... In this mod it was done because I suggested doing it (did you read the thread, lol?). But what I was talking about was the fact that now butterflies display "0%". I was saying that to get around that, you probably need a proxy prefab. Edited January 28, 2015 by rezecib Link to comment https://forums.kleientertainment.com/forums/topic/49765-craftable-butterfly-why-wild-butterfly-drop-the-ingredients-of-my-reciep/#findComment-607213 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