Jump to content
Sign in to follow this  

Simple and Fun Lighting with Events!

Recommended Posts

This is a very simple tutorial using variables to determine the level of light on a map using torches or lanterns! I hope you all enjoy this!


Ok, ok, we will get on with the tutorial. Keep in mind this, like most events, works with both RMXP and RMVX.

First, you will want to create an autorun event on some section of your map. This event will require two(2) pages.

On that first page you will post something quite simple; first you will need to make a variable, I called mine 'lighting' clever, eh?

Secondly you will need to set that variable to a constant of zero(0), then you will also set a self switch of A to on. (Alternately, if you are planning on having the light reset each time you leave the room, you may set this as an actual switch, one that you can set to turn off whenever the player leaves the room.)



Now onto the second page! This one needs to be set to parallel process, as it will constantly be checked. On this page you will make a number of conditional branches, make a number equal to the amount of lights you plan to use, plus one(1). Each of these branches will be based off of the variable you just set! The first of them will be your default light value and be based on variable=0, you can have this as full light if you plan to make it darker, or as fairly dim light to make it brighter.



(Keep in mind that you don't want the map to be pitch black, or that can annoy a player, instead go for a darkish blue with a grey tinge, it should make things hidden but allow the player to see.)

Now you will continue to make conditional branches, one for each light, and use your best judgement on what to set the lighting to for each, keep it constant though.

(You should be using the 'Change Screen Color Tone' event button in XP and the 'Tint Screen' Button in VX/Ace for these.)

Now, on to the fun part! You will make a number of events for your lights! You will actually only need to make one event and can copy and paste it, due to the variable! Yay for time saving!

Ok, this will, again, be a two(2) page event. On the first page you'll set the priority to 'Action Button' and 'same level as player' if on VX.

On the first page you will set a choice, usually you'll put something like 'light the torch' and 'ignore it' but you can flavor that however you want. If the player chooses to light the torch you will set the variable you set earlier to constant +1, then turn on self switch A. If they choose ignore, you need not put anything.



This will force the parallel process event to check the variable and increase the light on the map as needed.

Now onto the second page, this one can change depending on what you intend to do. If the player cannot dim the lights again, then you will either set it to be an active flame using the 'stop animation' tag so it looks burning, or you can set it to a dead flame or light if they are turning off lights.

If you intend to allow the player to turn off lights, you will simply need to set this page to the opposite of the first one, have the variable you set up earlier be a constant -1 and then turn off self switch A.

Well, that's all there is too it, rather simple really. It's not as impressive as the lights from some of the neat scripts out there, but it's simple and easy to use!  B)

Share this post

Link to post
Share on other sites

Simple, yet can add much detail to some maps or even help with puzzles or obstacles for dungeons.  Imagine having to have the light at a certain level to open a gate/door?  Imagine having to extinguish lights so you can escape a prison?


Thanks Shaddow!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.