Silane Posted November 7, 2013 Author Share Posted November 7, 2013 So images like this: Link to comment Share on other sites More sharing options...
Malacath Posted November 7, 2013 Share Posted November 7, 2013 So images like this: Not exactly, the background will be the hud so for the penguin and the slurtle you'll have to have transparency behind the images. The trap image is to big. And also, you don't have a custom trap yet anyways which could use that image. Link to comment Share on other sites More sharing options...
Silane Posted November 7, 2013 Author Share Posted November 7, 2013 The trap image was for the mod icon. Dunno if that would work though.... Link to comment Share on other sites More sharing options...
Malacath Posted November 7, 2013 Share Posted November 7, 2013 The trap image was for the mod icon. Dunno if that would work though.... Ahhh, i see ^^ Yes that would probably work, just try it.Now name them "penguin.png" and "slurtle.png" and put them in "images/inventoryimages/", you can put the modicon.png in "images/".Download "Don't Starve Mod Tools" from Steam and start the game.Done. Link to comment Share on other sites More sharing options...
Silane Posted November 7, 2013 Author Share Posted November 7, 2013 I can't seem to find the mod tools download on steam? And I keep getting this error when I try to enable the Better Traps mod. When I try to enable the mod tools I downloaded from the klei downloads it crashing the game? The current files:http://www.mediafire.com/download/1h7kxwrkgdbl59d/Better+Traps.zip Link to comment Share on other sites More sharing options...
Malacath Posted November 7, 2013 Share Posted November 7, 2013 In the steam library you'll have to find a dropdownmenu somewhere that let's you change from games to tools. There you'll find the mod tools. Link to comment Share on other sites More sharing options...
Silane Posted November 7, 2013 Author Share Posted November 7, 2013 Yay! And sooo close. >.< It caught the pengull and I picked the trap up but then it crashed. >.< http://www.mediafire.com/download/1h7kxwrkgdbl59d/Better+Traps.zip Link to comment Share on other sites More sharing options...
Malacath Posted November 7, 2013 Share Posted November 7, 2013 Can you tell me what the error screen says? The log.txt is in your documents folder Klei/dontstarve/ (I can't see images on my phone) Link to comment Share on other sites More sharing options...
Silane Posted November 7, 2013 Author Share Posted November 7, 2013 Nevermind. I was being an idiot again. XD (I can't spell apparently) Now for the next goal..... to make them give you loot when you murder them. >D Mwahahahaha! But for now it works and it does catch them so I am very happy. Thanks again everyone for the help! And your patience with me. Link to comment Share on other sites More sharing options...
Malacath Posted November 7, 2013 Share Posted November 7, 2013 Nice ^^I will surely be able to help you with that when I'm back home. In the meantime you can try yourself, everything you need will be in "rabbit.lua" Link to comment Share on other sites More sharing options...
Silane Posted November 7, 2013 Author Share Posted November 7, 2013 I think to get it to work I will need to use this code: inst:AddComponent("lootdropper")But it will need to be in it's own function..... Maybe only defined by it's inventory status? (Dunno) Interestingly enough, when a caught Pengull is set back down it does not join its flock. XD Other than it being odd it doesn't seem to affect gameplay. Link to comment Share on other sites More sharing options...
Malacath Posted November 7, 2013 Share Posted November 7, 2013 Interestingly enough slurtles already give you their loot when you murder them but penguins don't... I'll try to find out why. EDIT: I think it's just that penguins don't have a 100% chance to drop something. And I coincidentally always ended up with nothing. Link to comment Share on other sites More sharing options...
Silane Posted November 7, 2013 Author Share Posted November 7, 2013 Really? That's awesome. Saves us one thing of having to do. XD (Don't have a file with cave access currently and not willing to use debug spawns) Link to comment Share on other sites More sharing options...
Malacath Posted November 7, 2013 Share Posted November 7, 2013 Get _simplex_testing, it's the fastest thing to use for that. You only need to write gimme("slurtle") in the console. And I don't see a reason not to use it ; ) And when you don't want anything you hover over the penguin and press "CTRL"+"K" and it dies. Just remember to disable it when you want to play serious. @simplex On that note, someone uploaded _simplex_testing on Steam Workshop, is that fine for you or did he even ask you? Link to comment Share on other sites More sharing options...
Silane Posted November 7, 2013 Author Share Posted November 7, 2013 That's rather awesome and helpful. Thanks. On discovering that! It seems the traps do not work on Snurtles.... just the Slurtles and penguins, and when a penguin is caught/murdered no loot item. Would I have to make another function block for the snurtle as well as the inventory image? (Only reason I ask is because there is no actual prefab for snurtles, only for the slurtles.) Link to comment Share on other sites More sharing options...
Malacath Posted November 7, 2013 Share Posted November 7, 2013 On discovering that! It seems the traps do not work on Snurtles.... just the Slurtles and penguins, and when a penguin is caught/murdered no loot item.I wrote further up that loot for penguins has only a chance of 10% to drop (I might not have mentioned this number). The same goes right now for murdering it in the inventory. Would I have to make another function block for the snurtle as well as the inventory image? (Only reason I ask is because there is no actual prefab for snurtles, only for the slurtles.)Yes, you'd have to do another function. It's not true that there is no snurtle prefab, there might not be a seperate file for it but there is a prefab. One file can return as many prefabs as you want and slurtle.lua does thatreturn Prefab("cave/slurtle", makeslurtle, assets, prefabs), Prefab("cave/snurtle", makesnurtle, assets, prefabs) EDIT: You can use the follwinf modmain which is a bit more compact. But it's also more rigid so you need to consider for yourself:local function ModPrefab(inst) inst:AddTag("canbetrapped") inst:AddComponent("inventoryitem") inst.components.inventoryitem.canbepickup = false inst.components.inventoryitem.imagename = inst.prefab inst.components.inventoryitem.atlasname = "images/inventoryimages/"..inst.prefab..".xml"endAddPrefabPostInit("penguin", ModPrefab)AddPrefabPostInit("slurtle", ModPrefab)This way you can use the same function for all prefabs you want to modify. Link to comment Share on other sites More sharing options...
Silane Posted November 7, 2013 Author Share Posted November 7, 2013 Oh! I did not know about the loot % on Penguins... I may have to do something about that later. But I have added the code for the snurtle file and tested it. So I will be uploading that post haste. I'll have to keep that in mind about multiple prefabs in files though. Yup, yup. Link to comment Share on other sites More sharing options...
Silane Posted November 9, 2013 Author Share Posted November 9, 2013 ...................... I just found out. Now traps are useless as this makes it so you can just pickup the creature? There is a line that says: inst.components.inventoryitem.canbepickup = falseShouldn't that cancel being able to pick them up? Also! Changed the mod to allow frogs to be trapped/picked up as living inventory items. But the same does not work for making a spider an inventory item? And then to make the stackable as inventory items I believe I would need to use the: inst:AddComponent("stackable") But would I set them up as separate functions to the traps? (I believe so, just asking) And than about changing the chance of loot dropped by creatures, is there a way to only set an increase of loot as an inventory item? Link to comment Share on other sites More sharing options...
Malacath Posted November 9, 2013 Share Posted November 9, 2013 ...................... I just found out. Now traps are useless as this makes it so you can just pickup the creature? There is a line that says: inst.components.inventoryitem.canbepickup = falseShouldn't that cancel being able to pick them up?Uhhhh yes, it should o.0This is straight copy-paste from "rabbit.lau" so it should definately work. You can also see the typo xDinst.components.inventoryitem.canbepickedup = falseAlso! Changed the mod to allow frogs to be trapped/picked up as living inventory items. But the same does not work for making a spider an inventory item?Sweet ^^I think this technique should work for all mobs, no clue why it doesn't for spiders...And then to make the stackable as inventory items I believe I would need to use the: inst:AddComponent("stackable") But would I set them up as separate functions to the traps? (I believe so, just asking)In a single AddPrefabPostInit you can change as many things as you want about the prefab. I.e. change stategraphs or brains, remove components....So you can use the same function. But when you use one function for multiple prefabs you need to be careful that all changes are valid for all those prefabs. I would for example not use the current function for rabbits to add the stackable component because you would also add things that rabbits already have and change the path to its inventoryimage and so on. So just be careful what you change wiith the functions.At the same time you can run as many AddPrefabPostInit functions for a single prefab as you want. So you can add an additional on just for the penguin to modify loot.And than about changing the chance of loot dropped by creatures, is there a way to only set an increase of loot as an inventory item? It is definately possible. But it involves a bit more code. I can give you a rough outline of the process though.Listen for the event "death" on the penguin, check if the penguin iis held via inventoryitem:IsHeld() and in the case it is you can add your custom loot to the killer. Link to comment Share on other sites More sharing options...
Silane Posted November 9, 2013 Author Share Posted November 9, 2013 That fixed the picking up/and trapping issue thanks Malacath. However now when it catches a frog the frog is simply disappearing? Is this possibly due to the fact that they are already trappable? The full section on the rabbit prefab is this:inst.components.inventoryitem.nobounce = trueinst.components.inventoryitem.canbepickedup = falseinst.components.inventoryitem:SetOnPickupFn(onpickup)inst.components.inventoryitem:SetOnDroppedFn(ondrop)Should I make use of the other 3 lines as well? Note that this is only happening when a spider or frog gets trapped with the current coding... Link to comment Share on other sites More sharing options...
Malacath Posted November 9, 2013 Share Posted November 9, 2013 That fixed the picking up/and trapping issue thanks Malacath. However now when it catches a frog the frog is simply disappearing? Is this possibly due to the fact that they are already trappable? The full section on the rabbit prefab is this:inst.components.inventoryitem.nobounce = trueinst.components.inventoryitem.canbepickedup = falseinst.components.inventoryitem:SetOnPickupFn(onpickup)inst.components.inventoryitem:SetOnDroppedFn(ondrop)Should I make use of the other 3 lines as well?Note that this is only happening when a spider or frog gets trapped with the current coding...It worked before adding the "canbepickedup" line? Link to comment Share on other sites More sharing options...
Silane Posted November 9, 2013 Author Share Posted November 9, 2013 Yup. Before I changed the "canbepick/edup" thing the frog was able to be trapped and become a whole inventory item that is murder-able. ;P Not the spider though. (But you could also just run over and pick the dang frog up. >.< ) Link to comment Share on other sites More sharing options...
Malacath Posted November 9, 2013 Share Posted November 9, 2013 I have no clue, sorry. I took a quick glance over the prefabs of the spider and the frog but didn't see anything intriguing. Maybe you can find something when you look careful enough.In the hopes that I don't forget to I will take a closer look at a later point in time. Link to comment Share on other sites More sharing options...
Silane Posted November 9, 2013 Author Share Posted November 9, 2013 That's okay. You have been more than helpful enough! Link to comment Share on other sites More sharing options...
Silane Posted November 9, 2013 Author Share Posted November 9, 2013 Tested the code change to make them stackable, only on the penguins though, and it works! Stackable up to 10. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.