Help Understanding: ACE + (Victor Engine - Fog Effects)

Hi there! I'll dive right in.

Quick Question:​
I want to learn more about scripting in VX Ace and I need help.
Which part of the script (Victor Engine - Fog and Overlay) makes the sprite repeat itself along the X and Y axes?​

Link to script:

Settings:
Overlay settings are very simple. They are set up in the map notebox to be a static overlay:
XML:
<fog effect>
id: 1
name: "m1/r1.png"
opacity: 255
</fog effect>

Pictures:
Spoiler: Pictures
Map in editor:
1659399861810.png


Map starting position (note section circled in red):
1659400068033.png


Example of the overlay repeating:
1659400177783.png


Context - Longer version of the question:
I already know how to make the fog repeat: it's because the image I'm using for the fog is only 544px wide, so as soon as the map scrolls past 544px, the overlay image starts over again. This makes sense for the idea of a scrolling fog sprite that you can tile across the screen

However, I've started to toy more with scripting inside of Ace. My current project is to make upgrades to Victor's fog script so that it can be more adaptable as a parallax mapping tool. Unfortunately, I don't fully understand how the VX Ace graphical display works. (If anyone has a good resource that breaks down how all the elements behind the scenes fit together, I will absolutely read it. The help manual has been great, but is only so useful.)

I have looked through this entire script top to bottom, at least four or five times, but something isn't clicking. Is anyone able to help me understand. Which part of the script makes the fog_sprite repeat in the x and y axises?
notice that the repeating image appears [map edge] + [trailing space]
where [trailing space] is 1, because your original image is located [map origin] + 1.
so, X + 1 - 1 = X, where X is [map edge]

......so, the image repeats a map-worth of lengths on the X axis away.
the image I'm using for the fog is only 544px wide,
.....and why is that?
why 544 and not 480? or 512? or 791?
notice that the repeating image appears [map edge] + [trailing space]
where [trailing space] is 1, because your original image is located [map origin] + 1.
so, X + 1 - 1 = X, where X is [map edge]

......so, the image repeats a map-worth of lengths on the X axis away.

.....and why is that?
why 544 and not 480? or 512? or 791?
Hi @gstv87!

Thanks so much for taking the time to read and respond. It means a lot to me.

I would like to find which part of Victor's script causes this repeatedly tiling of overlay images to happen.

The overlay images I'm using are 544px (17) tiles wide, which is actually narrower than the total map size (map width is set as 20 blocks wide). The simple answer to why is just because I wanted to experiment with the script and see what happens when Fog_Sprites don't perfectly fit the total map size.

I do get that the overlay images I'm using are being tiled across the screen, I'm hoping to find where in code that it's written in.
I'm hoping to find where in code that it's written in.
class Sprite_Fog < Plane

there
Planes tile images.
the object itself, tiles the image.
class Sprite_Fog < Plane

there
Planes tile images.
the object itself, tiles the image.
Oh, thank you!

That's really, really helpful. So it sounds like the only way to restrict the visibility of that tiling behavior is to assign them to a viewport that's exactly the size of the bitmap itself, or to make the bitmap always fit the size of the viewport.

That makes sense. I clearly missed that in the help manual. Thanks again @gstv87 !

Edit: I did some more digging through the manual, and for my purposes I was actually able to change class Sprite_Fog < Plane to class Sprite_Fog < Sprite, and it looks like it's going to work exactly the way I'd like it to (won't work with levels that loop, but is the easiest solution for now).

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/help-understanding-ace-victor-engine-fog-effects.150015/