How to Add Roster Icons [For Dummies]
Feb 14, 2017 20:20:13 GMT
Zealot Tormunds and PayDay like this
Post by Kuroha Saenoki on Feb 14, 2017 20:20:13 GMT
This is just my .txt listing the steps, in a very.. detailed manner, hence the For Dummies
I'll be posting a video soon, but for now I wanna post the text guide here.
HxD:
Download Link
CPK Unpacker:
Download Link
CPK Repacker:
Download Link
JPEXS/FFDec:
Download Link
Photoshop DDS Plugin:
Download Link
I'll be posting a video soon, but for now I wanna post the text guide here.
1. Create an icon and place it onto a roster texture, don't close it
You should add the icon onto one of these textures:
charicon_s_I1.dds
charicon_s_IB.dds
charicon_s_I43.dds
charicon_s_I4.dds
Put the texture somewhere where it's obviously not overlapping, and make sure the square has alpha.
Although you could even create your own texture.dds to stick icons, but it's easiest this way.
Resizing the image or creating a new texture requires afew extra steps.
2. Create a 'Root' folder, within this folder
create these folders: data\ui\flash\OTHER\charicon_s
3. Within charicon_s, copypaste the texture.xfbin
which you're going to be using as a base
I'm going to be using charicon_s_l4.xfbin
4. Open your xfbin in HxD or another hex editor
Offset 128-12B is your file length
Offset 11C-11F is your file length + 4
5. Back to your icon, we need to save it as DDS, DXT5
For this tutorial, I'm using Photoshop. So yeah, Photoshop.
6. Open your DDS in HxD, copy it all
7. If your image is 10 00 80 bytes,
put your cursor behind the 'DDS' and press CTRL+B
This will paste it all in without adding new lines of code.
If it's above or below, 10 00 80, change the file size codes
example: if your new DDS length is 12C080 bytes long,
Offset 128-12B: 0012C080
Offset 11C-11F: 0012C084
put your cursor behind the 'DDS' and press CTRL+E
copy the 'Start Offset', it should be '12C'
then scroll all the way down to the bottom of the page
put your cursor behind the last byte of texture
00 00 00 08 is the end of the texture.
So if you see 55 55 55 55 00 00 00 08
You'd make it look like 55 55 55 |55 00 00 00 08
press CTRL+E again, paste the Start Offset in,
you should get the original file size code as your length
go back to your DDS, copy it, CTRL+V it in your xfbin, save.
8. Go to your data/patch/#/
This will contain the CPK files for the latest patch
Copy the 'sound.cpk' (or the smallest one, sound is usually the smallest)
9. Paste your sound.cpk inside the CPK Unpacker folder
Double click on '1-EXTRACT_ALL(no_decompression).bat'
All the files in the sound.cpk are already unpacked
so when the CMD popup is done and goes away,
Drag the 'data' folder it gave you into the 'Root'
folder you created earlier.
10. Check the inside of your 'Root'
it should be Root\data\sound and
Root\data\ui\flash\OTHER\charicon_s
11. Open CPKTools (inside CPK Repacker)
Set the data alignement to 512, Uncheck all boxes
Select your 'Root' folder, and save it as Sound.cpk
in the same location as your data/patch/#/
(MAY WANT TO BACKUP YOUR SOUND.CPK, UP TO YOU THOUGH)
12. Go to: data\ui\flash\OTHER\charicon_s
This is where the hard stuff comes into play.
MAKE A BACKUP OF CHARICON_S.GFX
13. Open Charicon_s.gfx in HxD
14. In HxD, search for: skr6 (the last icon thus far of this tutorial: Update 1.07)
These sections are 14 Bytes long, starting with FF 0A, and ending with 40 00
Right before the 40 00 is the ID, skr6 its "84 01"
When you copy paste your new 14 Bytes, +2 on the ID
so for your first peep, it would be 86 01.
Then rename the chr# to what you want (try to match preexisting icons)
like, Momoshikis icon is msk1, you can tell this by unpacking his texture icons)
Now remember, for each 14 bytes = 1 Section
Also, make sure you put your amount of bytes added in two calculators (or not if you're a math wiz)
15. Search backwards for 'brank_oth', before the "FF0A"
you should see BE 00, this is how many sections there are
so if you added only 14 bytes, BE + 1 = BF 00
you should also see a F4 0E, this is a file length code,
it's actually 0E F4, so do 0EF4 + ( 14 * ? )
? is how many 14s you added
0EF4 + 14 = 0F08 = 080F, put the 080F in there.
16. Right before the FF 09, is the shape/subimage
highlight 47 bytes behind the FF 09, and copy paste how many you're going to add
after the 0C FC is the 'ID', make it -1 of your ID from before.
before was: 84 01, now this would be 83 01
(or just +2 to it like before, since it's 81 01)
on the next line, there's another ID,
(14 Length, starting on 0CFC onwards)
This one matches the ID from below
and once more, on the next line, there's another ID
(29 Length, starting on 0CFC onwards)
This matches your ID beside 0CFC
So it should be: 0CFC 8101, 8201, 8101
(comma's are breaks for all the extra coding)
now, since we're just adding 1 icon
we need to add both: 14 bytes & 47 bytes since that's how many in total we've added for that one
(14 + 47) * ?
14 + 47 * 1 = 5B
17. now scroll to the VERY top of the file
you should find a C0 E8 00 00
that's the File Size of the whole file
C0 E8 = E8 C0 + 5B = E9 1B = 1B E9 00 00
Save and Close HxD, you're done Hexing, yaaaay.
18. Open Charicon_s In FFDec/JPEXS
(Say no to all to the popups)
Open the Sprites Folder, then open the DefineSprite (387)
The (387) is based on the last 'CharacterID', since your last one is 388, we need it to become 389
You can check your last CharacterID by going into the last Frame, then into the PlaceObject2 (###)
We need to update the DefineSprite, so right click it: Raw Edit
Click edit, then change 387 to 389
19. Next we need to do the same to DefineSprite (389)
Right click, Raw Edit, Edit, change 388 to 390
20. Open DefineSprite (390) (the one we just changed)
Open Frame 1, click on PlaceObject2(387)
edit, change 387 to 389
21. Open frames,
Open frame 1, click on PlaceObject2(388)
edit, change 388 to 390
22. Open others,
scroll all the way down, click on SymbolClass
Open/Expand the section of symbols
edit, change 387 to 389
Save the File
23. Go back to your image (in Photoshop),
put the image in the 'Rectangular Marquee'
Try to get it as pixel perfect as possible.
(Alternatively you can go into the Alpha, use the QuickSelect/MagicWand to select the alpha, then go back to the RGB)
Press Ctrl+T to get into 'Transform mode'
There should be a box with 8 other boxes around it
That thing will give you the codes you need
------------------------------------
imageCharacterId: int:
0 = charicon_s_I1.dds
1 = charicon_s_IB.dds
2 = charicon_s_I43.dds
3 = charicon_s_I4.dds
x1: Top Left (X)
y1: Top Left (Y)
x2: Bottom Right (X)
y2: Bottom Right (Y)
------------------------------------
So, click on the top left box and the X & Y beside it will change
DO NOT EDIT THESE.
Mine are:
x1: 259
y1: 780
then click on the bottom right box
and:
x2: 388
y2: 909
Okay, Back to JPEXS
24. Click on the SubImage that matches your characters ID, -1
(In the Hex, when we added the chr# with the ID)
So it would be 84 01 = 184 in Hex,
JPEXS works in Decimal, so 184 = 388 - 1 = 387.
then from there use the chart above to code your SubImage
Save JPEXS, and make a backup of your new .GFX
If you screwed up somewhere and launch Storm 4,
the game likes to destory your broken GFX,
removing bytes off the bottom for some reason.
25. If you resized the image:
Make sure you put all the preexisting icons on the top left,
pixel perfectly, along with the Alpha layer.
Afterwards go to the 'DefineExternalImage2' that matches your image
and input the canvas sizes for your texture.
26. If you added a new image for your textures:
You'd have to go back into HxD, and find a preexisting
'DefineExternalImage2', copy it, paste it, and rename the filename String in JPEXS
An easy way to find it would be to use JPEXS's 'Hex Dump'
and go to the spot it shows in the coding (using CTRL+G in HxD)
Remember, adding code means you need to add to the very top again.
27. Images transparent?
Make absolute sure you have the following:
A. Alpha Layers, when you save the DDS file,
you should be able to see the texture in a preview
B. Correct 'DefineExternalImage2'
C. Correct x1,y1,x2,y2 coding
D. If the rest are correct, Player_icon.xfbin most likely will be the reason
28. Player_icon, Get the latest player_icon from: data\spc\WIN64
Place it within your Root and Repack or the Data_win32, using the same pathways ofc.
I'm going to use Awakened Momoshiki for this example
29. Open 'player_icon.xfbin' with HxD
Scroll down to the bottom and copy paste an ID (8 bytes)
(As of right now, nxs1 is the last ID)
I'm going to call mine 'msk2' since msk1 is normal Momoshiki
30. Scroll to the top
The first '54' to the next '54' is a section
The 54 is a Characode, it happens to be 3nrt
on the second section, you see: 54 00 00 00 06
That means Costume 06 (corresponds with Duelplayerparam and Playersettingparam)
but anyways, I'm going to copy 54 to the next 54 and paste a new section (28 bytes)
31. Now, we need the Characode of the guy we're doing
I'm doing Momoshiki Awakened so mine is 7mmv = D7
and he's not a costume or anything so that byte is 00
D7 00 00 00 00
32. The next 4 sections (B835, B835, C035, and the 00 00 under B835)
are various linkers going to the code below, I'm just going to link all to msk2
Search forward to msk2 (or whatever you did)
put your cursor one byte behind the 'm', so it looks like: ...|.msk2
Press CTRL+E and copy the 'Start Offset', which is 5AAB for me.
Scroll all the way up again,
put your cursor on the B835, so it looks like: ....|B835
Press CTRL+E and paste in the 'End Offset',
if the length code doesn't update,
change to Dec, then back to Hex
I got: 5978, so I'll flip it, 7859 and put that as the code
and proceed to do the rest of the IDs
33. Lastly, we need to do the File Size code and the Section Code
5801 = How many sections, since we added 1, 8 byte code on the bottom
we'll add 1 to 5801
5801 = 0158 + 1 = 0159 = 59 01, easy peasy.
then 5968 is the file length
5968 + 28 + 8 = 5998
then 596C is the file length + 4
so 5998 + 4 = 599C
NOTICE: IT'S VERY IMPORTANT YOU PUT YOUR BYTES ON TOP AND ON THE VERY BOTTOM OF THE FILE
IF YOU PLACE IT ANYWHERE ELSE, IT'LL BREAK ALL THE LINKERS IN BETWEEN
You should add the icon onto one of these textures:
charicon_s_I1.dds
charicon_s_IB.dds
charicon_s_I43.dds
charicon_s_I4.dds
Put the texture somewhere where it's obviously not overlapping, and make sure the square has alpha.
Although you could even create your own texture.dds to stick icons, but it's easiest this way.
Resizing the image or creating a new texture requires afew extra steps.
2. Create a 'Root' folder, within this folder
create these folders: data\ui\flash\OTHER\charicon_s
3. Within charicon_s, copypaste the texture.xfbin
which you're going to be using as a base
I'm going to be using charicon_s_l4.xfbin
4. Open your xfbin in HxD or another hex editor
Offset 128-12B is your file length
Offset 11C-11F is your file length + 4
5. Back to your icon, we need to save it as DDS, DXT5
For this tutorial, I'm using Photoshop. So yeah, Photoshop.
6. Open your DDS in HxD, copy it all
7. If your image is 10 00 80 bytes,
put your cursor behind the 'DDS' and press CTRL+B
This will paste it all in without adding new lines of code.
If it's above or below, 10 00 80, change the file size codes
example: if your new DDS length is 12C080 bytes long,
Offset 128-12B: 0012C080
Offset 11C-11F: 0012C084
put your cursor behind the 'DDS' and press CTRL+E
copy the 'Start Offset', it should be '12C'
then scroll all the way down to the bottom of the page
put your cursor behind the last byte of texture
00 00 00 08 is the end of the texture.
So if you see 55 55 55 55 00 00 00 08
You'd make it look like 55 55 55 |55 00 00 00 08
press CTRL+E again, paste the Start Offset in,
you should get the original file size code as your length
go back to your DDS, copy it, CTRL+V it in your xfbin, save.
8. Go to your data/patch/#/
This will contain the CPK files for the latest patch
Copy the 'sound.cpk' (or the smallest one, sound is usually the smallest)
9. Paste your sound.cpk inside the CPK Unpacker folder
Double click on '1-EXTRACT_ALL(no_decompression).bat'
All the files in the sound.cpk are already unpacked
so when the CMD popup is done and goes away,
Drag the 'data' folder it gave you into the 'Root'
folder you created earlier.
10. Check the inside of your 'Root'
it should be Root\data\sound and
Root\data\ui\flash\OTHER\charicon_s
11. Open CPKTools (inside CPK Repacker)
Set the data alignement to 512, Uncheck all boxes
Select your 'Root' folder, and save it as Sound.cpk
in the same location as your data/patch/#/
(MAY WANT TO BACKUP YOUR SOUND.CPK, UP TO YOU THOUGH)
12. Go to: data\ui\flash\OTHER\charicon_s
This is where the hard stuff comes into play.
MAKE A BACKUP OF CHARICON_S.GFX
13. Open Charicon_s.gfx in HxD
14. In HxD, search for: skr6 (the last icon thus far of this tutorial: Update 1.07)
These sections are 14 Bytes long, starting with FF 0A, and ending with 40 00
Right before the 40 00 is the ID, skr6 its "84 01"
When you copy paste your new 14 Bytes, +2 on the ID
so for your first peep, it would be 86 01.
Then rename the chr# to what you want (try to match preexisting icons)
like, Momoshikis icon is msk1, you can tell this by unpacking his texture icons)
Now remember, for each 14 bytes = 1 Section
Also, make sure you put your amount of bytes added in two calculators (or not if you're a math wiz)
15. Search backwards for 'brank_oth', before the "FF0A"
you should see BE 00, this is how many sections there are
so if you added only 14 bytes, BE + 1 = BF 00
you should also see a F4 0E, this is a file length code,
it's actually 0E F4, so do 0EF4 + ( 14 * ? )
? is how many 14s you added
0EF4 + 14 = 0F08 = 080F, put the 080F in there.
16. Right before the FF 09, is the shape/subimage
highlight 47 bytes behind the FF 09, and copy paste how many you're going to add
after the 0C FC is the 'ID', make it -1 of your ID from before.
before was: 84 01, now this would be 83 01
(or just +2 to it like before, since it's 81 01)
on the next line, there's another ID,
(14 Length, starting on 0CFC onwards)
This one matches the ID from below
and once more, on the next line, there's another ID
(29 Length, starting on 0CFC onwards)
This matches your ID beside 0CFC
So it should be: 0CFC 8101, 8201, 8101
(comma's are breaks for all the extra coding)
now, since we're just adding 1 icon
we need to add both: 14 bytes & 47 bytes since that's how many in total we've added for that one
(14 + 47) * ?
14 + 47 * 1 = 5B
17. now scroll to the VERY top of the file
you should find a C0 E8 00 00
that's the File Size of the whole file
C0 E8 = E8 C0 + 5B = E9 1B = 1B E9 00 00
Save and Close HxD, you're done Hexing, yaaaay.
18. Open Charicon_s In FFDec/JPEXS
(Say no to all to the popups)
Open the Sprites Folder, then open the DefineSprite (387)
The (387) is based on the last 'CharacterID', since your last one is 388, we need it to become 389
You can check your last CharacterID by going into the last Frame, then into the PlaceObject2 (###)
We need to update the DefineSprite, so right click it: Raw Edit
Click edit, then change 387 to 389
19. Next we need to do the same to DefineSprite (389)
Right click, Raw Edit, Edit, change 388 to 390
20. Open DefineSprite (390) (the one we just changed)
Open Frame 1, click on PlaceObject2(387)
edit, change 387 to 389
21. Open frames,
Open frame 1, click on PlaceObject2(388)
edit, change 388 to 390
22. Open others,
scroll all the way down, click on SymbolClass
Open/Expand the section of symbols
edit, change 387 to 389
Save the File
23. Go back to your image (in Photoshop),
put the image in the 'Rectangular Marquee'
Try to get it as pixel perfect as possible.
(Alternatively you can go into the Alpha, use the QuickSelect/MagicWand to select the alpha, then go back to the RGB)
Press Ctrl+T to get into 'Transform mode'
There should be a box with 8 other boxes around it
That thing will give you the codes you need
------------------------------------
imageCharacterId: int:
0 = charicon_s_I1.dds
1 = charicon_s_IB.dds
2 = charicon_s_I43.dds
3 = charicon_s_I4.dds
x1: Top Left (X)
y1: Top Left (Y)
x2: Bottom Right (X)
y2: Bottom Right (Y)
------------------------------------
So, click on the top left box and the X & Y beside it will change
DO NOT EDIT THESE.
Mine are:
x1: 259
y1: 780
then click on the bottom right box
and:
x2: 388
y2: 909
Okay, Back to JPEXS
24. Click on the SubImage that matches your characters ID, -1
(In the Hex, when we added the chr# with the ID)
So it would be 84 01 = 184 in Hex,
JPEXS works in Decimal, so 184 = 388 - 1 = 387.
then from there use the chart above to code your SubImage
Save JPEXS, and make a backup of your new .GFX
If you screwed up somewhere and launch Storm 4,
the game likes to destory your broken GFX,
removing bytes off the bottom for some reason.
25. If you resized the image:
Make sure you put all the preexisting icons on the top left,
pixel perfectly, along with the Alpha layer.
Afterwards go to the 'DefineExternalImage2' that matches your image
and input the canvas sizes for your texture.
26. If you added a new image for your textures:
You'd have to go back into HxD, and find a preexisting
'DefineExternalImage2', copy it, paste it, and rename the filename String in JPEXS
An easy way to find it would be to use JPEXS's 'Hex Dump'
and go to the spot it shows in the coding (using CTRL+G in HxD)
Remember, adding code means you need to add to the very top again.
27. Images transparent?
Make absolute sure you have the following:
A. Alpha Layers, when you save the DDS file,
you should be able to see the texture in a preview
B. Correct 'DefineExternalImage2'
C. Correct x1,y1,x2,y2 coding
D. If the rest are correct, Player_icon.xfbin most likely will be the reason
28. Player_icon, Get the latest player_icon from: data\spc\WIN64
Place it within your Root and Repack or the Data_win32, using the same pathways ofc.
I'm going to use Awakened Momoshiki for this example
29. Open 'player_icon.xfbin' with HxD
Scroll down to the bottom and copy paste an ID (8 bytes)
(As of right now, nxs1 is the last ID)
I'm going to call mine 'msk2' since msk1 is normal Momoshiki
30. Scroll to the top
The first '54' to the next '54' is a section
The 54 is a Characode, it happens to be 3nrt
on the second section, you see: 54 00 00 00 06
That means Costume 06 (corresponds with Duelplayerparam and Playersettingparam)
but anyways, I'm going to copy 54 to the next 54 and paste a new section (28 bytes)
31. Now, we need the Characode of the guy we're doing
I'm doing Momoshiki Awakened so mine is 7mmv = D7
and he's not a costume or anything so that byte is 00
D7 00 00 00 00
32. The next 4 sections (B835, B835, C035, and the 00 00 under B835)
are various linkers going to the code below, I'm just going to link all to msk2
Search forward to msk2 (or whatever you did)
put your cursor one byte behind the 'm', so it looks like: ...|.msk2
Press CTRL+E and copy the 'Start Offset', which is 5AAB for me.
Scroll all the way up again,
put your cursor on the B835, so it looks like: ....|B835
Press CTRL+E and paste in the 'End Offset',
if the length code doesn't update,
change to Dec, then back to Hex
I got: 5978, so I'll flip it, 7859 and put that as the code
and proceed to do the rest of the IDs
33. Lastly, we need to do the File Size code and the Section Code
5801 = How many sections, since we added 1, 8 byte code on the bottom
we'll add 1 to 5801
5801 = 0158 + 1 = 0159 = 59 01, easy peasy.
then 5968 is the file length
5968 + 28 + 8 = 5998
then 596C is the file length + 4
so 5998 + 4 = 599C
NOTICE: IT'S VERY IMPORTANT YOU PUT YOUR BYTES ON TOP AND ON THE VERY BOTTOM OF THE FILE
IF YOU PLACE IT ANYWHERE ELSE, IT'LL BREAK ALL THE LINKERS IN BETWEEN
HxD:
Download Link
CPK Unpacker:
Download Link
CPK Repacker:
Download Link
JPEXS/FFDec:
Download Link
Photoshop DDS Plugin:
Download Link