JaccK1618 Posted September 11, 2024 Share Posted September 11, 2024 Can someone give me a rundown on how to put modded items in the scrapbook? Or is it still to recent of a feature to properly mod? Link to comment https://forums.kleientertainment.com/forums/topic/159641-how-to-put-modded-item-in-scrapbook/ Share on other sites More sharing options...
Warmerfall Posted May 29 Share Posted May 29 Hello! The two files you want to look at when learning to create a scrapbook entry is in scripts/screens/redux/scrapbookdata.lua and scripts/scrapbook_prefabs. Here's the rundown of what I understand. Adding an Entry: All the data handled for each entry is in scrapbookdata.lua, and can be easily added onto through your modmain.lua. Simply require the file with all of the data and add an entry of your own. The addition of an entry would look like this: local SCRAPDATA = require("screens/redux/scrapbookdata") SCRAPDATA["your_item"] = {name= "your_item", tex="your_item.tex", type="item", prefab="your_item", build="your_item", bank="your_item", anim="idle", deps={"papyrus"}} To whitelist your prefab, you'll want to write this too: --This file is just a big list of what's allowed in the scrapbook local SCRAPBOOK_PREFABS = require("scrapbook_prefabs") SCRAPBOOK_PREFABS["youritem"] = true It is important that your item's name is already set through the global STRING variable or else this won't work. The data you put into "name" is just the prefab name again so that the scrapbookscreen knows where to look in the STRINGS.NAMES table. It is NOT the actual name. Something like GLOBAL.STRINGS.NAMES.YOUR_ITEM = "Cool Name" Entry Data: Figuring out what to put in for data can be by looking at some of the entries. There's too many to go over, so here's two just to get an idea. You can find the file in the game's data bundles, but I also attached the file to this post abigail_flower = {name="abigail_flower", tex="abigail_flower.tex", type="item", prefab="abigail_flower", build="abigail_flower_rework", bank="abigail_flower_rework", anim="level3_loop", burnable=true, craftingprefab="wendy", deps={"ghostflower", "nightmarefuel"}}, axe = {name="axe", tex="axe.tex", subcat="tool", type="item", prefab="axe", weapondamage=27.2, finiteuses=100, toolactions={"CHOP"}, build="axe", bank="axe", anim="idle", deps={"flint", "twigs"}}, If you want a little note that describes what the item does, you can do this through STRINGS.SCRAPBOOK.SPECIALINFO GLOBAL.STRINGS.SCRAPBOOK.SPECIALINFO.YOUR_ITEM = "This is an item that does something cool!" Also, if your item includes some dependencies, you should add to the pre-existing items they correlate to. Say that your item is created with papyrus and want to link its entry to yours. You could write something like this. local SCRAPDATA = require("screens/redux/scrapbookdata") table.insert(SCRAPDATA["papyrus"].deps, "your_item") How to add your image to the scrapbook: There will be an error such as a cactus replacing the icon of your entry if you haven't "register" the image you want to use. The icon is plucked through one of two spots, depending on the "type". Both functions below can be found in scripts/simutil.lua --if the entry you are adding is an item/food, you will want to insert the image and atlas here GLOBAL.RegisterInventoryItemAtlas("images/youritem.xml", "youritem.tex") --otherwise, use this function instead GLOBAL.RegisterScrapbookIconAtlas("images/youritem.xml", "youritem.tex") As for within the entry screen, the animation you selected will be the image. Skeleton: Here's a skeleton: --you can go ahead and look at the lua file on scrapbookdata for what to expect. local SCRAPDATA = require("screens/redux/scrapbookdata") local SCRAPFABS = require("scrapbook_prefabs") --if the entry you are adding is an item/food, you will want to insert the image and atlas here GLOBAL.RegisterInventoryItemAtlas("images/youritem.xml", "youritem.tex") --otherwise, use this function instead GLOBAL.RegisterScrapbookIconAtlas("images/youritem.xml", "youritem.tex") --This is the data for your entry. SCRAPDATA["your_item"] = {name= "your_item", tex="your_item.tex", type="item", prefab="your_item", build="your_item", bank="your_item", anim="idle", deps={"papyrus"}} --This whitelists your prefab for the scrapbook SCRAPFABS["your_item"] = true scrapbookdata.lua 2 1 Link to comment https://forums.kleientertainment.com/forums/topic/159641-how-to-put-modded-item-in-scrapbook/#findComment-1868991 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