Kjulo Posted September 14, 2013 Share Posted September 14, 2013 I've tried following this guide on how to implement custom sprites, but i can't seem to get it working. The picture is in the root folder. LUA code: (It is implemented correctly since i get the items)Make_Shift_Mod_icons = {}----- This loads the textures. You can add as many-- as you want.function Make_Shift_Mod_icons.loadTextures() getTexture("Item_PillowHandBag.png");end----- This will add the item to the inventory for-- testing purposes.function Make_Shift_Mod_icons.giveItems() getSpecificPlayer(0):getInventory():AddItem("Base.Pillow"); getSpecificPlayer(0):getInventory():AddItem("Base.Bullets9mm");endEvents.OnGameBoot.Add(Make_Shift_Mod_icons.loadTextures);Events.OnGameStart.Add(Make_Shift_Mod_icons.giveItems);And then the items i want added (They are also in-game)module Make_Shift_Pillow{ imports { Base } item PillowHandBag { WeightReduction = 35, Weight = 0.1, Type = Container, Capacity = 10, DisplayName = Pillow Sheet Bag, Icon = Item_PillowHandBag.png, WeaponSprite = Item_PillowHandBag.png, } recipe Empty Pillow { Pillow, Result:PillowHandBag, Time:5.0 } }The icon is just a question mark, implying that it cannot find the textures. Also, if anyone knows how to add custom traits icons, i would be more than happy. Link to comment Share on other sites More sharing options...
RoboMat Posted September 14, 2013 Share Posted September 14, 2013 Could be possible that it doesn't work with the current steam release. What version are you testing this with? Link to comment Share on other sites More sharing options...
kinyoshi Posted September 14, 2013 Share Posted September 14, 2013 Remove the Item_ part of the Icon= tag, of you item scripting. Kjulo and RoboMat 2 Link to comment Share on other sites More sharing options...
RoboMat Posted September 14, 2013 Share Posted September 14, 2013 Great Scott, kinyoshi is right! kinyoshi 1 Link to comment Share on other sites More sharing options...
kinyoshi Posted September 14, 2013 Share Posted September 14, 2013 (edited) Not sure if the weapon sprite works for mods yet. Don't know about trait sprites, RoboMat does.Edit: Containers don't use the weapon sprite tag.. Edited September 14, 2013 by kinyoshi Link to comment Share on other sites More sharing options...
RoboMat Posted September 14, 2013 Share Posted September 14, 2013 Ah yeah the trait icons are pretty easy actually: TraitFactory.addTrait("tz_campingEnthusiast", "Camping Enthusiast", 0, "Description", true); All you have to do is add your icons to "/ui/Traits". The above icon would be named: tz_campingEnthusiast.png Link to comment Share on other sites More sharing options...
Kjulo Posted September 14, 2013 Author Share Posted September 14, 2013 Remove the Item_ part of the Icon= tag, of you item scripting.Thanks, it works not. Not sure if the weapon sprite works for mods yet. Don't know about trait sprites, RoboMat does.Edit: Containers don't use the weapon sprite tag..i used the weapon sprite tag because i tried out different methods. I just forgot to remove it. Link to comment Share on other sites More sharing options...
kinyoshi Posted September 14, 2013 Share Posted September 14, 2013 So you got it working? Link to comment Share on other sites More sharing options...
Kjulo Posted September 14, 2013 Author Share Posted September 14, 2013 So you got it working?Yep, although i still have trouble with the trait icons in "\media\ui\Traits" i have made a duplicate image named "tz_nerve"TraitFactory.addTrait("tz_nerve", "Nervous", -1, "Never feel safe", false);Icon dosen't show up, but the trait does Link to comment Share on other sites More sharing options...
RoboMat Posted September 14, 2013 Share Posted September 14, 2013 Ah crap that's my bad ... sorry. You have to name it: trait_kjulo_nerve.png and then you can do it like this: TraitFactory.addTrait("kjulo_nerve", "Nervous", -1, "Never feel safe", false); the "tz_" part in my icons was just because they were made by thuztor Kjulo 1 Link to comment Share on other sites More sharing options...
Kjulo Posted September 14, 2013 Author Share Posted September 14, 2013 Ah crap that's my bad ... sorry. You have to name it:trait_kjulo_nerve.pngand then you can do it like this:TraitFactory.addTrait("kjulo_nerve", "Nervous", -1, "Never feel safe", false);the "tz_" part in my icons was just because they were made by thuztor Many thanks. Link to comment Share on other sites More sharing options...
Banjo Posted September 14, 2013 Share Posted September 14, 2013 Yup, I discovered the trait icon trick on the old forum after many posts trying to solve it... it's simple but you expect to have to specify one, right (as you do for professions)? Nope, just put the icon file in the right folder and give it the correct name! As long as the icon and trait names match, it works. Correct me if I'm wrong, but 2.9.9.17 has a bug in the mod loader that prevents item mods working... though they should work if you install a mod the "old" way, which is what I presume you did here? Link to comment Share on other sites More sharing options...
Kjulo Posted September 14, 2013 Author Share Posted September 14, 2013 Yup, I discovered the trait icon trick on the old forum after many posts trying to solve it... it's simple but you expect to have to specify one, right (as you do for professions)? Nope, just put the icon file in the right folder and give it the correct name! As long as the icon and trait names match, it works. Correct me if I'm wrong, but 2.9.9.17 has a bug in the mod loader that prevents item mods working... though they should work if you install a mod the "old" way, which is what I presume you did here?Yeah, i made a "Mods" folder in the media folder(s). Works like a charm. Link to comment Share on other sites More sharing options...
RoboMat Posted September 14, 2013 Share Posted September 14, 2013 I still hope that the item-icons will be fixed soon. Will make life a lot more easier. Banjo 1 Link to comment Share on other sites More sharing options...
Banjo Posted September 14, 2013 Share Posted September 14, 2013 I still hope that the item-icons will be fixed soon. Will make life a lot more easier.Agreed! The mod loader is just so handy, and makes testing much easier too. Link to comment 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