Jump to content

Spar10

Member
  • Posts

    15
  • Joined

  • Last visited

Everything posted by Spar10

  1. I published my fist release of 'ST Survival Tailor' to the Steam Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=2755409154 I know there are already a few other tailoring mods that do some similar things, but I did not feel they were balanced especially how much thread you get from them. I've add some custom bags you can craft as well as most of the general material recipes you might need to improve tailoring. My hope for this mod is to make tailoring a worthwhile skill and add in more functionality as I progress. I would also like some feedback on how the items and recipes are balanced. I'm trying to keep the balance close to vanilla and not create items that are too good for an Apocalypse run. The Large Utility Pack and Utility Satchel are nice items, but you can only craft them once you get to skill 3 and 5. MOD Details: Craftable items: + Crude Backpack - Requires Tailoring 0 - Weight=1.5, Cap=16, Reduction = 50 - Equipable on back and hands - Uses custom icon and texture + Utility Pack Small - Requires Tailoring 1 - Weight=0.2, Cap=2, Reduction = 75 - Equipable in fanny pack slots - Uses custom icon + Denim Backpack - Requires Tailoring 2 - Weight=0.8, Cap=18, Reduction = 75 - Equipable on back and hands - Uses vanilla blue school bag icon/texture + Utility Pack Large - Requires Tailoring 3 - Weight=0.5, Cap=5, Reduction = 75 - Equipable in fanny pack slots - Uses custom icon + Utility Satchel - can be equipped with backpack - Requires Tailoring 5 - Weight=0.5, Cap=15, Reduction = 75 - Equipable only on fanny pack back slot - Uses vanilla satchel icon/texture Material recipes: + Salvage Ripped Sheets (for Thread) -Takes 5 Ripped Sheets, requires one tool: Paperclip/Tweezers/Needle/Suture Needle -Creates Thread (Results based on Tailoring skill) -Each ripped sheet can generate 2 thread units, with a possible 10 units = single full Thread spool + Salvage Denin Strips (for Thread) -Similar to Salvage Ripped Sheets, but takes Denim Strips + Twist Thread into Twine + Unravel Twine + Twist Twine into Rope + Unravel Rope + Craft Sheet Rope + Salvage Sheet Rope + Craft Sheet + Craft Tarp Planned recipes (but not implemented) + Merge Thread - Working, but somewhat basic. Craft for all and move char to stop + Craft Pillow + Salvage Pillow Workshop ID: 2755409154 Mod ID: stSurvTlr
  2. One possible solution to this would be to make any object that can hold liquid all be the same item type or class. Might have to have something handle when you change the liquid type. Or have in place some restrictions based on material type if it can hold fuel. But I agree with the sentiment to link up existing types to use some common functionality. I like this idea as well. Allowing items to have other functionality without having to code each item specifically would be nice. As I dig through the code and improve my modding skills similar thoughts often cross my mind. I even have a few solutions in mind.
  3. I'm running a dedicated server on linux and adding my own mod to test in multiplayer. It's is pretty similar to adding the mods to a local game except you have to add the mod in the server config file which is named "servertest.ini" by default in the Zombiod/Server folder. In the config file look for the line "Mods=" and add your mods there in a comma separated list. For example in my User profile I have /Zomboid/mods/stTest where my mod ID is stTest. So if I only want my mod on the server the config line looks like: Mods = stTest It is important to note the the mod folder name may be different than the Mod ID. If your not sure open the mod.info file in the first folder of the mod and look for the line like: id=stTest Only add the non-workshop mods to the "Mods=" line. If you are running a non-steam server you'll have to copy any workshop mods to you /Zomboid/mods folder and list them all by Mod ID on the "Mods=" line as well. I'm not sure if the Dedicated server on windows uses a different or same Zomboid folder as the user. On Linux it uses the same Zomboid profile folder in the user home directory. Some workshop mod packs have two Mod IDs that need to be added to work. What I usually do is host a game using the game client on Win10 and create my options through the GUI and copy the config files to my Linux server.
  4. Just wanted to say thank you for this guide. I wanted to add a new item to the game but only use an alternate texture with an existing game model and was able to follow your guide to find my solution. I copied three existing bag xml files from the "\media\clothing\clothingItems" folder and renamed them to my new items with new GUIDs. Then I referenced my new art texture file in the xml but left the existing game model. Then in my item description referenced my new texture xml instead of the original game file. Now if I had time to really learn Blender I'd even attempt to make my own model. Thank You!
  5. Just found most of what I was looking for in Tutorial by AuthenticPeach in the forum. Maybe you already found this, but here is link for anyone else that comes across this same question.
  6. Have you made any progress with this idea? This appears like something that many players would like. Something to consider is looking at other fuel mods and see how they do things. I almost always play my games with the Fuel API mod now which adds some extra fuel mechanics and big 400 capacity barrels. Would be nice if you could just connect that barrel to a generator.
  7. A good place to look is the existing game code that searches and changes the 'Literature' objects. Look at the file ISLiteratureUI.lua in the "media/lua/client/ISUI' folder of the game files. Here is a snip of a function that manipulates the same data you want to change. -- Code copied from ISLiteratureUI:setLists() function function myEditSkillBooks() local skillBooks = {} local allItems = getScriptManager():getAllItems() for i=1,allItems:size() do local item = allItems:get(i-1) if item:getType() == Type.Literature then if SkillBook[item:getSkillTrained()] then -- This is a skillbook item store in structure for later table.insert(skillBooks, item) -- Can edit item here if you wish -- item:DoParam("Weight = 0.5"); end end end end -- Example of a SkillBook item --[[ item BookTailoring1 { DisplayCategory = SkillBook, NumberOfPages = 220, Weight = 0.8, Type = Literature, DisplayName = Tailoring for Beginners, Icon = Book11, SkillTrained = Tailoring, LvlSkillTrained = 1, NumLevelsTrained = 2, StaticModel = Book, WorldStaticModel = BookYellow_Ground, } --]] You would then need to have this function added to some game events to change all the data. Events.OnSpawnRegionsLoaded.Add(myEditSkillBooks) Events.OnLoad.Add(myEditSkillBooks) **Note: This function would edit/override all skill book data, possibly even new ones adds by other mods depending on load order.
  8. From what I could find it seems possible. I would like to know how to do this as well. I'm trying to add some textures myself not just replace them. Working on some custom bags with new textures for existing in game models. As I find more of what files or attributes need to be overridden I'll post it here. I believe all of the texture and model definitions are in the pack files which I have not messed with yet. The current logic seems you would find the game objects that use the 'vanilla' model and texture and point them to your new definition.
  9. Changing it to you recommendation worked, Thank you. player:getTraits():contains('Lucky')
  10. Thank you I'll give that a try. Might have to install Hydrocraft and look at it for fun and code. I might think of using another trait like Dextrous to give a slightly better outcome. Sad to see 'Lucky' get removed, I've always enjoyed RNG traits. From looking around the game files they don't use it much except for loot drops. Could be used much more in overall RNG calculations.
  11. I have found several instances where traits are checked from a 'character' object in timed action functions like below. function ISInventoryTransferAction:new (character, item, srcContainer, destContainer, time) ... if character:HasTrait("Dextrous") then o.maxTime = o.maxTime * 0.5 end if character:HasTrait("AllThumbs") then o.maxTime = o.maxTime * 4.0 end ... end I have been able to use a similar call to check for the "Lucky" and "Unlucky" trait in a timed action function but I would like to use these checks in a recipe 'OnCreate' function. The recipe functions pass a 'player' object instead of 'character' and doesn't seem to have the same class structure. Below is a lua block I have tried to adjust crafting chance and it does not work. Is there an easier way to find how the built-in function calls are defined? For example the difference between 'character' and 'player' in these function calls. -- (OnCreate) Function passed to Craft Sheet to complete crafting object function stCreateSheet(items, result, player, selectedItem) -- Main Recipe uses line "RemoveResultItem:true," so item is created in function on success -- Base chance with no skill is 35% with master skill at 95% -- Comment: Even an idiot can make a simple sheet 1/3 of the time. local successChance = 35 + (player:getPerkLevel(Perks.Tailoring)*6); ---[[ --This code is breaking the function if player:HasTrait("Lucky") then successChance = successChance + ZombRand(5,15); elseif player:HasTrait("Unlucky") then successChance = successChance - ZombRand(5,15); end --]] if ZombRand(0,100) < successChance then -- Sucess, create sheet and gain some XP player:getXp():AddXP(Perks.Tailoring, 1); -- Create sheet item and give to player local objSheet = InventoryItemFactory.CreateItem("Base.Sheet"); player:getInventory():AddItem(objThread); else -- Failed to make item have character comment -- Some code similar from TimedAction, may work here -- self.character:Say("I need to get better at tailoring!"); end end I'll run a few more tests trying different ways to get the character object to do the check but any help is appreciated. I'm still digging through code and learning about how the game mechanics work.
  12. Spar10

    Survival Tailor MOD

    Tchernobill, Thanks for the response. So in my current code snip I have where I'm adding 1 xp if the rand chance is a success. I'm actually testing it in game now and the XP gains are working. Glad to know it does take into account perks and bonuses. I was about to try and code that into my OnCreate functions. What do you think about how I added Lucky and Unlucky chance modifiers to my stSalvageThread OnCreate function posted above? Right now I'm messing with a TimedAction function to make a better merge thread and twine. I don't enjoy clicking "Add To" on all my scraps separately. I'm thinking about grabbing a total thread unit count from inventory and remove all the scraps and return a total of full Thread items plus one with the left over units. I found some useful function in the RapairAllClothing function that might do the trick. I'm just not sure how to remove the 'old thread units'. local threadArray = player:getInventory():getItemsFromType(thread:getType(), true); local threadCount = player:getInventory():getItemCount(thread:getType(), true); Still learning lua, but I figure I can remove the found items in the array and then re-add thread based on total count. In my timed action I can have the maxTime based on the total thread that has to be merged.
  13. So do you want to require and item in invetory or a world item you need to be near to craft the recipe? I have a tailoring recipe that might help if you just want an inventory item to be required but not used. The below recipe makes a Sheet from RippedSheets and some Thread, but requires scissors and a needle or suture needle. recipe Craft Sheet { RippedSheets=8, Thread=5, keep Scissors, keep Needle/SutureNeedle, CanBeDoneFromFloor:true, Result:Sheet=1, Time:200.0, AnimNode:RipSheets, Category:Tailoring, SkillRequired:Tailoring=0, OnGiveXP:stAdd05TailoringXP, } Does this help? If you want to be near a world item you would have to use a custom recipe OnCreate or OnTest lua function.
  14. Here are a few things I have found with a sample commands for the Strength perk. There is probably a command to set the PerkBoost but not sure what it is. If you look at the timed action function for reading ("media\lua\client\TimedActions\ISReadABook.lua") you can see how the code increases the XpMultiplier for the book skill as you read the book. local perkBoost = self.char:getXp():getPerkBoost(Perks.Strength); local xpMult = self.char:getXp():getMultiplier(Perks.Strength); if perkBoost == 1 then xpBoost = "75%"; elseif perkBoost == 2 then xpBoost = "100%"; elseif perkBoost == 3 then xpBoost = "125%"; end -- Add 5X XP Multiplier to Strength for lvl 0 - 10 self.character:getXp():addXpMultiplier(Perks.Strength, 5, 0, 10);
  15. This mod expands on the Tailoring skill adding some new items to craft and material recipes. Some of these items/recipes were already in some tailoring mods, but I felt the current ones were unbalanced or didn't factor in player skill. This is my first PZ mod. I have figured out a good bit of what I need to get things functional, but still learning. I don't have a public release yet but it seems to be working well in my test games. I'll probably add it to the Steam Workshop this weekend, but wanted some feed back from community. Current build includes some basic recipes, but will be expanded to use Tailoring skill for crafted results. Craftable items: + Crude Backpack - Craftable early with just ripped sheets and a paperclip, low stats + Utility Pack Small - uses Fanny Pack slots (req Tailoring 1) + Utility Pack Large - uses Fanny Pack slots (req Tailoring 2) + Denim Backpack - Better 'school bag' (req Tailoring 3) + Utility Satchel - can be equipped with backpack (req Tailoring 4) Material recipes: + Salvage Ripped Sheets (for Thread) -Takes 5 Ripped Sheets, requires one tool: Paperclip/Tweezers/Needle/Suture Needle -Creates between 0 -10 units of thread based on Tailoring skill and some chance -Still working on craft balance, but I feel the current functionality is good. + Salvage Denin Strips (for Thread) -Similar to Salvage Ripped Sheets, but takes Denim Strips + Twist Thread into Twine + Unravel Twine + Twist Twine into Rope + Unravel Rope + Craft Sheet Rope + Craft Sheet Rope + Unravel Sheet Rope + Craft Sheet + Salvage Sheet (for Ripped Sheets) + Craft Tarp Planned recipes (but not implemented) + Merge Thread/Twine (kind of working, but somewhat basic) + Craft Pillow + Salvage Pillow I have some general questions about mechanics I haven't figured out yet. Currently I'm trying to figure out how the AddXP function works and if it factors in Perks and Bonuses. My current thought is that it doesn't, but need to do some more testing to be sure. Another question I have is if ZombRand factors in Lucky and Unlucky traits? I don't think it does. In my OnCreate recipe function I'm adding some custom code to give some change in chance if those attributes exist. Below is my 'Salvage for Thread' code. The recipe item destroys the original result thread item so it is created in the OnCreate function. function stSalvageThread(items, result, player, selectedItem) local countFail = 0; -- Create base thread item to give to player (current gmame stats 1 thread = 10 thread units) local objThread = InventoryItemFactory.CreateItem("Base.Thread"); -- Base chance with no skill is 15% with master skill at 95% local skillChance = 15 + (player:getPerkLevel(Perks.Tailoring)*8); --[[ --This code is breaking the function if player:HasTrait("Lucky") then successChance = successChance + 100; elseif player:HasTrait("Unlucky") then successChance = successChance - 10; end --]] -- Calculate thread amount depending on tailoring skill and some chance for i=1,10 do successChance = ZombRand(-10,10) + skillChance if ZombRand(0,100) < successChance then -- Sucess, keep thread unit and gain some XP player:getXp():AddXP(Perks.Tailoring, 1); else -- Failed to get thread unit so take some from thread countFail = countFail + 1; objThread:Use(); end end -- Give player final thread item if countFail < 10 then -- Only give thread if player didn't fail 10 times. player:getInventory():AddItem(objThread); end end I found the original code that had a chance to give thread in the 'Rip Sheets' function in the base game. Is there a better way or function to change the thread units in a thread item? I feel this method is 'less than perfect' to generate thread units, but it works. Any feedback is welcome and I'm looking forward to learn more of the functions available and how to use them. stSurvivalTailor.txt
×
×
  • Create New...