Author Topic: How To.........  (Read 15846 times)

Shinrin

  • Chrono Trigger Threads of Time
  • Squaretable Knight (+400)
  • *
  • Posts: 487
  • Chrono Trigger Fan # 100
    • View Profile
    • Shinrin Cole
Re: How To.........
« Reply #60 on: October 22, 2007, 01:43:35 am »
These colors are used for other events. like the rain in the training grounds, what we did, was put the colors to the text. which someone else found, and we modified it ;)

Chrono'99

  • Guru of Reason Emeritus
  • God of War (+3000)
  • *
  • Posts: 3605
    • View Profile
Re: How To.........
« Reply #61 on: December 08, 2007, 06:13:03 am »
How to "control" sprite palettes

When too many sprites are in a location, some of them often appear with incorrect palettes, and they change if you open and close the menu or if you move away from them and come back (if they leave the screen and reappear).

To make sure that each sprite has a fixed palette, put a ChangePalette command in each sprite Startup/Idle. If the sprites are supposed to have different palettes, give a different palette number to each of them. The maximum allowed seems to be 7 (counting from 0, so it's 8 palettes); if you have a 9th sprite, it will either appear with the palette of the first one, or the contrary, and so on.

If some of the sprites are the same (NPCs, etc.) or if they are supposed to have the same palette, you can give them the same palette number. This is how the CT developers managed to have all these sprites appear in the End of Time: there are 8 different palettes (7 PCs + Gaspar), and the 9th and 10th sprites (the blue stars) actually use the same palette as Magus, if I recall correctly.

You can also change palettes "live" during events; it doesn't have to be in Startup/Idle.
« Last Edit: December 08, 2007, 06:17:39 am by Chrono'99 »

justin3009

  • Fan Project Leader
  • God of War (+3000)
  • *
  • Posts: 3296
    • View Profile
Re: How To.........
« Reply #62 on: December 08, 2007, 10:03:54 am »
So that's why my save points colors are screwed up!  I kinda figured NPC's shared the same Palette as PC's because when I altered Ayla's palette, it altered Kino's.  And I believe Robo's palette = Gaspar.  So weird

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: How To.........
« Reply #63 on: January 21, 2008, 11:38:39 pm »
How to....

Code a dungeon in an hour!

I've been around enough to learn a few tricks with coding CT dungeons, so I thought I'd share my process with you.  This walk through is assuming you have already mapped out your area to your liking and you are ready to bring it to life.  You should also have some background in TF.  So Here we go!

Step 1: 

Clear out the events.  I use Lucca's Kitchen location, open up the events, highlight everything copy, open my location delete everything and paste.  I think Lucca's kitchen has one command in object 00 to delete (can't open menu command).

Step 2:

In object 00 after the return statement put a get object PC0 command storing it to 7F0202 and 7F0204, save, close the events reopen the events and put a GOTO command and have it jump back to the get command, this is going to be your battle trigger.

Step 3:

Make object 8, this is your battle coordinator object, in it's startup/load just put a return and end.

Step 4:

Pick out square chunks on your map that will trigger battles, remember their X and Y coordinates and use Comparison -> value to mem to catch these locations as so:
if(7F0202 > X1)
  if(7F0202 < X2)
    if(7F0204 > Y1)
      if(7F0204 < Y2)

Step 4: 

Trigger the battle by having each square chunk call in arbitrary in your battle coordinator

Step 6:

Throw some enemies in your events, you can either have the enemies load on the map or have the enemies appear later (don't put set object coordinates)

Step 5: 

In the battle coordinators arbitraries put a template

Explore mode Off
Move Party
Sound effect (enemy screaming or the like)
Move Enemies (or have them appear)
Scroll Screen (takes some trial and error to get just right)
Battle
Explore Mode On

Step 6:

Mark the battle on some Temp memory 7F0206  and wrap the battle around a conditional I.E.
if(7F0202 > X1)
  if(7F0202 < X2)
    if(7F0204 > Y1)
      if(7F0204 < Y2)
         if(7F0206 & 1)
            GO get object coordinates

and inside the battle coordinator mark 7F0206 & 1


By following a template your code is easy to follow, and can be created faster.

--JP

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: How To.........
« Reply #64 on: January 22, 2008, 12:02:39 am »
How to code timed events:

Creating timed events will use the internal game clock, I don't recall any timed events in CT, but the tools are certainly there to create one.  This tutorial will remember the "second" that the timer was started and then everytime that second is seen we know a minute has passed, we will only allow 5 minutes to pass.  Special thanks to JLukas for helping me out:

Step 1:

First off Pick the number of minutes you want to allow and store it to temporary memory

Mem.7F0202 = 05 //Player has 5 minutes



Step 2: 

Get the current time, if your event spans multiple locations you will need to write it to permanent memory other wise write it to temporary memory.  The seconds are stored in memory address 7E0401, in the below example I copy the address into temp memory and then store it in a permanent address, I use the temporary memory in the second location in case a second has passed between the commands.

Assign(Mem.7E0401, Mem.7F0204, One) //Copy start time second to work memory
Assign(Mem.7F0204, Mem.7F0042, One) //Copy start time second to more permanent address (across locs.)

Step 3:

Wait a second, otherwise we will instantly count down one of our minutes.

Pause 1.000 //Wait for 1 second so the following statement isn't triggered instantly

Step 4:

We are now going to begin the "loop" where we check the second and see if it is the second we started on:

Step 4a:

Get the current second, and keep it in temp memory

_CheckSecondLoop Assign(Mem.7E0401, Mem.7F0206, One) //Copy current seconds to work memory


Step 4b:

Check if it is the second we started on:

If (Mem.7F0204 == 7F0206) //If current second is equal to start second

Step 4C:
 
If it is then we will decrement one from the counter, if the event spans multiple locations make sure you save the time in permanent memory.

7F0202 -= 1  //decrement time
Assign(Mem.7F0202, Mem.7F0044, One)  //save forever

Step 4d:

If the new time is 00 then they ran out of time!

  If Mem.7F0202 == 00) //If out of time
      Textbox (Bottom, "Sorry! Out of time.")
      Goto _RanOutOfTimeArbitrary

Step 4E:

Otherwise we let them know a minute has passed.  This can be done by assigning a memory address to 7E0200, which can be displayed in textbox values as {value 8}

   Assign(Mem.7F0210, Mem.7E0200, One)  // put in special address
   Textbox (Bottom, "{value 8} minute(s) left!")  //show textbox with value 8

Step 4F:

That is the end of the if statment for if it's the second we started on, if it wasn't the second we started on we, just redo the loop:

Goto _CheckSecondLoop

Step 5:

Finally in another arbitrary put code to handle when the run out of time

Woo.....so the final code looks like this

Mem.7F0202 = 05 //Player has 5 minutes
Assign(Mem.7E0401, Mem.7F0204, One) //Copy start time second to work memory
Assign(Mem.7F0204, Mem.7F0042, One) //Copy start time second to more permanent address (across locs.)
Pause 1.000 //Wait for 1 second so the following statement isn't triggered instantly
_CheckSecondLoop Assign(Mem.7E0401, Mem.7F0206, Two) //Copy current seconds to work memory
If (Mem.7F0204 == 7F0206) //If current second is equal to start second
   7F0202 -= 0001 //Subtract 1 minute from counter
   Assign(Mem.7F0202, Mem.7F0044, One) //Save Forever
   If Mem.7F0202 == 00) //If out of time
      Textbox (Bottom, "Sorry! Out of time.")
      Goto RanOutOfTimeArbitrary
   Assign(Mem.7F0202, Mem.7E0200, One)
   Textbox (Bottom, "{value 8} minute(s) left!")
   Goto _CheckSecondLoop

That's all there is to it, now you can add something that wasn't (to my knowledge) in CT.

Some other notes:

If you have battles then this could screw it up, so pause the game clock before a battle and restart it after a battle by storing FF to 7E0407

It also doesn't run if the status menu is open so disable the status menu by storing 1 to memory address 110

   Value to Mem
   Value = 1
    Store To = 110
    Width one byte


That's all for now, i'll keep you updated and remember if you want something else explained feel free to ask.

--JP

Kaktus021

  • Earthbound (+15)
  • *
  • Posts: 25
    • View Profile
Re: How To.........
« Reply #65 on: January 23, 2008, 11:07:38 am »
I don't recall any timed events in CT, but the tools are certainly there to create one.
I'm pretty sure it's used for the drinking games, but I could be wrong.

Anyway, this would be great if you wanted to make a timed escape from Mt. Woe before it collapsed. Question is, would the timer still run in battle?

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: How To.........
« Reply #66 on: January 23, 2008, 11:33:33 am »
Ah yes, I forgot about the drinking game, as for battles near the end of the post it mentions how to handle them

Quote
If you have battles then this could screw it up, so pause the game clock before a battle and restart it after a battle by storing FF to 7E0407

--JP

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1359
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: How To.........
« Reply #67 on: February 23, 2008, 05:01:22 am »
I'm pretty sure it's used for the drinking games, but I could be wrong.

Anyway, this would be great if you wanted to make a timed escape from Mt. Woe before it collapsed. Question is, would the timer still run in battle?

Hey, I thought of this once... question is what would Melchior do in battle? He he.

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1359
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: How To.........
« Reply #68 on: September 18, 2008, 01:03:31 pm »
Make a custom colored Gate without ripping you hair out.

MemCopy88; Mode=81, Param1=0, Data:

A01DE01D6122E32E873FAC57F367FA77FA77F367AC57873FE32E6122E01D - green portal
FA675F3B5F2A3D2D591C3614510C2D0C2D0C510C3614591C3D2D5F2A5F3B - red portal

Looks pretty daunting huh? The MemCopy data here consists of 10 sets of colors all packed together.

Here's an easier way to look at them:

A01DE0 1D6122 E32E87 3FAC57 F367FA 77FA77 F367AC 57873F E32E61 22E01D - green portal
FA675F 3B5F2A 3D2D59 1C3614 510C2D 0C2D0C 510C36 14591C 3D2D5F 2A5F3B - red portal

Here's the first segment from the red portal: A01DE0  or simply: A0 1D E0

The integers are hex values for RGB color. By understanding and modifying these you can create any portal color you wish. Not so daunting anymore is it? I haven't delved too deeply in this but here's some of my findings...

00000000000000000000000000000000000000000000000000000000000000000 - solid black
F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 - solid purple

F0 F0 F0 = purple
So if we want a purple and black portal...one of the ways we could make is by using this:

F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0000000000000000000000000000000  - purple and black mix
( by making the first set of colors purple and the latter black)

FA675F3B5F2A3D2D591C3614510C2D0000000000000000000000000000000 - cool red/black mix

There you have it! Of course, it'll take further experimenting to come up with the portal scheme you desire create.


Geiger

  • Guru of Life Emeritus
  • Chronopolitan (+300)
  • *
  • Posts: 315
    • View Profile
    • Geiger's Crypt
Re: How To.........
« Reply #69 on: September 18, 2008, 03:14:31 pm »
The integers are hex values for RGB color.

Close.  The SNES uses 15 bit color and stores it into two bytes.  0000 = Black.  7FFF = White.  You'll need to put these in little endian data format, which means White would appear as FF7F in your data stream.

If I'm doing the math in my head right, your Purple is equivalent to 70F0 and would look something like this.

Real Purple would be 4010 (stored as 1040) and look like this.

The hex formula for converting from RGB to SNES is:

Code: [Select]
Color = floor(Red / 8) + (floor(Green / 8) * 20) + (floor(Blue / 8) * 400)
« Last Edit: September 18, 2008, 03:16:05 pm by Geiger »

Shinrin

  • Chrono Trigger Threads of Time
  • Squaretable Knight (+400)
  • *
  • Posts: 487
  • Chrono Trigger Fan # 100
    • View Profile
    • Shinrin Cole
Re: How To.........
« Reply #70 on: September 21, 2008, 02:13:07 am »
Alright, it's been 11 months since we found out the colors the text can be, but lo and behold, you can change the hue of the color!

for normal color:

Example: Red - Mode 51 - Param 1 - 9 - Param 2 - 5 - Param 3 - 1 - Param 4 - 9

For a lighter Color:

Example: Red (lighter) - Mode 51 - Param 1 - 9 Param 2 - 5 Param 3 - 4 - Param 4 - 1

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1359
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: How To.........
« Reply #71 on: September 22, 2008, 07:04:09 pm »
The integers are hex values for RGB color.

Close.  The SNES uses 15 bit color and stores it into two bytes.  0000 = Black.  7FFF = White.  You'll need to put these in little endian data format, which means White would appear as FF7F in your data stream.

If I'm doing the math in my head right, your Purple is equivalent to 70F0 and would look something like this.

Real Purple would be 4010 (stored as 1040) and look like this.

The hex formula for converting from RGB to SNES is:

Code: [Select]
Color = floor(Red / 8) + (floor(Green / 8) * 20) + (floor(Blue / 8) * 400)

 :x Oh, well. Worth a shot. (It made sense to me atleast, haha)

Anyways, I don't even pretend to understand 1/100th of what you do. Thanks for the clarification.  :)

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: How To.........
« Reply #72 on: September 22, 2008, 09:45:22 pm »
Hey don't worry you taught me something :).  And if you hadn't posted it Geiger wouldn't have posted the correction.

--JP

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1359
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: How To.........
« Reply #73 on: December 02, 2008, 12:14:37 pm »
Steal maps from Japanese version

I did this for the Sealed Pyramid for my CT+ hack...and just thought I'd share with everyone that you CAN "export" maps from the pre-release.

Open the Beta/pre-release ROM and find the map you want.
Eg. Singing Mountain, Zeal Dungeon, etc.

Open another location window (keep it at the same location)

Now, open your CT ROM; refresh one (and only one) of the two location tabs.
The other tab will retain the map from the other ROM.

Explicit Paste away!  :wink:


~Z
« Last Edit: December 02, 2008, 12:20:16 pm by Zakyrus »

justin3009

  • Fan Project Leader
  • God of War (+3000)
  • *
  • Posts: 3296
    • View Profile
Re: How To.........
« Reply #74 on: December 02, 2008, 12:18:28 pm »
Hahaha!  Genius ^_^