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

Grobycftw

  • Architect of Kajar
  • Earthbound (+15)
  • *
  • Posts: 17
  • 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
  • Magical Dreamer (+1250)
  • *
  • Posts: 1346
  • 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
  • Earthbound (+15)
  • *
  • Posts: 17
  • 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: 1686
    • 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
  • Earthbound (+15)
  • *
  • Posts: 17
  • 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
  • Magical Dreamer (+1250)
  • *
  • Posts: 1346
  • 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: 1686
    • 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
  • Earthbound (+15)
  • *
  • Posts: 17
  • 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
  • Guardian (+100)
  • *
  • Posts: 108
  • 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