[CofEdit] How to create a .cof file with 2 layers?

This would be the forum for questions about how to work with mod making tools which can be a problem of its own.

Moderator: Paul Siramy

User avatar
jetaman
Hosted Forum Moderator
Champion of the Light
Posts: 318
Joined: Sat Jul 18, 2015 7:00 pm
Location: Ukraine
Ukraine

Hand-picked

[CofEdit] How to create a .cof file with 2 layers?

Post by jetaman » Wed Dec 09, 2015 8:31 pm

Hello. I want to create a single .cof file from 2 different .dcc files and I need to put them into two layers? How do I do that?
In the .ini file I see this:
dcc_file = WEtrlitnuhth.dcc
# A1 A2 S1 SC NU GH WL RN DD DT TN TW

cof_token = WE
cof_mode = NU
cof_class = HTH

nb_layers = 1

xmin = -512
xmax = 512
ymin = -512
ymax = 512

trigger_value =0
trigger_frame =0

layer_order = 01

layer_composit_01 = 01
transparency_01 = NO
layer_class_01 = hth

I see the "number of layers" row, but what sould I write in this ini file to tell the program to read 2 files instead of 1?

Thanks

[Solved]
Last edited by jetaman on Thu Dec 17, 2015 10:20 pm, edited 3 times in total.

User avatar
Okapi
Junior Member
Paladin
Posts: 151
Joined: Sat Feb 26, 2011 7:40 pm

Re: [Cof Editor] How to create a .cof file with 2 layers?

Post by Okapi » Fri Dec 11, 2015 6:50 pm

Hello,

You'll have to tell in which order the game will read the .cof file.

Here's an output of PATNHTH.cof:
nb_layers = 8 (number of parts the unit uses)

layer_order = 02 03 01 08 04 09 07 00 (part order to tell which part will overlap which (this is tied with "layer_composit" AFAIK), see composit.txt and/or below for part codes)

layer_composit_01 = 02
transparency_01 = NO
layer_class_01 = 1hs

layer_composit_02 = 03
transparency_02 = NO
layer_class_02 = hth

layer_composit_03 = 01
transparency_03 = NO
layer_class_03 = 1hs

layer_composit_04 = 08
transparency_04 = NO
layer_class_04 = 1hs

layer_composit_05 = 00
transparency_05 = NO
layer_class_05 = 1hs

layer_composit_06 = 04
transparency_06 = NO
layer_class_06 = 1hs

layer_composit_07 = 07
transparency_07 = NO
layer_class_07 = 1hs

layer_composit_08 = 09
transparency_08 = NO
layer_class_08 = 1hs
Composit.txt
[code]Name Token
Head HD #00
Torso TR #01
Legs LG #02
RightArm RA #03
LeftArm LA #04
RightHand RH #05
LeftHand LH #06
Shield SH #07
Special1 S1 #08
Special2 S2 #09
Special3 S3 #10
Special4 S4 #11
Special5 S5 #12
Special6 S6 #13
Special7 S7 #14
Special8 S8 #15
[/code]


A bit of trial and error is involved.

Hope this helps.

Cheers,

~Okapi

User avatar
jetaman
Hosted Forum Moderator
Champion of the Light
Posts: 318
Joined: Sat Jul 18, 2015 7:00 pm
Location: Ukraine
Ukraine

Hand-picked

Re: [Cof Editor] How to create a .cof file with 2 layers?

Post by jetaman » Thu Dec 17, 2015 10:38 pm

Thanks Okapi,
It helped me a lot. The only thing that I had to figure out, is how to tell the program to read 2 dcc files. I just put two lines together. Here is the full code what I used to create the animation below.

dcc_file = WEtrlitnuhth.dcc
dcc_file = WEs2litnuhth.dcc
# A1 A2 S1 SC NU GH WL RN DD DT TN TW

cof_token = WE
cof_mode = NU
cof_class = HTH

nb_layers = 2

xmin = -512
xmax = 512
ymin = -512
ymax = 512

trigger_value =0
trigger_frame =0

layer_order = 09 01

layer_composit_01 = 09
transparency_01 = NO
layer_class_01 = hth

layer_composit_02 = 01
transparency_02 = NO
layer_class_02 = hth

Image

*****************************************
EDIT: 17.12.2015

I need some further help with COFEDIT and MergeDCC. I will decribe my objective and my actions. Please, tell me where is the problem.

The objective is to create new item animations on a character. Let's take a helm, for example.
Image
I can't replace the existing dcc files with this, because there is no head here.
So, I used the method described above. I extracted Sorceress head animation (lit=no helm) and took my new helm animation and created a cof file with 2 layers with COFEDIT. Then, using MergeDCC I combined these two separate dcc files into one.
Image
But the problem I'm having is that, when I run MergeDCC, as a result I get only 8 bmp files, that means the animation of only 1 direction (the one you see above). Can anyone tell how do I get the other directions?

Possible problem:
New helm animation has 12 frames and 8 directions, while Sorc head (NU mode) has 8 frames and 16 directions.

I would really appreciate your help guys. If I learn how to do that, I'm gonna create some new good-looking animations, and not only for head.

User avatar
Void Weaver
Dark Alliance Beta Test
Warrior
Posts: 11
Joined: Sun Apr 03, 2011 2:06 am

Re: [CofEdit] How to create a .cof file with 2 layers?

Post by Void Weaver » Tue Mar 27, 2018 6:18 am

Hi there, your conversation really helped me. Thank you very much, guys!
jetaman wrote:
Thu Dec 17, 2015 10:38 pm
But the problem I'm having is that, when I run MergeDCC, as a result I get only 8 bmp files, that means the animation of only 1 direction (the one you see above). Can anyone tell how do I get the other directions?

Possible problem:
New helm animation has 12 frames and 8 directions, while Sorc head (NU mode) has 8 frames and 16 directions.
But now I have a similar problem - I can't make a appropriate .cof from "willodeathoverlay.dcc" and "wwtrlitdt(dd)hth.dcc" for MergeDCC, becuse the wisp's overlay has 20 frames and 1 direction, while its death\corpse animations has 9\8 (DT layer) and 1\8 (DD layer) frames\directions accordingly.

So if anybody has already solved this trouble, I would be very appreciate too.

User avatar
jetaman
Hosted Forum Moderator
Champion of the Light
Posts: 318
Joined: Sat Jul 18, 2015 7:00 pm
Location: Ukraine
Ukraine

Hand-picked

Re: [CofEdit] How to create a .cof file with 2 layers?

Post by jetaman » Tue Mar 27, 2018 6:56 am

The solution is to first match the number of frames. So you need to shorten the overlay animation.
Then you need to multiply those frames 8 times to match 8 directions. Then it should work.

User avatar
Void Weaver
Dark Alliance Beta Test
Warrior
Posts: 11
Joined: Sun Apr 03, 2011 2:06 am

Re: [CofEdit] How to create a .cof file with 2 layers?

Post by Void Weaver » Tue Mar 27, 2018 7:46 am

jetaman wrote:
Tue Mar 27, 2018 6:56 am
So you need to shorten the overlay animation.
9 - 20 = 11 frames for removing... it's not good.
Hmm... but what about adding a "blank" frames to the shorter animation set? Will it works?

Btw, I had notice what order of the "dcc_file = " lines does matter for output .cof, so if I'll put:

Code: Select all

dcc_file = WWTRLITDTHTH.dcc
dcc_file = WWS2LITDTHTH.dcc
I'll get .cof which will be produce 8-direction TR sprites by MergeDCC. But if I'll put the same files in opposite order:

Code: Select all

dcc_file = WWS2LITDTHTH.dcc
dcc_file = WWTRLITDTHTH.dcc
then I'll get .cof which will be produce 1-direction overlay frames. That's looks a bit odd.

jetaman wrote:
Tue Mar 27, 2018 6:56 am
Then you need to multiply those frames 8 times to match 8 directions.
Oh, I didn't even think about this, but... how exactly I should do it?

User avatar
jetaman
Hosted Forum Moderator
Champion of the Light
Posts: 318
Joined: Sat Jul 18, 2015 7:00 pm
Location: Ukraine
Ukraine

Hand-picked

Re: [CofEdit] How to create a .cof file with 2 layers?

Post by jetaman » Tue Mar 27, 2018 7:57 am

Actually the cof ini will read only one line of dcc file so putting two lines
dcc_file = WWS2LITDTHTH.dcc
dcc_file = WWTRLITDTHTH.dcc
makes no sense. I thought it matters but in fact it doesn't.
You must extract frames with cv5 tool. Then use Gif Movie gear to make a larger gif with 8 times more frames
. Then save it as dcc again.
AND don't forget to put 2 layers in the cof ini.

User avatar
Void Weaver
Dark Alliance Beta Test
Warrior
Posts: 11
Joined: Sun Apr 03, 2011 2:06 am

Re: [CofEdit] How to create a .cof file with 2 layers?

Post by Void Weaver » Tue Mar 27, 2018 8:24 am

So, I must:
a) extract all 20 frames of 1-directioned overlay by CV 5.2;
b) delete 11 excessive frames;
c) then to use Gif Movie gear to multiply those frames 8 times;
d) pack them into a new 8-directioned overlay .dcc; aaand finally
e) use the new .dcc into cofedit, right?

User avatar
jetaman
Hosted Forum Moderator
Champion of the Light
Posts: 318
Joined: Sat Jul 18, 2015 7:00 pm
Location: Ukraine
Ukraine

Hand-picked

Re: [CofEdit] How to create a .cof file with 2 layers?

Post by jetaman » Tue Mar 27, 2018 8:33 am

Yes so far everything looks correct. Let me know if you manage to do it.

User avatar
Void Weaver
Dark Alliance Beta Test
Warrior
Posts: 11
Joined: Sun Apr 03, 2011 2:06 am

Re: [CofEdit] How to create a .cof file with 2 layers?

Post by Void Weaver » Tue Mar 27, 2018 1:20 pm

It was not easy. But it was worth it.
At first, I really deleted superfluous overlay frames until their number matched the frames of the dying sprites (DT). Then a lot of time I was spent on the offsets adjusting. But when I began to glue whole together I found what sprites looks too clumsy: because either DT had been partially overlapped by overlay frames, or the overlay was overlapped by the DT ones.

Then I have decided to try do the same by my sumption - to ADD missed frames of the 8-directional corpse (DD) up to 20 per direction, and in the same time multiply wisp's overlay frames up to full set of 8 directions.

And finaly I had got it! Image

Btw, when I have found tonight this topic I immediately solved my old trouble with merging High Priest's red lightning to his casting animation; but it was MUCH easier and faster than this headache with the soul's animations. Image

Thank you very much, bro!
Bookmarked & Subscribed this useful thread. :D

User avatar
jetaman
Hosted Forum Moderator
Champion of the Light
Posts: 318
Joined: Sat Jul 18, 2015 7:00 pm
Location: Ukraine
Ukraine

Hand-picked

Re: [CofEdit] How to create a .cof file with 2 layers?

Post by jetaman » Tue Mar 27, 2018 1:55 pm

You are welcome. I am glad I could help.

Return to “Tools”