GodIess Posted April 4, 2023 Share Posted April 4, 2023 I read the guide and I know what code to write, but the problem is that I don't understand what animation files I need to take to see how it will look, if I take the spear_wathgrithr.zip animation I only use idle and when I pack I get small textures, even if nothing has changed Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/ Share on other sites More sharing options...
Rickzzs Posted April 4, 2023 Share Posted April 4, 2023 There are two ways to create a skin for an official item. 1.extract atlas.tex and edit it. This means you will be restricted by the position and size. 2.extract scml, one for ground anim and the other for equip. Equip anim is extracted together with a player anim. See my tutorial of how to extract animation with all layers. Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628148 Share on other sites More sharing options...
GodIess Posted April 5, 2023 Author Share Posted April 5, 2023 1 hour ago, Rickzzs said: There are two ways to create a skin for an official item. 1.extract atlas.tex and edit it. This means you will be restricted by the position and size. 2.extract scml, one for ground anim and the other for equip. Equip anim is extracted together with a player anim. See my tutorial of how to extract animation with all layers. Why is everything so complicated, everything in me breaks and doesn’t work , writing code is much easier Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628154 Share on other sites More sharing options...
Rickzzs Posted April 5, 2023 Share Posted April 5, 2023 (edited) 2 hours ago, GodIess said: Why is everything so complicated, everything in me breaks and doesn’t work , writing code is much easier You should extract a new animation from the beginning, because every skin doesn't share a same build.bin. That is to say, the scale and position of images are different. And if you use my template, you should work on the default spear build instead of wigfrid's spear build. For dyn format that is not a necessity, and if you want you can contact Hornet as suggested by Gearless. For testing purpose, you can always name your build as "spear" to replace the default build, thus you don't need even a line of code to display the skin. As for skin API I will recommend Glassic API for its simplicity and open source. You need to call "CreatePrefabSkin" and "RegisterInventoryItemAtlas" on your own, and call "GlassicAPI.SkinHandler.AddModSkins({prefab = {your skinn names,...},...})" Edited April 5, 2023 by Rickzzs Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628159 Share on other sites More sharing options...
GodIess Posted April 5, 2023 Author Share Posted April 5, 2023 (edited) 11 hours ago, Rickzzs said: You should extract a new animation from the beginning, because every skin doesn't share a same build.bin. That is to say, the scale and position of images are different. And if you use my template, you should work on the default spear build instead of wigfrid's spear build. For dyn format that is not a necessity, and if you want you can contact Hornet as suggested by Gearless. For testing purpose, you can always name your build as "spear" to replace the default build, thus you don't need even a line of code to display the skin. As for skin API I will recommend Glassic API for its simplicity and open source. You need to call "CreatePrefabSkin" and "RegisterInventoryItemAtlas" on your own, and call "GlassicAPI.SkinHandler.AddModSkins({prefab = {your skinn names,...},...})" thanks for the advice, I used GlassicAPI and was able to add a skin without a dyn file, I don't know how but I managed to make it a normal size, but the last problem is that there is no animation on the ground. "The spear below the normal skin" table.insert(prefabs, CreatePrefabSkin("ms_spear_wathgrithr_aloy", { assets = { Asset( "ANIM", "anim/ms_spear_wathgrithr_aloy.zip"), --Asset( "DYNAMIC_ANIM", "anim/ms_spear_wathgrithr_aloy.zip"), --Asset( "PKGREF", "anim/ms_spear_wathgrithr_aloy.dyn"), }, base_prefab = "spear_wathgrithr", build_name_override = "ms_spear_wathgrithr_aloy", type = "item", rarity = "ModMade", init_fn = GlassicAPI.BasicInitFn, -- GlassicAPI skin_tags = { "SPEAR_WATHGRITHR", "ALOY", "CRAFTABLE", }, })) modmain.lua GlassicAPI.RegisterItemAtlas("ms_spear_wathgrithr_aloy", Assets) GlassicAPI.SkinHandler.AddModSkins({spear_wathgrithr = { "ms_spear_wathgrithr_aloy" },}) Edited April 5, 2023 by GodIess Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628209 Share on other sites More sharing options...
Rickzzs Posted April 5, 2023 Share Posted April 5, 2023 (edited) What do you mean? If it is transparent ground anim I suggest you look at build.xml to make sure autocompiler.exe doesn't mess it up. To check build.xml I have provided detailed tutorial. The duration and framenum must match. I am assuming you have done all your artwork correctly. edit: also it is meaningless to add ms_ prefix if you are not using modded skins. Actually this prefix can somehow conflict with game's naming rule so that the c++ engine may not recognize the build name as a skin, which I suspect is what modded skins intends to. Edited April 5, 2023 by Rickzzs Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628212 Share on other sites More sharing options...
GodIess Posted April 5, 2023 Author Share Posted April 5, 2023 build.xml in scml i have animation.xml 20 minutes ago, Rickzzs said: What do you mean? If it is transparent ground anim I suggest you look at build.xml to make sure autocompiler.exe doesn't mess it up. To check build.xml I have provided detailed tutorial. The duration and framenum must match. I am assuming you have done all your artwork correctly. right? or 2 Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628216 Share on other sites More sharing options...
Rickzzs Posted April 5, 2023 Share Posted April 5, 2023 (edited) compare your build.xml with the default item's build.bin. If they don't match, edit it and run buildanimation.py as I said in tutorial. Edited April 5, 2023 by Rickzzs Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628217 Share on other sites More sharing options...
GodIess Posted April 5, 2023 Author Share Posted April 5, 2023 (edited) 4 hours ago, Rickzzs said: порівняйте свій файл build.xml із файлом build.bin елемента за замовчуванням. Якщо вони не збігаються, відредагуйте його та запустіть buildanimation.py, як я сказав у посібнику. I thought I was going crazy until I found out what I was doing wrong I opened the scml and changed the id of the files, but I still don't understand why 5 6 7 doesn't work like that, I left 1 2 3 Edited April 5, 2023 by GodIess Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628228 Share on other sites More sharing options...
Rickzzs Posted April 7, 2023 Share Posted April 7, 2023 (edited) Actually I think if you want to make more skins in the future there is a need for a whole pipeline to build your animation, including fixing scml, compiling, fixing build.xml, copying, deleting anim.bin. I'm looking forward to, say, things like this, nice artstyle. And by the way, if you want to claim your copyright of your artwork you can use a little Python. Spoiler import os def build_atlas_zip(filename): dest = os.path.splitext(filename)[0] + '.dynamicanim' out = bytearray(8) key = bytearray([(0x8D + i) for i in range(8)]) indices = [5, 3, 6, 7, 4, 2, 0, 1] with open(filename, 'rb') as file, open(dest, 'wb') as output: chunk = file.read(8) while len(chunk) == 8: for i in range(8): out[indices[i]] = chunk[i] ^ key[i] output.write(out) chunk = file.read(8) output.write(chunk) return dest Edited April 7, 2023 by Rickzzs Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628523 Share on other sites More sharing options...
GodIess Posted April 7, 2023 Author Share Posted April 7, 2023 (edited) 36 minutes ago, Rickzzs said: Actually I think if you want to make more skins in the future there is a need for a whole pipeline to build your animation, including fixing scml, compiling, fixing build.xml, copying, deleting anim.bin. I'm looking forward to, say, things like this, nice artstyle. And by the way, if you want to claim your copyright of your artwork you can use a little Python. Hide contents import os def build_atlas_zip(filename): dest = os.path.splitext(filename)[0] + '.dynamicanim' out = bytearray(8) key = bytearray([(0x8D + i) for i in range(8)]) indices = [5, 3, 6, 7, 4, 2, 0, 1] with open(filename, 'rb') as file, open(dest, 'wb') as output: chunk = file.read(8) while len(chunk) == 8: for i in range(8): out[indices[i]] = chunk[i] ^ key[i] output.write(out) chunk = file.read(8) output.write(chunk) return dest I think I'm doing something wrong. in the archive only atlas-0.tex. Edited April 7, 2023 by GodIess Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628533 Share on other sites More sharing options...
Rickzzs Posted April 7, 2023 Share Posted April 7, 2023 43 minutes ago, GodIess said: I think I'm doing something wrong. in the archive only atlas-0.tex. You should use python3 Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628538 Share on other sites More sharing options...
GodIess Posted April 7, 2023 Author Share Posted April 7, 2023 26 minutes ago, Rickzzs said: You should use python3 Unbelievable :3 Thank you so much for all your advice and corrections. Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1628541 Share on other sites More sharing options...
hilber_angers Posted September 30, 2023 Share Posted September 30, 2023 this skin is beautiful,but it seems that i have never saw it in any mod. Could you share your creation? Link to comment https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/#findComment-1668691 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