Tsukihime 1,489 Posted March 25, 2013 (edited) This script allows you to designate which icon sheet you want to draw your icon from. This allows you to organize your icons so that you don't need to load one large iconset just to draw one icon. Separate your icons into separate files, then load them by name and index! You can even specify different icon sizes for different sheets. Download Get it at Hime Works The icon index utility I use in the example below can be found here Usage Installation Place this script below Materials and above Main. Setting up icon sheets Place any custom icon sheets in your Graphics/System folder. In the configuration below, add the filenames (without extensions) to the `Icon_Sheets` hash and the width and height of the icons for those sheets. You must also include the default icon sheet to use, which is "Iconset" Using custom icon sheets Now that you have set up your icon sheets, you can begin using them. In your database, note-tag objects with <icon: name index> Where`name` is the exact filename of the icon sheet, without extensions `index` is the index of the icon in the specified file. For example, suppose I have the following icon sheet called "CustomIcons" After looking up the icon index, I want to assign it to my Potion item Now when I load up the game, I will see that my potion is using the custom icon Edited March 3, 2015 by Tsukihime 4 Share this post Link to post Share on other sites
CT Bolt 23 Posted March 26, 2013 Wow, how useful... I can't believe this hasn't been done by Enterbrain themselves yet. Good work! Share this post Link to post Share on other sites
Tigerbite 36 Posted March 26, 2013 Thank you! I was just about to ask how to do something like this because my icon set was getting too large and causing lag in my battle system. <3 me some hime. Share this post Link to post Share on other sites
Sievnn 14 Posted March 26, 2013 So cool, its good to avoid those limitations and use lots of Awesome iconsets in the same game. Share this post Link to post Share on other sites
Tigerbite 36 Posted March 26, 2013 (edited) Finally got to test it out. So far it works like a charm! Such an easier way to sort my items for different categories. -edit- Actually, your script (or casper's script) doesn't work with the other. http://www.rpgmakervxace.net/topic/2775-csca-encyclopedia-w-bestiary/ Since I'm not much of a scripter, not sure if it's something easy to fix or not, but I did find this part of the code in casper's script. def csca_draw_icon(item) if item.csca_custom_picture == "" icon_index = item.icon_index bitmap = Cache.system("Iconset") rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24) target = Rect.new(0,0,72,72) contents.stretch_blt(target, bitmap, rect) else bitmap = Bitmap.new("Graphics/Pictures/"+item.csca_custom_picture+".png") target = Rect.new(0,0,72,72) contents.stretch_blt(target, bitmap, bitmap.rect, 255) end end Edited March 26, 2013 by Tigerbite Share this post Link to post Share on other sites
Tsukihime 1,489 Posted March 26, 2013 (edited) If anyone can find any (or write their own) icon index utilities I can add it to the post. For that bestiary script just change it to this (untested) def csca_draw_icon(item) if item.csca_custom_picture == "" bitmap, icon_index = TH::Custom_Icon_Sheets.load_icon_sheet(item.icon_index) rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24) target = Rect.new(0,0,72,72) contents.stretch_blt(target, bitmap, rect) else bitmap = Bitmap.new("Graphics/Pictures/"+item.csca_custom_picture+".png") target = Rect.new(0,0,72,72) contents.stretch_blt(target, bitmap, bitmap.rect, 255) end end Edited March 27, 2013 by Tsukihime Share this post Link to post Share on other sites
Tigerbite 36 Posted March 27, 2013 (edited) I also noticed using that any item that enlarges the icon (the encyclopedia/yanfly's equip/shop menus, etc.) The enlarged icon shows up blank unless there is a note tag in the item "<icon: name index>" at which point the enlarged icon is from the default "Iconset." Okay, semi fixed problems by listing Iconset first in my list of sheets on line 136. Icon_Sheets = ["Iconset", "WeaponIcons"] However, doing this, the enlarged icons for anything on my "WeaponIcons" sheet show up blank. Edited March 27, 2013 by Tigerbite Share this post Link to post Share on other sites
Tsukihime 1,489 Posted March 27, 2013 (edited) Yanfly's is the same issue: they have their own icon drawing methods. class Window_ShopData < Window_Base def draw_item_image colour = Color.new(0, 0, 0, translucent_alpha/2) rect = Rect.new(1, 1, 94, 94) contents.fill_rect(rect, colour) if @item.image.nil? bitmap, icon_index = TH::Custom_Icon_Sheets.load_icon_sheet(@item.icon_index) rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24) target = Rect.new(0, 0, 96, 96) contents.stretch_blt(target, bitmap, rect) else bitmap = Cache.picture(@item.image) contents.blt(0, 0, bitmap, bitmap.rect, 255) end end end There is basically no way for me to avoid compatibility issues because the default script only passes the icon index to the draw_icon method. The closest I can come to it is to change what it means to load the Iconset image, but then I don't know which image to load since that information is not given to me. Edited March 27, 2013 by Tsukihime Share this post Link to post Share on other sites
Tigerbite 36 Posted March 27, 2013 (edited) That seems to be working fine. I have 3 sheets, and put a shop up with 3 items (one from each sheet.) Seems to work right. Just gotta go plug that little code into all the other scripts. -Edit- Hmmm, that encyclopedia isn't editing as easy as Yanfly's script. Keep getting undefined method for icon_index no matter what I do =x Edited March 27, 2013 by Tigerbite Share this post Link to post Share on other sites
Tsukihime 1,489 Posted March 27, 2013 (edited) Send a demo with the bestiary script set up. The code only calls for Iconset in one place so I'm not sure why it might be failing. Edited March 27, 2013 by Tsukihime Share this post Link to post Share on other sites
Tsukihime 1,489 Posted March 31, 2013 (edited) Script updated to properly draw icons of the specified dimensions (eg: what you write for the Icon_Width and Icon_Height) Doesn't mean it will look good on your window though since I don't change how the window looks. Edited March 31, 2013 by Tsukihime Share this post Link to post Share on other sites
+ MurgianSwordsman 36 Posted March 31, 2013 This ought to be better then the 10687 icon sheet that I have. Share this post Link to post Share on other sites
pkmaster99 1 Posted April 12, 2013 Hmmm This is just awesome but This doesn't seem to work very well with Mog Hunter's Advanced Battle Hud. The stats have no image even if I set it. If I don't use this... game freeze for a sec if I just change the icon set, but using this script fix it for some reason XD even though it end up having no icon image on states change... Not very good at writin script so... I would like some one to help me find a way to fix this problem ^^ Share this post Link to post Share on other sites
Dark Horseman 93 Posted April 12, 2013 (edited) I'm using an iconset that goes up to 4000 at the moment, and I'm noticing some minor lag outside battle (not an issue), but a noticeable skip in battle whenever states are drawn (probably from refreshing the icons and searching through the 4000 set). So would using this script and making a smaller subset of about 100 icons just for states in battle alleviate it? Or would using this script actually cause more lag or make no difference? I'll test it myself if no one else has, but I'd prefer to save some time if someone already has the answer. Edited April 12, 2013 by Dark Horseman Share this post Link to post Share on other sites
Tigerbite 36 Posted April 12, 2013 It does help it and the reason why I use and love this script. I use the default iconset for anything battle related and keep it to as few icons as possible. Then I have other sheets for anything else that I need (weapon/armors/signs/etc) Share this post Link to post Share on other sites
Tsukihime 1,489 Posted June 13, 2013 (edited) I have updated the script to allow you to specify the width and height of each sheet individually. So for example, one sheet might use 24x24 icons, while another sheet might use 32x32 icons, while another sheet might use 65x65 icons. Edited June 13, 2013 by Tsukihime Share this post Link to post Share on other sites
Absolute Zero 1 Posted July 25, 2013 is there a way to use this with victor animated battle? https://dl.dropboxusercontent.com/u/27014140/Scripts/Victor%20Engine%20-%20Animated%20Battle.txt im trying to have bigger weapon icons for greatswords but they are invisible when I try to use them with this. Share this post Link to post Share on other sites
shaneisme 0 Posted November 9, 2013 So does this script work with Yanfly? This would fix my iconset issues perfectly and your a genius. Share this post Link to post Share on other sites
Tsukihime 1,489 Posted November 9, 2013 There should be some compatibility patches with some of yanfly's scripts I don't know which script you mean because yanfly's got 100's Share this post Link to post Share on other sites
Dcraft 0 Posted September 20, 2015 When i use large icons it overlaps Share this post Link to post Share on other sites
Tsukihime 1,489 Posted September 20, 2015 The script allows you to use icons with larger sizes. It doesn't change how your windows look. Share this post Link to post Share on other sites
Dcraft 0 Posted September 20, 2015 The script allows you to use icons with larger sizes. It doesn't change how your windows look. I can use another script or something? Share this post Link to post Share on other sites
Tsukihime 1,489 Posted September 20, 2015 (edited) I can use another script or something? You can use another script, but I don't have a script that will modify windows so that the text aligns the icons. This script is meant to make it easier to load different icon sheets so that scripters don't have to think about how they will do it for their own scripts. Edited September 20, 2015 by Tsukihime Share this post Link to post Share on other sites
CharlesMabe 0 Posted March 27, 2016 The script allows you to use icons with larger sizes. It doesn't change how your windows look. That's the deal-breaker. There's barely a point in this script if you can't use custom-dimension icons. Which means we need to know how to make the text not overlap the icons. Share this post Link to post Share on other sites