Fidooop Posted January 5, 2017 Share Posted January 5, 2017 (edited) Hello, modders and skin fanatics alike! After a very long time working on it, I'm happy to announce a brand new mod API that allows one to create their very own skins for their modded characters and items! You can find the mod on the Steam Workshop here: http://steamcommunity.com/sharedfiles/filedetails/?id=835602689 WARNING: This mod is only to be used to create skins for modded characters/items. Klei strongly forbids the use of modders creating skins for any official character/item. If any mod is found using code from this mod in order to skin official characters/items it will be reported on sight. How To Use: Spoiler SKINNING CHARACTERS: The first thing you'll want is the 'MakeModCharacterSkinnable' function. (Which is a GLOBAL function) It must be called in the modmain and has to be called after 'AddModCharacter' is run. MakeModCharacterSkinnable only has one argument which is the mod character's prefab name. Now that the mod character is skinnable you can now add skins. 'AddModCharacterSkin' will create a skin prefab for the character and return it. It must be called within a prefab file. AddModCharacterSkin's arguments are as follows: prefab, skin, skins, assets, tags, options prefab = Mod character's prefab name. skin = The skin being added. ("formal", "survivor", "shadow", etc.) skins = A table of skinstates and the corrisponding builds. Example: {normal_skin = "charactername", ghost_skin = "ghost_charactername_build"} assets = A table provided with names of builds used for this skin. Example: {"charactername", "ghost_charactername_build"} tags = Tags for this skin. Example: {"CHARACTERNAME", "FORMAL"} options = A table filled with various options that are all optional extras for the skin.• options.starting_inv_skins = If a mod character's starting inventory items have skins that match this skin then this table can be used to swap out the inventory on spawn. (ONLY WORKS ON MODDED ITEMS.) The skin name string can be replaced by a function if there needs to be any special code run when replacing the original item. (Original item will be deleted by the time this function runs and the replacement needs to be spawned using this function) Arguments supplied to this function when it runs are: player, playerskin • player = The player whose inventory is being replaced by skinned items • playerskin = Said player's skin name ("formal", "survivor", etc.)• options.avatarset = The name of a custom avatar set for this skin. (Changes out "avatar_charactername", "self_inspect_charactername", etc. with "avatar_avatarset", etc.)• options.uiname = The name of a custom uiname image. (The dark gray one found in character select and when a character is examined.) When this skin is equipped it will switch the uiname image out for this one.• options.gender = A gender change for this skin specifically. If one were to make a robotic skin or genderswap skin then this option will help out in doing so.Example of how to use the options argument: { starting_inv_skins = {customitem = "robotic"}, avatarset = "roboticcharactername", uiname = "names_roboticcharactername", gender = "ROBOT" } SKINNING ITEMS: To add a skin for an item the function needed is 'AddModItemSkin'. It must be called in a prefab since it creates a prefab for the item. AddModItemSkin's arguments are as follows: item, skin, fn, assets, atlas, image, placer, baseitem_atlas item = The item's prefab name. skin = The skin being added. fn = The item/skin's prefab function. ('AddModItemSkin' creates an entirely new prefab and will need a function. Best way to do this is use the same function from the original item and have various values change based on what skin is being made) assets = The skin's assets. atlas = The skin's inventory image atlas. (Used in the crafting menu) image = The skin's inventory image. (Used in the crafting menu) placer = If this item comes with a placer then the placer argument can either be set to true or be a table and will build a placer prefab. If set to true the function will build a placer with the build and bank both being item.."_"..skin and the anim being "placer". If set to a table (the table keys/values must be {bank = "", build = "", anim = ""}) the function will create a placer with the bank, build, and anim being what is set in the table. If 'AddModItemSkin' is called without the placer argument it will return just the skin prefab. If 'AddModItemSkin' is called with the placer argument it will return both the skin prefab and the skin's placer. baseitem_atlas = The default item's inventory image atlas. (Only needed if the default item's prefab name varies from its atlas name) EXTRA FUNCTIONALITY: If some changes need to be applied to a character skin there are two functions that get run whenever skins get changed. inst.OnChangeModdedSkin gets run on the server. Arguments are as follows: inst, skin, newspawn inst = the character, skin = skin name ("formal", "survivor", etc.) newspawn = true if it is a brand new spawn on the server. inst.OnChangeModdedSkinClient gets run on the client side. It gets the same arguments as 'OnChangeModdedSkin' but without 'newspawn' The event "onchangemoddedskin" also gets pushed on both the client and the server with data providing the name of the skin that has just been equipped. To spawn a skinned item you can only do it like this: SpawnPrefab("item", "skin") Very special thanks to:@Kzisor who's Additional Dressware mod inspired the creation of this mod!@Dudedude who helped out with the assets.@PeterA who walked me through a lot of the Dos and Don'ts so that I wasn't stepping over any lines! @Blueberrys who made the Persistant Data module that helped make this possible. Can be found here: For anyone wanting to skin their modded characters here are the skin portrait backgrounds! Spoiler Guest of Honor Survivor Triumphant Roseate Halloween 2016 Some frequently asked questions: (If you have any more questions post them down below! I'll reply as soon as I can!)Can I skin Wilson or any other official character? No, Peter has told me to make sure that everybody is very aware that this is off limits... We've been given a gift so let's not squander it! How do I use it? The tutorial is up above! It has all the usable functions inside and how to use them! Please don't rip the code and put it in your mod through... Make sure that when you upload your mod you add this mod as a required item. (It is set up this way so that the same code doesn't run multiple times if someone has multiple mods that have skins!) What is an API? An API (Application Programming Interface) is a set of functions which allows you to use advanced techniques without having to write your own code or copy/paste the code in your mod... In order to use this API you must add this mod as a requirement on your mods workshop page. Can I make clothing? No, that is off limits. (and it'd also require a lot of extra code that is not supplied within the mod...) I found a mod that skins official items/characters! What should I do? If it is not the playable pets mod (They technically have the go-ahead to skin the playable mobs) then please immediately report it! We don't want to force Klei's hand and have Modded Skins shut down. What if I made a rip-off character of one of the official characters and skinned that? Still off limits because it is still Klei's character. (even after you change one letter in the name) So this is also prohibited and must be reported if anyone is found doing this! Can this be used to give myself official skins? At the moment I'm more than certain that this is impossible... However, if a way is found to do this using my mod then it's more a fault of Klei's (for leaving a hole in skin restrictions) and not mine because all I did was some UI hacking. What mods are currently using this to make skins? Check out @Chris1488's Modded Skins thread! He's going to try his best to stay on top of what mods get skins and he'll be updating his thread whenever he possibly can! Is mayonnaise an instrument? I'm... not entirely sure? I guess you could make a song using only sounds made by a tub of mayonnaise... But then again you could technically do that with almost everything! So I propose a counter-question. Does that mean that everything is an instrument? Edited August 7, 2017 by Fidooop 25 2 Link to comment Share on other sites More sharing options...
GuyNamedChris Posted January 5, 2017 Share Posted January 5, 2017 I can probably guess the answer, but this rule also applies to mods of the SW characters, right? Link to comment Share on other sites More sharing options...
halfrose Posted January 5, 2017 Share Posted January 5, 2017 1 minute ago, Chris1488 said: I can probably guess the answer, but this rule also applies to mods of the SW characters, right? Id imagine so, I mean, they are also klei official characters? that is my guess at least 1 Link to comment Share on other sites More sharing options...
Fidooop Posted January 5, 2017 Author Share Posted January 5, 2017 3 minutes ago, Chris1488 said: I can probably guess the answer, but this rule also applies to mods of the SW characters, right? I'm fairly certain it does because as halfrose said, they are official characters... 1 Link to comment Share on other sites More sharing options...
Dudedude Posted January 6, 2017 Share Posted January 6, 2017 I'll be taking advantage of this in the near future. 8 Link to comment Share on other sites More sharing options...
GuyNamedChris Posted January 7, 2017 Share Posted January 7, 2017 (edited) I must see all the new mod skins people are making! Show me all of them! ...besides Erik, I know 'bout him already Spoiler Edited January 7, 2017 by Chris1488 6 Link to comment Share on other sites More sharing options...
Fidooop Posted January 7, 2017 Author Share Posted January 7, 2017 5 minutes ago, Chris1488 said: I must see all the new mod skins people are making! Show me all of them! Are you going to add a Mod Made rarity section to your skins thread? xD 2 Link to comment Share on other sites More sharing options...
Developer ImDaMisterL Posted January 7, 2017 Developer Share Posted January 7, 2017 1 minute ago, Fidooop said: Are you going to add a Mod Made rarity section to your skins thread? xD Ech, imagine how much work that would be! 4 Link to comment Share on other sites More sharing options...
GuyNamedChris Posted January 7, 2017 Share Posted January 7, 2017 (edited) 47 minutes ago, Fidooop said: Are you going to add a Mod Made rarity section to your skins thread? xD Hm...y'know, I just might be able to handle that! A separate thread in the Mods section showing off any and all skins for mods and their respective creators. I just need a little help with the mod makers themselves, of course. EDIT: I may have gotten myself too excited... Erik: [GoH Set] Edited January 7, 2017 by Chris1488 6 Link to comment Share on other sites More sharing options...
Developer ImDaMisterL Posted January 7, 2017 Developer Share Posted January 7, 2017 7 1 Link to comment Share on other sites More sharing options...
Lumina Posted January 7, 2017 Share Posted January 7, 2017 This seems really nice, i'll probably try it a day. On 06/01/2017 at 0:17 AM, Fidooop said: Can I make clothing? No, that is off limits. (and it'd also require a lot of extra code that is not supplied within the mod...) What is clothing exactly, i don't understand ? Skin for armor/hat ? Something else ? Also, it is possible to give special condition for a skin to appears ? Link to comment Share on other sites More sharing options...
GuyNamedChris Posted January 7, 2017 Share Posted January 7, 2017 1 hour ago, Lumina said: What is clothing exactly, i don't understand ? Skin for armor/hat ? Something else ? What we mean by clothing is any skin that goes in the body/hand/shoe slot. Only the head slot is available to be skinned on your character. Link to comment Share on other sites More sharing options...
Lumina Posted January 7, 2017 Share Posted January 7, 2017 Ok, thanks for the answer It's because even if the character isn't a klei character, since there are clothing from klei you don't want the mod to be in "conflict" with official skin is it this ? Link to comment Share on other sites More sharing options...
neal_b4_me Posted January 7, 2017 Share Posted January 7, 2017 Which file in which folder am I inserting ' MakeModCharacterSkinnable' into? Also what folder in general am I modifying? The one that came in this particular mod folder? Link to comment Share on other sites More sharing options...
Fidooop Posted January 7, 2017 Author Share Posted January 7, 2017 41 minutes ago, Lumina said: Ok, thanks for the answer It's because even if the character isn't a klei character, since there are clothing from klei you don't want the mod to be in "conflict" with official skin is it this ? To clear the air a bit more... Equippables are completely fine to reskin! (Not official equippables however) What I mean by clothing are the items here below the head: And it isn't a compatibility issue! It's just that Peter had told me that making clothes was off limits to us modders. 17 minutes ago, neal_b4_me said: Which file in which folder am I inserting ' MakeModCharacterSkinnable' into? Also what folder in general am I modifying? The one that came in this particular mod folder? MakeModCharacterSkinnable goes into your mod's modmain.lua after the AddModCharacter function has been run! Please don't modify anything in the Modded Skins folder, only your own mod. (and please do not copy anything from the modded skins mod into your own mod) Every needed function to create skins for your mod are available in the global space once Modded Skins is enabled! All you've got to do is create the skin prefabs in your mod's prefabs folder! 1 Link to comment Share on other sites More sharing options...
Lumina Posted January 7, 2017 Share Posted January 7, 2017 1 minute ago, Fidooop said: And it isn't a compatibility issue! It's just that Peter had told me that making clothes was off limits to us modders. Yeah, sorry, didn't use the right word, by conflict i was meaning more like "competition"/"concurrence", rather than compatibility. Thanks for your answer Link to comment Share on other sites More sharing options...
Devinxh04 Posted January 8, 2017 Share Posted January 8, 2017 On 1/5/2017 at 6:17 PM, Fidooop said: This mod is only to be used to create skins for modded characters/items. Klei strongly forbids the use of modders creating skins for any official character/item. If any mod is found using code from this mod in order to skin official characters/items it will be reported on sight. Including Shipwrecked characters ported mods? Link to comment Share on other sites More sharing options...
Fidooop Posted January 8, 2017 Author Share Posted January 8, 2017 24 minutes ago, Devinxh04 said: Including Shipwrecked characters ported mods? On 1/5/2017 at 5:47 PM, Fidooop said: On 1/5/2017 at 5:40 PM, Chris1488 said: I can probably guess the answer, but this rule also applies to mods of the SW characters, right? I'm fairly certain it does because as halfrose said, they are official characters... Link to comment Share on other sites More sharing options...
Fidooop Posted January 10, 2017 Author Share Posted January 10, 2017 (For those of you wanting to play around with the Modded Skins mechanics and/or see how the code is handled) Erik has just been released and put on the workshop! http://steamcommunity.com/sharedfiles/filedetails/?id=839280973 1 Link to comment Share on other sites More sharing options...
NeddoFreddo Posted January 11, 2017 Share Posted January 11, 2017 So we can't make skins for Klei-made objects? Darn, that sucks, I was looking forward to seeing the fabled Microwave on a Stool skin for the Crock Pot! Link to comment Share on other sites More sharing options...
Fidooop Posted January 11, 2017 Author Share Posted January 11, 2017 1 minute ago, NeddoFreddo said: So we can't make skins for Klei-made objects? Darn, that sucks, I was looking forward to seeing the fabled Microwave on a Stool skin for the Crock Pot! ....You could make a custom crockpot with the same exact code and have it use a microwave-on-stool art though! Just as long as it isn't considered a "skin" and isn't using the skin system then you're completely fine! 1 Link to comment Share on other sites More sharing options...
Lumina Posted January 11, 2017 Share Posted January 11, 2017 Ok i tried to make something but i got mistakes. I'm sure some of them are obvious but i'm not skilled enough to fix them. Here is the mod : sunshade.rar Here is the error log : Spoiler [00:00:47]: MOD ERROR: sunshade (Sunshade): Mod: sunshade (Sunshade) [00:00:47]: [string "../mods/sunshade/modmain.lua"]:13: attempt to index global 'RECIPETABS' (a nil value) LUA ERROR stack traceback: ../mods/sunshade/modmain.lua(13,1) in main chunk =[C] in function 'xpcall' scripts/util.lua(609,1) in function 'RunInEnvironment' scripts/mods.lua(483,1) in function 'InitializeModMain' scripts/mods.lua(457,1) in function 'LoadMods' scripts/main.lua(251,1) in function 'ModSafeStartup' scripts/main.lua(306,1) =[C] in function 'SetPersistentString' scripts/mainfunctions.lua(22,1) in function 'SavePersistentString' scripts/modindex.lua(76,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(63,1) in function 'BeginStartupSequence' scripts/main.lua(305,1) in function 'callback' scripts/modindex.lua(516,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(490,1) in function 'Load' scripts/main.lua(304,1) in main chunk I tried to use erik mod as an example but i don't understand some problems i got... Thanks for any help. Link to comment Share on other sites More sharing options...
GuyNamedChris Posted January 11, 2017 Share Posted January 11, 2017 1 hour ago, Lumina said: attempt to index global 'RECIPETABS' (a nil value) I'm no modder, but shouldn't this mean you need a GLOBAL.RECIPETABS somewhere or something...? Link to comment Share on other sites More sharing options...
Lumina Posted January 11, 2017 Share Posted January 11, 2017 I don't know, this line is usually fine used in others mods i have, but maybe i forgot something somewhere. I can't figure what is wrong and i'm pretty sure something else is wrong too Link to comment Share on other sites More sharing options...
Zeklo Posted January 12, 2017 Share Posted January 12, 2017 This makes me wanna get back into modding. 2 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