Help - Search - Members - Calendar
Full Version: [VX] Lighting fun with variables
RPG RPG Revolution Forums > Scripting > Event Emporium > Eventing Tutorials
Shaddow
Hi! So, I realize that this section of the forum is just plain dead, and that makes for a sad panda. SO! I've decided to start writing up simple, but useful, tutorials using nothing but events! This is the first one, it's how to increase and decrease the light level on your map using variables! Neat huh?! laugh.gif

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 for these.)

Click to view attachment Before!
Click to view attachment After!

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! cool.gif
X-M-O
Quick and easy eventing! Thanks for doing this, Shaddowval. happy.gif
Shaddow
Yay a response! My last tutorial was kind of ignored T_T. More to come though! This is only the start! Viva la Eventolution!


....ahem....I may be a bit hyper...
X-M-O
Well, it will take a little bit of work to bring developers in here to learn a bit, but don't give up if you don't see replies (views will show how many people are paying attention even if they are just lurking and learning). =]
amerk
Fairly useful tutorial. I can see this expanded upon for even more challenges, such as a dungeon design requiring the player to light the torches within a certain time frame.
Ndoelicious
Wait! A question!
Does X-M-O even use VX? xDDD
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.