How do I make this script work?

http://www.rpgmakervxace.net/topic/4644-sun-rays-heaven-rays/

I downloaded the images, and created 'Overlay' in Graphics. Should these images show up somewhere? Should I create a new folder in the Resource Manager? Cuz no images showed up in the game maker. Also, should I place the script in the Materials section of the script editor or somewhere else? Do I edit something in the script to make it work? Should I import these images somewhere?

Scripts make my head spin around. 
Yes, you will need to create an overlay folder in graphics. However, the filename will be different depending on what function you want the file to have (shadows, ground, parallax etc.) If you read through the script you will find the prefix you need to add for the filename depending on what you want:

In the script you can find: "Filename Prefix" + Map-ID + "-" + Number

Where Filename Prefix are one of the following (depending on what you want the picture to be):

"light", "shadow", "par", "ground"

So let's say we want a parallax, then we put the picture inside overlay and name it:

par27-1

This would mean that you want this file to appear as a parallax picture on map ID 27, and as number 1. Just make sure that you follow this for all of the files and you will be good.
It's still not working. I've placed my script in the materials sections. I've created an "Overlay' in Graphics in the game folder, and the Graphics folder in RPGVXAce which hosts all the animations and things like that. I've even named it "light001-1"

Overlay.PNG

Overlay 2.PNG

Why isn't it working?

I tried adding it under Main, and under Game Map in the Game Objects section, but it showed up with this

error: error.PNG
It doesn't go UNDER Main. It goes under Materials - ABOVE Main.


Try renaming it light1-1, without the leading zeros in the map id.
I renamed it to light1-1 like you said, it's still not working. I've placed it under materials, but above main. Do I need to add this image in the Resource Manager somewhere? 
Did you turn on the appropriate switch?
Which switch would that be? I don't recall setting a switch. 
Maybe not necessary. Did you actually read all of the instructions in the script that indicate how to set it up, and follow those instructions to customize it? It uses switches and variables, and you have to tell it which ones to use. If you don't set that up properly, it's not likely to behave the way you expect it to.
The main instructions mention nothing about switches, but a little way down we have this: 

#==============================================================================
module YSA
module OVERLAY
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Overlay Switches -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # These are switches which are enable overlay layers. Turn them on to show
    # them in your maps.
    #--------------------------------------------------------------------------
    # Default: ON
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    LIGHT_SWITCH = 1        # Turn on/off light layer
    SHADOW_SWITCH = 2     # Turn on/off shadow layer
    PARALLAX_SWITCH = 3     # Turn on/off parallax layer
    GROUND_SWITCH = 4     # Turn on/off ground layer
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Overlay Variables -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # A map can have more than one image per layer, that means you can have a
    # different light/shadow for day and night, or have a different ground when
    # an event occured.
    #--------------------------------------------------------------------------
    # Default: 1
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    LIGHT_VARIABLE = 2     # Switch to another light
    SHADOW_VARIABLE = 2     # Switch to another shadow
    PARALLAX_VARIABLE = 1 # Switch to another parallax
    GROUND_VARIABLE = 1     # Switch to another ground

Am I supposed to mess with these? (P.S How do I add spoilers?)
The configuration tells the script which switches and variables to use for controlling the script.


Your first step is to select unused switches and variables to prevent misconfigurations.


For example, if you want to use game switch number 100 to activate the overlay, then you change that line to


PARALLAX_SWITCH = 100


The second step is to make an autorun event on the parallax map to activate the parallax function for that map.


That is done by using a control switch [100] = ON command on that autorun event, and erase the event (after all switches and variables have been set)


You should also make sure that the switches and variables you're using for that script get named manually, because the script can't name the event switches and the name is the only thing that prevents you from accidentially using it again for another function...
I thought the same thing initially, but there is a bit of code that does turn on the switches at the start. However, if those switches are used for other things as well (which they likely will be, if you haven't changed them), then there could be something in the game (or in the save file) that's turning them off again.


That's the other thing - after adding this script, are you starting a new game, or playing from a save file you made prior to adding the script?
I got it work according to Andar's instruction of turning the switches on. 

Game.PNG

I haven't used the variables yet. Turning the variable on to one would mean that this effects lasts for the first map only? 

Tab1.PNG

Tab 2.PNG

Edit: I got a problem.

Game 1.PNG

I've got my map length to 35x30, but the effect is only showing up for the standard length of 17x13. Is there any way to cover the whole map with this effect?
I imagine the overlay image is meant to be the same size as your map.


Yep - checked the demo, and all the overlays are the same size as the map. So you need to calculate the width and height in tiles, both x32, and make your overlays that size.
Okay. Just one last question: what does the variable, in regards to this effect, do?
Are you not reading the comments? There are 4 variables. If any of the variables are set to 1, it will look for an overlay with 1 at the end. If the variables are set to 2, it will look for an overlay with 2 at the end.


Whether you use them or not, you MUST allocate variables for them, then in the script, put the ids of each variable (no leading zeros). If you DON'T allocate variables for them and you don't change the defaults in the script, then the script will still use those variables, and goodness knows what is going to be in them at the time, but it WON'T be what the script is expecting, and it'll very likely mess up your maps.
Okay. Just one last question: what does the variable, in regards to this effect, do?
The variables are more or less used if you want 2 different parallaxes or 2 different shadows (lights or grounds too) for one specific map.

If you use par27-1 it would show the parallax on Map ID 27 with parallax variable set to 1. If you then change the parallax variable within a event (for example you want the light to shine at different objects in a puzzle, you set the variable to 2 and add the filename to the second parallax picture you want for this specific map: par27-2.

Just like Shaz is saying though, make sure to change that variable when you leave that area though or all your other maps will be messed up. It's best to control this with a conditional branch and a switch so the proper parallaxes will show.

Hope that helps!

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-this-script-work.21129/