[Silkroad online-GUIDE] Changing Seal Glows

View previous topic View next topic Go down

[Silkroad online-GUIDE] Changing Seal Glows

Post  pyuyd on Tue Apr 01, 2008 4:11 am

This will not be as easy as most other PK2 edits. Try not to give up too easily. Before you do anything back up your PK2 files. Also keep in mind standard editing procedure like making sure your file sizes are the same. File sizes shouldn't be an issue with this tutorial however because you can complete it without ever going into INS mode on your hex editor. This is just a quickie but I think it should be sufficient for the more skilled PK2 editors.

1. Open up Media.pk2 in PK2Extractor and extract resinfo\itemrare.txt.
2. Look in that file for the equipment you want to change the glow of.
3. It can reference either one or two EFP files. Write down their paths.
4. Open up Particles.pk2 in PK2Extractor and go into the system directory (every seal glow EFP is in there).
5. Extract whichever ones you wrote down. To do mine I had to extract system_rareshield_a.efp for my shield, system_raretype_b_step1.efp for the mist on my blade, and system_raretype_b_step1_add.efp for the sparkle on my blade.
6. Open up your EFP files one by one in your hex editor and go through the following process:

6a. You will see garbled stuff alongside readable words. Look (scroll down if you need to) until you find "DiffuseGraph", "SetGraphDiffuse", or "BlendDiffuseGraph". These are where the color triplets are located.
6b. I've noticed there is a sort of pattern to how these three categories are layed out:

DiffuseGraph
1. Variable length header
2. Five byte unknown
2a. Three byte triplet
3. Five byte footer



SetGraphDiffuse
1. Eighteen byte header
2. Three byte triplet
2a. One byte unknown
3. Five byte footer



BlendDiffuseGraph
1. Sixteen byte header
2. Three byte triplet
2a. Five byte unknown
3. No foote


I provided some sample hex to help you visualize. Red is the header, blue is unknown bytes, green is the triplets, and yellow is the footer.

6c.Now that you know where to spot them, you can replace each set of color triplets in the file. Note that they are in the BGR color space. This means that the first byte represents blue, the second represents green, and the third represents red. Also, lowering the value of a byte just makes that color less opaque. This means that if you have FFFFFF for your triplet you will get white, if you have 000000 you will get no color (the seal won't show up), and if you have 0000FF you will get pure red. You can do a simple hue shift to RGB/CMY by taking the highest and lowest values in the triplet and assigning the highest value to the color you want (for CMY you will need to assign it to two colors, green and blue for cyan, blue and red for magenta, or red and green for yellow). Then fill in what's left with the lowest value. For instance, if you come across a triplet "A06B52" that will translate to "526BA0" in the RGB color space. Say you want to change it to yellow. The highest value is A0 for blue, the lowest is 52 for red. Changing this triplet to yellow would yield "A0A052", with the highest values as red and green and the blue taking the lowest value. Flip it back around and you get "52A0A0" which you can then enter in your hex editor. Of course, if you get used to the BGR color space you don't have to worry so much about the flipping.

6d.Once you are finished changing every set of triplets in the file save it as a *.mod.efp (to keep the original handy, just in case) and move on the the next on your list.7.Once you have all your files the last step is of course injecting back into Particles.pk2. I assume you know how to do this by now if you've gotten this far. You might hit a snag because EFP files often reuse chunks of data so it might be hard to find a unique set of bytes to base your search off of. Once you do find the right file though you can figure out exactly now many files down (or up) the next file you need to replace is by counting them out in PK2Extractor (the files are in alphabetical order in the PK2 file).

8.Once you've got all your files injected save Particles.pk2, start up SRO, and hope to God you didn't screw up.
Here's the results:


I will try to keep this thread updated if I find anything new (perhaps editing the other parts of the EFP file).
http://www.ogpal.com/news/silkload/2007/07/10/203.html
avatar
pyuyd

Posts : 106
Join date : 2008-03-29

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum