Author Topic: Making a shortcut to a particular ending  (Read 1684 times)

stewelement

  • Earthbound (+15)
  • *
  • Posts: 26
    • View Profile
Making a shortcut to a particular ending
« on: December 23, 2017, 12:54:49 pm »
Here's what I'm trying to do.
I want to add an exit in Crono's room that is a shortcut to a particular ending. In TF, adding the exit and pointing it to the ending event I want is straightforward. But when I use the exit in the game, the ending does not play as expected. I assume that the game expects some additional parameters to play the ending appropriately. What am I missing? Alternatively, is there a debug room or something I can take advantage of to quickly go to an ending?

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1764
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Making a shortcut to a particular ending
« Reply #1 on: December 23, 2017, 09:04:17 pm »
You probably need to set some RAM addresses correctly first.

Check location {052} Ending Selector to see if anything's set there, and the relevant ending locations for RAM addresses that are checked.

To set a RAM address, you need two instructions:
1) Assignment, Value-to-Mem, storing the value you want to an address in the 7F0200-7F03FE range (temporary storage for the current location.
2) Assignment, Mem-to-Mem, copying the value to the address you need for the ending.

There's a location labeled Debug Room?, but it's lacking in events.

Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1756
    • View Profile
Re: Making a shortcut to a particular ending
« Reply #2 on: December 23, 2017, 09:18:26 pm »
The "game notes" file in the Chrono Trigger Database has the information on the storyline value/flags for the endings.

stewelement

  • Earthbound (+15)
  • *
  • Posts: 26
    • View Profile
Re: Making a shortcut to a particular ending
« Reply #3 on: December 26, 2017, 11:31:49 am »
Thanks for the information Mauron and Vehek. I'll give it another go.

stewelement

  • Earthbound (+15)
  • *
  • Posts: 26
    • View Profile
Re: Making a shortcut to a particular ending
« Reply #4 on: January 16, 2018, 09:39:21 pm »
I was able to get it to work. I changed the exit in Crono's Kitchen to the Ending Selector {00B}, and then added a Value to Mem command, setting the storyline counter to the value I wanted in the startup/idle script in Object 00 in the Ending Selector event code.

I tried changing the storyline counter in a new object in both Crono's room and kitchen but the behavior was not as expected, and I kept getting sent to the reptite ending. I suspect my desired value was being overwritten by another script that fired after my new object's code.

So for best practices when modifying event code: when should a new object be introduced?
Are there safer areas to add commands to objects than other places?

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1764
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Making a shortcut to a particular ending
« Reply #5 on: January 17, 2018, 08:39:03 pm »
Generally, you'd want your object layout to be like this.

Object 00: Background processing for events. Anything automatic.
Object 01: Tile manipulation, if necessary.
Objects 01-07 or 02-08: Party members.
Anything else comes afterwards.

Startup/Idle gets processed at load. If you want to override the storyline counter in a new object, you'd probably want it in the activate or touch section of an object with set coordinates, perhaps on Crono's refrigerator.