.CAT editing?

Discuss thug2 modding, post your own, share your ideas, ask questions.
Ductape
Posts: 1
Joined: Sun Jan 25, 2015 2:21 am
Contact:

.CAT editing?

Postby Ductape » Sun Jan 25, 2015 2:24 am

Is it possible to open and Edit create a trick files through a tool? I am trying to create a trick that is "unlandable".

for example " back flip 180"
WhoElseButMe
Posts: 419
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: .CAT editing?

Postby WhoElseButMe » Mon Jan 26, 2015 3:22 am

No tool has been made.
You might be able to find some documentation on the files at thmods.com to do manual edits, but that's about it.
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.
Morten1337
Posts: 132
Joined: Tue Jun 08, 2010 11:11 pm
Contact:

Re: .CAT editing?

Postby Morten1337 » Mon Jan 26, 2015 4:04 am

WhoElseButMe wrote:No tool has been made.
You might be able to find some documentation on the files at thmods.com to do manual edits, but that's about it.

Yeah, I think there is some documentation on the save file byte codes somewhere. And it should be similar to the qb scripts.

Suggest you open one of the pre-made tricks, and save it, then compare the data in a hex editor with this:
"Dookie Flip" code snippet from CreateATrick.qb

Code: Select all

   :i :s{
      :i $name$ = %s(11,"Dookie Flip")
      :i $can_spin$ = %i(0,00000000)
      :i $full$ = %i(1,00000001)
      :i $rotation_info$ = :a{
         :i :s{$on$ = %i(1,00000001)$Axis$ = call $y$ arguments
               $Deg$ = %i(360,00000168)$Dur$ = %f(0.700000)$start$ = %f(0.000000)$deg_dir$ = %i(1,00000001):s}
         :i :s{$on$ = %i(2,00000002)$Axis$ = call $y$ arguments
               $Deg$ = %i(180,000000b4)$Dur$ = %f(0.800000)$start$ = %f(0.000000)$deg_dir$ = %i(1,00000001):s}
         :i :s{$on$ = %i(2,00000002)$Axis$ = call $z$ arguments
               $Deg$ = %i(360,00000168)$Dur$ = %f(0.600000)$start$ = %f(0.600000)$deg_dir$ = %i(1,00000001):s}
         :i :s{$on$ = %i(2,00000002)$Axis$ = call $y$ arguments
               $Deg$ = %i(360,00000168)$Dur$ = %f(1.000000)$start$ = %f(0.000000)$deg_dir$ = %i(1,00000001):s}
         :i :s{$on$ = %i(2,00000002)$Axis$ = call $y$ arguments
               $Deg$ = %i(360,00000168)$Dur$ = %f(1.000000)$start$ = %f(0.000000)$deg_dir$ = %i(1,00000001):s}
         :i :s{$on$ = %i(2,00000002)$Axis$ = call $y$ arguments
               $Deg$ = %i(360,00000168)$Dur$ = %f(1.000000)$start$ = %f(0.000000)$deg_dir$ = %i(1,00000001):s}
         :i :a}
      :i $animation_info$ = :a{
         :i :s{$on$ = %i(1,00000001)$trick$ = call $Extra_DBackfootKickflip$ arguments
               $Dur$ = %f(0.700000)$blend$ = $CAT_BLEND$$from$ = %i(0,00000000)$percent$ = %i(1,00000001)$trickType$ = %i(0,00000000)$idletime$ = %f(0.000000)$start$ = %i(0,00000000)$order$ = %i(1,00000001)$hold$ = %i(0,00000000)$backwards$ = %i(0,00000000):s}
         :i :s{$on$ = %i(2,00000002)$trick$ = call $trick_indy$ arguments
               $Dur$ = %f(0.500000)$blend$ = $CAT_BLEND$$from$ = %i(0,00000000)$percent$ = %i(1,00000001)$trickType$ = %i(1,00000001)$idletime$ = %i(0,00000000)$start$ = %i(0,00000000)$order$ = %i(2,00000002)$hold$ = %i(0,00000000)$backwards$ = %i(0,00000000):s}
         :i :s{$on$ = %i(2,00000002)$trick$ = call $trick_indy$ arguments
               $Dur$ = %f(0.500000)$blend$ = $CAT_BLEND$$from$ = %i(0,00000000)$percent$ = %i(1,00000001)$trickType$ = %i(1,00000001)$idletime$ = %i(0,00000000)$start$ = %i(0,00000000)$order$ = %i(3,00000003)$hold$ = %i(0,00000000)$backwards$ = %i(0,00000000):s}
         :i :s{$on$ = %i(2,00000002)$trick$ = call $trick_indy$ arguments
               $Dur$ = %f(0.500000)$blend$ = $CAT_BLEND$$from$ = %i(0,00000000)$percent$ = %i(1,00000001)$trickType$ = %i(1,00000001)$idletime$ = %i(0,00000000)$start$ = %i(0,00000000)$order$ = %i(4,00000004)$hold$ = %i(0,00000000)$backwards$ = %i(0,00000000):s}
         :i :s{$on$ = %i(2,00000002)$trick$ = call $trick_indy$ arguments
               $Dur$ = %f(0.500000)$blend$ = $CAT_BLEND$$from$ = %i(0,00000000)$percent$ = %i(1,00000001)$trickType$ = %i(1,00000001)$idletime$ = %i(0,00000000)$start$ = %i(0,00000000)$order$ = %i(5,00000005)$hold$ = %i(0,00000000)$backwards$ = %i(0,00000000):s}
         :i :s{$on$ = %i(2,00000002)$trick$ = call $trick_indy$ arguments
               $Dur$ = %f(0.500000)$blend$ = $CAT_BLEND$$from$ = %i(0,00000000)$percent$ = %i(1,00000001)$trickType$ = %i(1,00000001)$idletime$ = %i(0,00000000)$start$ = %i(0,00000000)$order$ = %i(6,00000006)$hold$ = %i(0,00000000)$backwards$ = %i(0,00000000):s}
         :i :a}
   :i :s}


So it looks like there is a header with some parameters, and 2 arrays rotation_info + animation_info.
I guess the size of the data will be the same for all tricks except for the name length.

When you make changes to the save file, you'll have to correct the checksum, which is the first 4 bytes of the file. There are tutorials for this, that applies to CAS saves, but it shouldn't be that much different.

:hmm:
Challenger
Posts: 22
Joined: Fri Apr 19, 2013 12:29 am
Contact:

Re: .CAT editing?

Postby Challenger » Mon May 04, 2015 8:55 pm

I found a utility for generating new CRC32 hashes for CAS files, but I have not tried on with anything else. I'll post a link here later.

Edit: Here it is. Drag and drop your CAT file onto it and it will generate the checksum so you can inject it at the beginning of the file after making changes. http://thmods.com/mod_tools/checksum.exe

Return to “THUG2 modding”

Who is online

Users browsing this forum: No registered users and 20 guests