SenL Posted February 15, 2015 Share Posted February 15, 2015 (edited) I finally made my first trap mod. Phew that was hard. Link: http://steamcommunity.com/sharedfiles/filedetails/?id=392879002 Spear Trap works just like tooth trap except:-more, hard to get ingredients-why? because the trap lasts forever Trap does same damage and still needs to be reset.Craft it at the "Fight" (war) recipe tab.Requires science machine to prototype. Ingredients: spear (duh), log, rope and gearQuantity depends on config setting. Now a question for those who know, how do I make this config differently, example:"Easy" = spear(1), log(1)"Normal" = spear(4), log(4), rope(4), gears(2)"Hard" = spear(4), log(8), rope(8), gears(4)"VHard" = spear(4), gears(4), purplegem(1), nightmarefuel(20) I tried and failed many times.Current code in modmain (that works):local recipes = { Recipe("speartrap" ,{Ingredient("spear",GetModConfigData("SpearTrap_SpearCount")) ,Ingredient("log",GetModConfigData("SpearTrap_LogCount")) ,Ingredient("gears",GetModConfigData("SpearTrap_GearsCount")) ,Ingredient("rope",GetModConfigData("SpearTrap_RopeCount")) } ,RECIPETABS.WAR ,{SCIENCE=1} )} for k,v in pairs(recipes) dov.tagneeded = falsev.atlas = "images/inventoryimages/" .. v.name .. ".xml"end I tried using if ... then, like this:local recipes_easy = { Recipe(... recipes_easy.tagneeded = falserecipes_easy.atlas = "images/inventoryimages/speartrap.xml" local recipes_normal = { Recipe(... recipes_normal.tagneeded = falserecipes_normal.atlas = "images/inventoryimages/speartrap.xml" But it crashes on texture being nil.Any help is appreciated. BTW: Yes, that is Groot in the preview/screenshothttp://steamcommunity.com/sharedfiles/filedetails/?id=391743403 Edited February 15, 2015 by SenL Link to comment https://forums.kleientertainment.com/forums/topic/50994-mod-release-spear-trap/ Share on other sites More sharing options...
polygone Posted February 16, 2015 Share Posted February 16, 2015 (edited) I feel like you should raise the damage at least a little. Gears aren't renewable, and between fridges and upgrading a wx character they're a lot more valuable than a neverending trap that you'd still have to reset anyways. Tooth traps last quite a while, and the materials are fairly easy to get since you could kill hounds with a set of tooth traps to get more teeth to make more tooth traps. It just doesn't seem worth it to make, especially on Vhard since you'd have to dig up a ton of graves to refine a purple gem, which while technically renewable you'd have to kill a lot of fire and ice hounds to do so. And by that point you'd have hound teeth out the butt anyways. As for your issue with how to set up the config, here's a snippet from one of mine that could help:local easy = (GetModConfigData("generatorrecipe")=="easy") if easy thenlocal ec_generator = GLOBAL.Recipe("ec_generator",{ Ingredient("cutstone", 3), Ingredient("rope", 2), Ingredient("gears", 1), Ingredient("rabbit", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_TWO, "ec_generator_placer") ec_generator.atlas = "images/inventoryimages/ec_generator.xml" else local ec_generator = GLOBAL.Recipe("ec_generator",{ Ingredient("cutstone", 4), Ingredient("rope", 2), Ingredient("rabbit", 1), Ingredient("gears", 2), Ingredient("redgem", 1)}, RECIPETABS.SCIENCE, TECH.SCIENCE_TWO, "ec_generator_placer") ec_generator.atlas = "images/inventoryimages/ec_generator.xml" endThe top one goes in modmain.lua, bottom in modinfo.lua. And of course you could add more options by using a chain of 'else if's.configuration_options ={ { name = "generatorrecipe", label = "Advanced Generator Recipe", options = { {description = "Easy", data = "easy"}, {description = "Hard", data = "hard"}, }, default = "easy", },} e/ Instead of increasing the damage you could have the traps auto reset each day or something along that line. That would at least justify the use of gears, seeing as it'd have a mechanical aspect to it. Edited February 16, 2015 by polygone Link to comment https://forums.kleientertainment.com/forums/topic/50994-mod-release-spear-trap/#findComment-613447 Share on other sites More sharing options...
SenL Posted February 16, 2015 Author Share Posted February 16, 2015 Wow thanks I'll try that code. About the damage... well this one lasts forever, that's why I kept the dmg same as tooth trap.Also there are "craftable gears", etc... but I guess you have a point. I'll see what I can do. Thanks again! Link to comment https://forums.kleientertainment.com/forums/topic/50994-mod-release-spear-trap/#findComment-613719 Share on other sites More sharing options...
polygone Posted February 17, 2015 Share Posted February 17, 2015 No problem, but lasting forever isn't that great of a trait considering you still have to reset the trap manually. Kill two or three hound waves and you have enough teeth to make a nice array of tooth traps. Use those traps to kill the next hound wave and then you have five more traps, next wave you have five more and so on. The tooth traps may wear out, but they have plenty of uses to make up for the fact/can help you farm materials to get more and so on. Just having this last forever means you get more teeth building up. I guess you could make sewing kits and dapper vests with it but why would you need that many? Link to comment https://forums.kleientertainment.com/forums/topic/50994-mod-release-spear-trap/#findComment-614097 Share on other sites More sharing options...
SenL Posted February 18, 2015 Author Share Posted February 18, 2015 Thanks for the valuable feedback. I made it auto-resets in 3 seconds!Maybe then someone can be a different mod that uses hound's tooth for ... "teeth pie" lol. Link to comment https://forums.kleientertainment.com/forums/topic/50994-mod-release-spear-trap/#findComment-614180 Share on other sites More sharing options...
polygone Posted February 18, 2015 Share Posted February 18, 2015 Actually I was planning on figuring out what the most useless items in the game are (hi bee stingers) and turn them into things that are actually useful like weapons and buildings. Then again leaving a ton of 'useless' items around on the ground to distract Krampus is always a valid strategy. xD Found the trap in the workshop, sounds well worth it now for the gears. Auto resetting deathtraps yay. Also neat idea with wooden flooring instead of logs. Makes sense. Link to comment https://forums.kleientertainment.com/forums/topic/50994-mod-release-spear-trap/#findComment-614230 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