colcolstyles
Yours truly
- 1,586
- Posts
- 16
- Years
- The Bay Area
- Seen May 19, 2019
I'm getting kind of tired of writing tl;dr posts (and I'm sure you're sick of reading them) so I'll try to keep this one short. To make a long short, I hacked the fade-in/fade-out routine so that if 0x8000 is set to 0x42, then all palettes loaded on the fade-in will be grey (both the values 0x8000 and 0x42 can be changed). Also, like before, the textbox palettes are left untouched. The palettes will stay that way until something else other than the fade routine runs, such as moving from map to map (which loads new secondary tileset palettes directly, meaning no fade) but I don't think that that will be a problem seeing how the grey mode will only be used for flashbacks.
As for application into a script, there are a few things I need to check first. Once I work out the kinks, I'll make one more video showing the final product and post the script(s) here.
edit: Okay so I think I've gotten everything working the way I want it to. Now all that's left to do is for Thrace to take a look at it and see if everything's working the way he wants it to. Here's a video with an example of how a flashback would be implemented. Unfortunately, the flashback in the video takes place in a building so the flashback border looks a little weird because it intersects with the normal, interior black border.
Anyways, in order for the flashback to work, a couple of level scripts are necessary:
1. The level script (type 0x2) with the event. This is pretty obvious since the flashback is an event and it needs to run automatically
2. Another level script (type 0x4) on the map of the event. In this script, there is a 'callasm' command which loads the border sprites into the VRAM and places them in the right spots. This has to be a type 0x4 level script and if you put the 'callasm' into, say, a setmaptile script, no border will appear. I think that this is because the setmaptile script runs not only before the map is loaded but also before the sprites are loaded. Because of this, the border is loaded but is then immediately overwritten. Also, this script contains the 'setvar 0x8000 0x42' which triggers the greyscale palette loading function (type 0x0). This has to be set here because if you set it in the calling script, the fade-out will use shades of grey
3. A setmaptile script (type 0x1) on the map where the flashback is called from. The only command in this script is a 'setvar 0x8000 0x0' which turns off the greyscale palette fade function. Unfortunately, you have to set 0x8000 to 0x0 after the fade-out but before the fade-in, like in the previous script, because otherwise the fade-out will be colored
Also, if you wanted to continue the event that calls the flashback after the flashback is completed, you will need another type 0x2 level script on the calling map.
As for application into a script, there are a few things I need to check first. Once I work out the kinks, I'll make one more video showing the final product and post the script(s) here.
edit: Okay so I think I've gotten everything working the way I want it to. Now all that's left to do is for Thrace to take a look at it and see if everything's working the way he wants it to. Here's a video with an example of how a flashback would be implemented. Unfortunately, the flashback in the video takes place in a building so the flashback border looks a little weird because it intersects with the normal, interior black border.
Anyways, in order for the flashback to work, a couple of level scripts are necessary:
1. The level script (type 0x2) with the event. This is pretty obvious since the flashback is an event and it needs to run automatically
2. Another level script (type 0x4) on the map of the event. In this script, there is a 'callasm' command which loads the border sprites into the VRAM and places them in the right spots. This has to be a type 0x4 level script and if you put the 'callasm' into, say, a setmaptile script, no border will appear. I think that this is because the setmaptile script runs not only before the map is loaded but also before the sprites are loaded. Because of this, the border is loaded but is then immediately overwritten. Also, this script contains the 'setvar 0x8000 0x42' which triggers the greyscale palette loading function (type 0x0). This has to be set here because if you set it in the calling script, the fade-out will use shades of grey
3. A setmaptile script (type 0x1) on the map where the flashback is called from. The only command in this script is a 'setvar 0x8000 0x0' which turns off the greyscale palette fade function. Unfortunately, you have to set 0x8000 to 0x0 after the fade-out but before the fade-in, like in the previous script, because otherwise the fade-out will be colored
Also, if you wanted to continue the event that calls the flashback after the flashback is completed, you will need another type 0x2 level script on the calling map.
Last edited: