OBD talk:TRMA
Quoting geyser from Oni Central Forum:
- "Oni characters have a modular design one can take advantage of, by "swapping bones" and authoring all-new textures.
- One can thus create entities more or less closely related to Oni's original ones, possibly with new storyline roles.
- (Ninja Comguys, BGI executives, cyborg enforcers, WCG troops... you name it: it's almost easy - if you're creative)"
I was hoping when you had time, you could explain how this is done.
My thoughts for a simple change might be done is to duplicate an existing ONCC and TRMA link the 2 together and in the TRMA change the TXMP's links. But can this be done with a hex editor or does it still require OUP?
Anyways, no rush, but I think having an example will be very useful for those who want to mod Oni.
EdT
Well I made some progress in adding another character to Oni. I duplicated ONCCk4_G.oni renamed it ONCCk4_H.oni, duplicated TRMATCTFswat_high_texture_generic2 renamed it TRMAk4_H_001_high_texture_generic.oni Fixed the link in the ONCC to point to TRMAk4_H_001_high_texture_generic.oni
Of course Konoko's head was messed up having the SWAT helmet. So then I replaced that part withTXMPIteration002/k4_head and got this:
It seems everything after the head, lost the textures. But I ran out of time to figure out what's wrong. I did all this using a hex editor.
Here's the file if you're interested. http://edt.oni2.net/AE/TRMAk4_H_001a_high_texture_generic.oni
EdT
- This will be moved to OBD_talk:TRMA and elsewhere. We shouldn't be spamming the talk page of such a general introduction with modding details.
- The hack you just did is correct except for the fact that "TXMPIteration002/k4_head" is one char longer than "TXMPIteration002/TChead".
- Thus you pushed all the remaining texture names back one char, screwing up their lookup from the file's header (pointer to first char).
- Since the shift was by one char only, the screw-up is very specific: instead of the leading char of the strings, there's a null char.
- This basically means that the textures after konoko's head now have an empty string as a filename (the null char terminates a string).
- There are 3 ways to avoid such problems.
- One (not recommended) is to use shorter filenames so they don't shift the following ones. I've been using this for, e.g., "ninjabot2".
- Another (recomended) is to edit the addresses of the filenames in the header according to the shifts you introduced. It's a bit of work.
- In your example, you should edit this part (list of named files):
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 00000040 41 4D 52 54 08 00 00 00 00 00 00 00 80 00 00 00 AMRT........€... 00000050 00 00 00 00 50 4D 58 54 00 00 00 00 23 00 00 00 ....PMXT....#... 00000060 00 00 00 00 02 00 00 00 50 4D 58 54 00 00 00 00 ........PMXT.... 00000070 3D 00 00 00 00 00 00 00 02 00 00 00 50 4D 58 54 =...........PMXT 00000080 00 00 00 00 57 00 00 00 00 00 00 00 02 00 00 00 ....W........... 00000090 50 4D 58 54 00 00 00 00 70 00 00 00 00 00 00 00 PMXT....p....... 000000A0 02 00 00 00 50 4D 58 54 00 00 00 00 89 00 00 00 ....PMXT....‰... 000000B0 00 00 00 00 02 00 00 00 50 4D 58 54 00 00 00 00 ........PMXT.... 000000C0 A0 00 00 00 00 00 00 00 02 00 00 00 50 4D 58 54 ...........PMXT 000000D0 00 00 00 00 B9 00 00 00 00 00 00 00 02 00 00 00 ....¹........... 000000E0 50 4D 58 54 00 00 00 00 D1 00 00 00 00 00 00 00 PMXT....Ñ....... 000000F0 02 00 00 00 50 4D 58 54 00 00 00 00 E9 00 00 00 ....PMXT....é... 00000100 00 00 00 00 02 00 00 00 50 4D 58 54 00 00 00 00 ........PMXT.... 00000110 06 01 00 00 00 00 00 00 02 00 00 00 50 4D 58 54 ............PMXT 00000120 00 00 00 00 20 01 00 00 00 00 00 00 02 00 00 00 .... ........... 00000130 50 4D 58 54 00 00 00 00 3A 01 00 00 00 00 00 00 PMXT....:....... 00000140 02 00 00 00 50 4D 58 54 00 00 00 00 52 01 00 00 ....PMXT....R... 00000150 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 ................
- to suit the relative offsets of the filenames in this other part:
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 000001E0 54 52 4D 41 54 43 54 46 73 77 61 74 5F 68 69 67 TRMATCTFswat_hig << starts at 0x00 (relative) 000001F0 68 5F 74 65 78 74 75 72 65 5F 67 65 6E 65 72 69 h_texture_generi 00000200 63 32 00 54 58 4D 50 49 74 65 72 61 74 69 6F 6E c2.TXMPIteration << starts at 0x23 (relative) 00000210 30 30 32 2F 54 43 70 65 6C 76 69 73 00 54 58 4D 002/TCpelvis.TXM << starts at 0x3D (relative) 00000220 50 49 74 65 72 61 74 69 6F 6E 30 30 32 2F 54 43 PIteration002/TC 00000230 74 68 69 67 68 52 00 54 58 4D 50 49 74 65 72 61 thighR.TXMPItera << starts at 0x57 (relative) 00000240 74 69 6F 6E 30 30 32 2F 54 43 63 61 6C 66 52 00 tion002/TCcalfR. 00000250 54 58 4D 50 49 74 65 72 61 74 69 6F 6E 30 30 32 TXMPIteration002 << starts at 0x70 (relative) 00000260 2F 54 43 66 6F 6F 74 52 00 54 58 4D 50 49 74 65 /TCfootR.TXMPIte << starts at 0x89 (relative) 00000270 72 61 74 69 6F 6E 30 30 32 2F 54 43 6D 69 64 00 ration002/TCmid. 00000280 54 58 4D 50 49 74 65 72 61 74 69 6F 6E 30 30 32 TXMPIteration002 << starts at 0xA0 (relative) 00000290 2F 54 43 63 68 65 73 74 00 54 58 4D 50 49 74 65 /TCchest.TXMPIte << starts at 0xB9 (relative) 000002A0 72 61 74 69 6F 6E 30 30 32 2F 54 43 6E 65 63 6B ration002/TCneck 000002B0 00 54 58 4D 50 49 74 65 72 61 74 69 6F 6E 30 30 .TXMPIteration00 << starts at 0xD1 (relative) 000002C0 32 2F 6B 34 5F 68 65 61 64 00 54 58 4D 50 49 74 2/k4_head.TXMPIt << now starts at 0xEA (relative) 000002D0 65 72 61 74 69 6F 6E 30 30 32 2F 54 43 73 68 6F eration002/TCsho 000002E0 75 6C 64 65 72 4C 00 54 58 4D 50 49 74 65 72 61 ulderL.TXMPItera << now starts at 0x107 (relative) 000002F0 74 69 6F 6E 30 30 32 2F 54 43 62 69 63 65 70 52 tion002/TCbicepR 00000300 00 54 58 4D 50 49 74 65 72 61 74 69 6F 6E 30 30 .TXMPIteration00 << now starts at 0x121 (relative) 00000310 32 2F 54 43 77 72 69 73 74 52 00 54 58 4D 50 49 2/TCwristR.TXMPI << now starts at 0x13B (relative) 00000320 74 65 72 61 74 69 6F 6E 30 30 32 2F 54 43 66 69 teration002/TCfi 00000330 73 74 00 54 58 4D 50 49 74 65 72 61 74 69 6F 6E st.TXMPIteration << now starts at 0x153 (relative) 00000340 30 30 32 2F 54 43 73 68 6F 75 6C 64 65 72 52 00 002/TCshoulderR.
- Namely, here's the changes you should make:
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 00000040 41 4D 52 54 08 00 00 00 00 00 00 00 80 00 00 00 AMRT........€... 00000050 00 00 00 00 50 4D 58 54 00 00 00 00 23 00 00 00 ....PMXT....#... 00000060 00 00 00 00 02 00 00 00 50 4D 58 54 00 00 00 00 ........PMXT.... 00000070 3D 00 00 00 00 00 00 00 02 00 00 00 50 4D 58 54 =...........PMXT 00000080 00 00 00 00 57 00 00 00 00 00 00 00 02 00 00 00 ....W........... 00000090 50 4D 58 54 00 00 00 00 70 00 00 00 00 00 00 00 PMXT....p....... 000000A0 02 00 00 00 50 4D 58 54 00 00 00 00 89 00 00 00 ....PMXT....‰... 000000B0 00 00 00 00 02 00 00 00 50 4D 58 54 00 00 00 00 ........PMXT.... 000000C0 A0 00 00 00 00 00 00 00 02 00 00 00 50 4D 58 54 ...........PMXT 000000D0 00 00 00 00 B9 00 00 00 00 00 00 00 02 00 00 00 ....¹........... 000000E0 50 4D 58 54 00 00 00 00 D1 00 00 00 00 00 00 00 PMXT....Ñ....... 000000F0 02 00 00 00 50 4D 58 54 00 00 00 00 EA 00 00 00 ....PMXT....é... 00000100 00 00 00 00 02 00 00 00 50 4D 58 54 00 00 00 00 ........PMXT.... 00000110 07 01 00 00 00 00 00 00 02 00 00 00 50 4D 58 54 ............PMXT 00000120 00 00 00 00 21 01 00 00 00 00 00 00 02 00 00 00 .... ........... 00000130 50 4D 58 54 00 00 00 00 3B 01 00 00 00 00 00 00 PMXT....:....... 00000140 02 00 00 00 50 4D 58 54 00 00 00 00 53 01 00 00 ....PMXT....R... 00000150 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 ................
- As you can see, you have to to do quite some hex math, but nothing exceptional.
3. Finally, you can generate this same TRMA by changing links-by-id in OUP.
- typically, you'd reimport the TRMA you want to mix into a dummy .dat
- (you'd also import both source TRMAs along with their child TXMPs)
- then you'd use OUP make the new TRMA link to other TRMA's TXMP, by ID.
- finally, you'd export the dummy .dat and have an updated new TRMA*.oni
- This may sound cumbersome, but it does the job in this case and many others.
- Actually, I'd recommend OUP in all but the simplest cases (such as TRMA).
- geyser 15:15, 15 February 2008 (CET)
- The actual bastardizing I had in mind doesn't have to do with the TRMA alone.
- It's about swapping the geometries of the bones, not just the texture maps.
- That implies dealing with the sub-hierarchy of TRBS: TRCM, TRGA, M3GM, TRTA.
- That hierarchy is nameless, and you also have to swap between different TRBS.
- That means you can't get anything done by hacking a single TRBS*.oni
- You have to use OUP on a dummy .dat generated from several TRBS.
- Once you have them, you have to swap the IDs of corresponding TRCM/TRGA/M3GM.
- You may also want to bastardize the skeletons, that is, swap/edit the TRTA.
- geyser 15:15, 15 February 2008 (CET)
Thank you for the explanation, you're right its not that hard, once you understand what's needed.
I'll play with it some more after work. I could see the benefits of using the same length filename especially if one is creating new textures for a character, then the issue of texture lookup is avoided.
Bastardizing, seems more of a challenge...
EdT
Thanks for your help, now I have a Black ops Konoko. Its was easy to add this character as the default player.
EdT
- "now I have a Black ops Konoko" Yeah, it was certainly worth the trouble, LOL.
- Note that I've already produced a Konoko using Black Ops SWAT textures.
- I've found that she looks better with a bulletproof vest and bulletproof a$$.
- (just use the SWAT's shoulderplate texture for both the chest and the pelvis)
- geyser 15:20, 16 February 2008 (CET)
Your Black Ops Konoko gave me the idea to create the custom character. It was worth the trouble, now I understand what's needs to be done.
Thanks again.
EdT