Chrono Compendium

Kajar Laboratories - Fan Works and Submissions => Chrono Cross Modification => Topic started by: Grobycftw on April 26, 2019, 07:50:19 am

Title: Need Help Finding Chest Content
Post by: Grobycftw on April 26, 2019, 07:50:19 am
I feel like I'm very close to it but after hours and hours of trying I'm still not able to edit Chest Content

I've been testing the chest containing Fireball in 0482.room_042_lizard_rock_home_-_entrance.script.cpt   Y   16313 (Hex 024973B0) "Format 2352" .


After reading
https://www.chronocompendium.com/Term/Chrono_Cross_Fieldscript.html
+
https://www.chronocompendium.com/Term/Chrono_Cross_Fieldscript_Notes.html

in the notes it mention
BB XX YYZZ - Item give/take: if XX is 0, item ZZYY will be added to the inventory;
if XX is non-zero, the item will be taken away.
By default, ZZYY refers to a normal item (forge material/weapon/armour/accessory).
If bit 0x200 is set, the item will be an Element.
If bit 0x400 is set, the item will be a key item.

I Strongly suspect that this could be the chest but I can't figure out how to read/find/edit any of those values.

I know that when your using code to add elements in your inventory the value is
0007 = Fireball
I tried changing most/all 0007 and 0700 but in vain   :picardno

still working on it at the moment , will update if I got anything

Title: Re: Need Help Finding Chest Content
Post by: Mauron on April 26, 2019, 02:27:02 pm
I'm not an expert on Cross hacking, so I'm assuming most of your information is correct, and only clarifying the hex to search for.

BB is the hex value indicating which command is being processed, so we can include that in our search.

Since the Fireball element is being added, we know that XX is 00.

The biggest issue with your search is that you need to find an Element, and the notes say that requires bit 0x200 to be set. A value of 0007 will get you a material/weapon/armor/accessory. Instead you need to search for 0207.

Since the hex pattern uses YYZZ and the description uses ZZYY, we can assume those bytes are stored in reverse.

Search for BB 00 07 02. If everything else is accurate, you should get one result.
Title: Re: Need Help Finding Chest Content
Post by: Grobycftw on April 26, 2019, 04:15:27 pm
Thx for the quick reply Mauron, I've just tried many combination of either 00 07 02 , 00 02 07, 02 07 00 , 07 02 00 still no luck, i'm starting to think that the game might not be using the "list" where Fireball is 0007
but i'll keep poking around!
Title: Re: Need Help Finding Chest Content
Post by: Vehek on April 26, 2019, 05:06:01 pm
I looked at the decompiled script. It's set at the very beginning of the fieldscript.
0x005C: roomVar[0x4C] = 519 ; 0x0207
The BB opcode doesn't appear until much later. Looks like a generic script that handles any type of item that could be in the chest.
Title: Re: Need Help Finding Chest Content
Post by: Grobycftw on April 26, 2019, 09:33:45 pm
Sadly I'm not very familiar with decompiling/prog script, but do you think there is a value in Hex that can change directly the chest content? or it will be a couple of byte like a command/pointer?
Title: Re: Need Help Finding Chest Content
Post by: Mauron on April 26, 2019, 10:50:02 pm
Based on Vehek's post, there should be an 07 02 within a few bytes of 0x005c in the hex that would need to be changed.
Title: Re: Need Help Finding Chest Content
Post by: Vehek on April 27, 2019, 12:10:16 am
Well, that 0x5C offset refers to, as the fieldscript page says, to a position relative to the end of the header. If you don't want to calculate it, you can basically scan through the file until you stop seeing a bunch of 00's interrupted by actual pointers, and that's the base offset to use. But just to be sure, Grobycftw, you've never mentioned decompressing the fieldscript section (a necessary step). Did you do that first?
Title: Re: Need Help Finding Chest Content
Post by: Grobycftw on April 27, 2019, 02:27:15 am
I have no idea how to decompress a fieldscript, right now all i'm doing is checking all the hex values between 024973B0 and 024C0930 , what I want is to be able to edit a chest content only by changing a hex value  :D

*No I haven't done that Vehek :o
Title: Re: Need Help Finding Chest Content
Post by: prizvel on May 24, 2019, 10:14:36 am
The contents of the chests are set differently in different rooms. Sometimes it is clearly defined, sometimes it is set to a variable at the beginning of the script.
For example

[10 12 02 05 02 40 ]
( var[0x212] = 0x205 )

[BB 00 12 02 ]               
bb - RECEIVE_ITEM
00 - give (00 give, 01 take)
12 02 variable number 0x212 = iceBlust

[BB 00 12 82 ]               
bb - RECEIVE_ITEM
00 - give (00 give, 01 take)
12 82 item number 0x212 = tornado
Title: Re: Need Help Finding Chest Content
Post by: Grobycftw on July 24, 2019, 06:27:00 pm
Can you show me how to decompress a fieldscript?

From what I learn, what I have to do is
decompress -> 0482.room_042_lizard_rock_home_-_entrance.script.cpt
using yaz0r's tool script in visual studio -> https://drive.google.com/open?id=1ESxSadFNO6E84e8STiPCxEwb94bgKq1S
to get -> https://drive.google.com/open?id=12WIhyQVgBnaYOX2M9qj7qJ8Mt7_aKsfX
edit line 14 -> ( 0x005C: var[0x0498] = 519 ) change 519 to let say 520
then compress it back with yaz0r's tool "compress script" and inject it in my ISO ?

I've tried but can't compile the script in visual studio  :/ (not to good in programmation)
Title: Re: Need Help Finding Chest Content
Post by: Grobycftw on October 16, 2019, 06:45:13 pm
Hi guys me again, I was just wondering if you could post for me the compiled script of
CD0-050-Lizard Rock Entrance (Home)
with the value 520 instead of 519
That would really be helpful!

*Oh and today I was able to confirm that Vehek was right
in CD0-050-Lizard Rock Entrance (Home) -> 0x005C: var[0x0498] = 519   , is Fireball (0007)
CD0-329-Fort Dragonia Northeast Third Area (Home) -> 0x0046: var[0x045E] = 530  , is Tornado (0012)
CD0-148-Viper Manor Bluffs Final Ascent (Another) -> 0x00DF: var[0x04CA] = 540   , is Meteorite (001C)

so it all make sense when looking at the Element list. :o



Title: Re: Need Help Finding Chest Content
Post by: prizvel on October 17, 2019, 08:42:39 am
Replace this byte with 08 and you get 520. In the attachment, a file with a list of items. It's in Russian, but I've added English element names.
(https://i.imgur.com/a8e9aKh.png)
https://www.dropbox.com/s/7d989xd6l2oree8/Chrono_Cross_Item_IDs.xls?dl=1
Title: Re: Need Help Finding Chest Content
Post by: Grobycftw on October 17, 2019, 02:24:33 pm
:o Priz hummmmmm I just have to ask, how do you Re-insert these value in the iso? (Is it complicated?)
I thought I could just copy paste   it but its not there. :picardno
I am so lost >.<
I thought that the compile script was the original data.
Title: Re: Need Help Finding Chest Content
Post by: prizvel on October 17, 2019, 03:54:00 pm
The script is Packed in lzss archive, it will not be found in iso.
Here is an example of unpacking the archive https://www.chronocompendium.com/Forums/index.php?topic=12597.0
Title: Re: Need Help Finding Chest Content
Post by: Grobycftw on October 17, 2019, 06:59:52 pm
:o watched the whole video that seems like exactly what I need to do
But when I run the dumper.pl in Perl.exe it says this :

I Can't get the ChronoCross.pm to work..


had the same problem using ActiveState >.<
**And I don't understand how to install the  List::MoreUtils  either :<
Title: Re: Need Help Finding Chest Content
Post by: Grobycftw on October 19, 2019, 04:16:01 am
 8)
Omg it worked!!!
I went to a friend who's very familiar with coding/prog
on his Mac/Linux , he had Perl 5.18 installed and everything worked the first try!!
Now I still can't make it work on my windows using Perl 5.26 (Strawberry Perl or ActiveState), it always fail to use Chronocross.pm in the local folder :( (we even tried on different OS but not all of em) but no worry , I'll just make a copy my iso with all the chest edited ASAP and then I shouldn't need to do this afterward!
Thanks for all your helps guys :D !!
If you have any idea how to make Perl 5.26 work with the Chronocross.pm let me know


Nvm!!! I downloaded Strawberry 5.16.3.1
did the command :  cpan install List::MoreUtils , worked perfectly
then I was able to run dumper.pl with no error :D!!! Yayyyyyyyy