Jump to content

Recommended Posts

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

image.png.ec3c0e67ae9b8599872268d3f110772c.pngimage.png.3571b1348dda3415b0defa3472010e62.pngimage.png.bc759251a7d9408b4bf98244e40e0d92.png

Link to comment
https://forums.kleientertainment.com/forums/topic/146899-how-to-add-a-skin/
Share on other sites

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.

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 :wilson_cry:, writing code is much easier

image.thumb.png.1aedb6c28cf5b5e5797851cb3a0afc5a.png

2 hours ago, GodIess said:

Why is everything so complicated, everything in me breaks and doesn’t work :wilson_cry:, writing code is much easier

image.thumb.png.1aedb6c28cf5b5e5797851cb3a0afc5a.png

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 by Rickzzs
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" },})

image.png.bd533b9ab3faceacb8a601a47ab671fc.pngimage.png.9e7463f38e456c62b707e03cdb446e8d.png

Edited by GodIess

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 by Rickzzs

build.xml

image.thumb.png.4ffb1494a6682e6f9a37100b5a49324c.png

in scml i have

image.thumb.png.9c0ea8a95a0c0c9b08bb0303c7267a65.png

animation.xml

image.thumb.png.1e27359e426d0d965526d5c7435ec2e1.png

image.png.dee37ead32fcecc3b2d5161381275511.png

 

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?

image.thumb.png.800017aefa14cec788a5e421994a4439.png

or 2

image.png.78ea6bbf3621b44a31c30803177186bb.png

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

image.png.4a582884596ee55eea4d1daf326d3b7e.png

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

image.png.166e483cccd1912c30c41fbfdee8d990.png

Edited by GodIess

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 by Rickzzs
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.

image.thumb.png.bf57b596e9f8de06c762aff725ce5397.png 

image.png.ac075b2b5c6f9144747d38c7052fb069.png

Edited by GodIess

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...