Page 1 of 1

.CAT editing?

Posted: Sun Jan 25, 2015 2:24 am
by Ductape
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"

Re: .CAT editing?

Posted: Mon Jan 26, 2015 3:22 am
by WhoElseButMe
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.

Re: .CAT editing?

Posted: Mon Jan 26, 2015 4:04 am
by Morten1337
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:

Re: .CAT editing?

Posted: Mon May 04, 2015 8:55 pm
by Challenger
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