Author Topic: Need Help Finding Chest Content  (Read 6122 times)

Grobycftw

  • Architect of Kajar
  • Porrean (+50)
  • *
  • Posts: 85
  • Chilling in the Bend of Time
    • View Profile
Need Help Finding Chest Content
« 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


Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1763
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Need Help Finding Chest Content
« Reply #1 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.

Grobycftw

  • Architect of Kajar
  • Porrean (+50)
  • *
  • Posts: 85
  • Chilling in the Bend of Time
    • View Profile
Re: Need Help Finding Chest Content
« Reply #2 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!

Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1756
    • View Profile
Re: Need Help Finding Chest Content
« Reply #3 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.
« Last Edit: April 26, 2019, 05:16:06 pm by Vehek »

Grobycftw

  • Architect of Kajar
  • Porrean (+50)
  • *
  • Posts: 85
  • Chilling in the Bend of Time
    • View Profile
Re: Need Help Finding Chest Content
« Reply #4 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?

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1763
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Need Help Finding Chest Content
« Reply #5 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.

Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1756
    • View Profile
Re: Need Help Finding Chest Content
« Reply #6 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?
« Last Edit: April 27, 2019, 12:49:22 am by Vehek »

Grobycftw

  • Architect of Kajar
  • Porrean (+50)
  • *
  • Posts: 85
  • Chilling in the Bend of Time
    • View Profile
Re: Need Help Finding Chest Content
« Reply #7 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
« Last Edit: April 27, 2019, 02:28:03 am by Grobycftw »

prizvel

  • Guru of Time Emeritus
  • Guardian (+100)
  • *
  • Posts: 118
  • Our planet's dream is not over yet
    • View Profile
Re: Need Help Finding Chest Content
« Reply #8 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

Grobycftw

  • Architect of Kajar
  • Porrean (+50)
  • *
  • Posts: 85
  • Chilling in the Bend of Time
    • View Profile
Re: Need Help Finding Chest Content
« Reply #9 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)

Grobycftw

  • Architect of Kajar
  • Porrean (+50)
  • *
  • Posts: 85
  • Chilling in the Bend of Time
    • View Profile
Re: Need Help Finding Chest Content
« Reply #10 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



« Last Edit: October 16, 2019, 09:18:03 pm by Grobycftw »

prizvel

  • Guru of Time Emeritus
  • Guardian (+100)
  • *
  • Posts: 118
  • Our planet's dream is not over yet
    • View Profile
Re: Need Help Finding Chest Content
« Reply #11 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://www.dropbox.com/s/7d989xd6l2oree8/Chrono_Cross_Item_IDs.xls?dl=1
« Last Edit: October 17, 2019, 10:36:34 am by prizvel »

Grobycftw

  • Architect of Kajar
  • Porrean (+50)
  • *
  • Posts: 85
  • Chilling in the Bend of Time
    • View Profile
Re: Need Help Finding Chest Content
« Reply #12 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.

prizvel

  • Guru of Time Emeritus
  • Guardian (+100)
  • *
  • Posts: 118
  • Our planet's dream is not over yet
    • View Profile
Re: Need Help Finding Chest Content
« Reply #13 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

Grobycftw

  • Architect of Kajar
  • Porrean (+50)
  • *
  • Posts: 85
  • Chilling in the Bend of Time
    • View Profile
Re: Need Help Finding Chest Content
« Reply #14 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 :<
« Last Edit: October 18, 2019, 12:34:12 am by Grobycftw »