EDIT: I apologize in advance for the wall of text. I'm just trying to clear up my request and make it as understandable as possible.
Okay, let me try to be a bit more clear. This is a single-screen fog overlay that is currently on Layer 5 for every screen of my forest. It's transparent, and the dithering effect is a two-frame animation, so the fog appears solid, but is even more transparent than normal, which also has the added benefit of helping disguise any transparency color issues that can come up due to how transparency is handled in the engine. However, the drawback is that every single tile of space on the screen is used with a unique combo. No combo is used more than once.
(This is an old picture, and there is indeed a tile error on the absolute bottom of the screen shown. This has been fixed already.)
This FFC script allows me to make this layer scroll to the lower right, further smoothing the dithering effect visually as well as making the fog appear more natural. It's an incredibly pretty effect to see in-motion.
ffc script ScrollingMist{
void run(){
int x_position;
int y_position;
int xspeed = 1;
int yspeed = 1;
for (int i = 0; true; i = (i + 1) % 4){
if ((i % 4) == 0){
x_position = (x_position + xspeed) % 255;
y_position = (y_position + yspeed) % 175;
}
Screen->DrawLayer(5, 8, 0x50, 0, x_position, y_position, 0, OP_TRANS);
Screen->DrawLayer(5, 8, 0x50, 0, x_position, y_position - 176, 0, OP_TRANS);
Screen->DrawLayer(5, 8, 0x50, 0, x_position - 256, y_position, 0, OP_TRANS);
Screen->DrawLayer(5, 8, 0x50, 0, x_position - 256, y_position - 176, 0, OP_TRANS);
Waitframe();
}
}
}
I didn't make this myself, it was made from a request I made a while back. Anyways, since it's an FFC script, the fog vanishes completely when you move between screens, and I was told that a global version of this script would fix the issue. Unfortunately, I don't know how to do so.
Now, this is a map of a later area of my quest. The layering appears fine in an image, but after fixing an issue that I noticed regarding the grey cliff tiles, I'm going to have to re-arrange the layers so that Layer 3 is drawn as a background. Considering the brown walkable tiles are currently drawn on the same layer as my background, it's going to be a huge pain.
(Sorry for the huge image, it's the only one I have at the moment)
The problem here is that while it's a tiled background, the size of the area being tiled does not gracefully fit into a single screen, and it takes 10 unique screens until it tiles as seen in the map, and even then it still has issues in some spots where it doesn't line up right.
If I can use a similar effect as my fog overlay, except applied to a smaller source image and placed on a Layer-3-as-background, it would not only save me a huge amount of tiling work, but would add to the visual atmosphere of the area. Since it's a nice effect with a variety of possible uses, the script description that I requested before to make is a single universal multi-use script rather than a separate individual version made for each situation. This way, it would be easier to set up and get working, as well as be a very useful addition to the script database.
The idea is to mimic the script layout of a script like this...
// Main BigEnemy definition table. When adding more enemies that need to be bigger, repeat
// "BigEnemy" function for each extend enemy with the following arguments:
// 1. "n". it`s a pointer to affected enemy. Don`t change.
// 2. Enemy ID of affected enemy.
// 3. Draw X offset
// 4. Draw Y offset
// 5. Hitbox X offset
// 6. Hitbox Y offset
// 7. Hitbox width, in pixels.
// 8. Hitbox height, in pixels.
// 9. TileWidth, in tiles.
// 10. TileHeight, in tiles.
// 11. Custom animation flags.
void SetBigEnemySettings( npc n){
//BigEnemy(n, 188, -32,-48,-32,-48,64,64,4,4,9);//Test Giant Goomba
BigEnemy(n, 191, 0,-16, 0, 0, 16, 16, 1, 2, 0); //Ghost Armor (GFX: 19 Tall, 16 Wide HIT: 16 Tall, 16 Wide)
BigEnemy(n, 190,-4,-2, 0, 0, 23, 20, 2, 2, 0); //Purple Slime
BigEnemy(n, 177, 0, 0, 0, 0, 32, 32, 2, 2, 0); //Giant Squid
BigEnemy(n, 180,-8,-8,-8,-8, 32, 32, 2, 2, 0); //Corrupt Fairy
BigEnemy(n, 183,-8,-8,-8,-8, 32, 32, 2, 2, 9); //Twin Scorpions
BigEnemy(n, 187, 0, 0, 5, 7, 21, 24, 2, 2, 0); //Hero's Shade Core
}
...and use a definition table to input what layer is being used for the effect, how big the tiled image is, and what direction to set movement to, so that it would be a single universal script. Is that possible, or not? If not, then may I simply request the fog version, with directions on how to modify it to work for my other background effect?
Edited by kurt91, 10 May 2015 - 05:01 PM.