DarthVollis

Understanding Victor's Engine - Light Effects

54 posts in this topic

*Edit: With this I am using Victor Engine - Basic Module v1.20

I recently learned how to use Victor Sant's Light Effects and I thought everyone could use it.

I only know the Event Light effect at the moment and will post more in the future after I learn them.

Now for the tutorial.

Find and download Victor Engine - Basic Module This is a must.

Then download Victor Engine - Light Effects This is necessary for the lights and comment call to work.

Place these two new scripts in your scripts below material and above main.

From Victor's website or somewhere else download the Lights folder. This folder contains all the graphics for the lights. Put this folder in the graphics folder of your game.

 

Edit: To get the folder of your game simply start the editor with your game and click on the Game tab and click Open Game Folder.

Go to a map that you want lights in follow these steps.

1. Create an event. I call this event the control event for later reasons.
2. Set the event trigger to parallel process. All light events must be set this way if you want them to work in the "background".
3. In the code of the control event pick "comment".
4. For me the control event created my shade. Shade is what makes the screen darker.
5. In the "comment" of step 4 type this:

<create shade>
opacity: (0-255) Comma Here. Pick a number in this range. The larger the number the darker the shade.
blue: (0-255) Pick a number in this range. The larger the number the more "blue" the shade will be. This can be green, blue, or red. This is also optional. I changed my colon to a semi-colon.
</create shade>

6. Now you have your shade. You can continue on from here or create another event for your lights.
7. The lights. For now just going to explain the light events.
8. Just like the control event, the light event (which can be the control event too) is also set to parallel process.
9. The comment code is a little more complex than the shade code, but nothing to frown at.
10. Here is the code:

<event light>
id: 50 Comma Here (This is the light event id, not the event id! I started at 50. This may not be what the starting number is but it works for me.) (Every light event on the same map must have different id's. I made mine in a counting order.)
index: (This is the event id. It can be found in the top left corner of the event. For example, 004 is 4.) Comma Here
name: (This is the name of the light graphic found in the light folder at Graphics/Lights. For example, "light" or "lantern_down") (All the image names here must be enclosed with quotation marks.) Comma Here
opacity: (0-255) Pick a number in the range. The larger the number, the brighter the light will be.
</event light>

Edited by DarthVollis

Share this post


Link to post
Share on other sites

This is great!

Im new to VX ace, so im still learning the new scripts and functions, but i know that this will help me immensely later on.

Thank you for this tutorial my good sir.

DarthVollis likes this

Share this post


Link to post
Share on other sites

I'm really interested in using this script, I want to add nice lighting effects but I can't seem to get it to work, I've created the shade, the map is dark but the light event seems to crash the game instantly giving the error: Line:1049: NoMethodError occured. Undefinied method '[]' for nil:NilClass

 

I'm new to the scripting so I'm not sure what's wrong with the line, I have installed the relevent scripts of Victor's and line 1049 in the lighting script reads:   @x = $game_map.adjust_x(@target[:x]) * 32 - width / 2  + @light.x + 16

 

I'm also not sure what to enter in "light id", the OP says 50 but 50 isn't neeeded? I've tried 50, any random custom number... i'm not entirely sure what i'm numbering here. Everything else is named corrrectly in the comment in the light event and the light.png files are also correctly placed in Graphics/Lights

 

Any suggestions? Thanks!

DarthVollis likes this

Share this post


Link to post
Share on other sites

Okay here is the image of my event. All this must be enter as a comment or it will not work. You need one of the event to be the shade control event. As in the image I have the code for the shade. Pay close attention to mine because the place where it says blue has a semicolon. If you have a semicolon here the color will not be what you have here. It has to be a colon for that to work. I didn't won't it to work so I put a semicolon. Now the opacity is how dark it will be. The larger the number the darker it will be. It can go up to 255.

 

Next in that event if you want it to be a light ass will than you need the second part of the code I have up there. For this to work you need a folder in your graphics called "Lights". In this will be all the light images. Victor Sant's script should have this to download somewhere on that page. The ID number is the number of the light event. Every one of the light events need a different one. I like to start off at 50 because that works for me. Remember that once you use 50 that number is not usable again on this map for your lights. The next part is the index. Index is the event ID number. Refer to the top of the event page for this number. Each of your light events must have this and it must be the number of the event. For example in the image mine is 5. That is the event ID number of my event.  Name is the name of the image that is used from the Lights folder. Refer to this folder for all the correct names. Finally the last part is the opacity. This is how bright the light will be. The bigger the number the brighter the light. It can go up to 255.

 

I hope this helps.

 

VictorLight.png

Share this post


Link to post
Share on other sites

Thank you! I believe I was mistakenly writing the name of my event as the ID, as in whatever words I'd called it. After renaming it to the number it works perfectly.

 

The screenshot helped loads, Working perfectly now :)

DarthVollis likes this

Share this post


Link to post
Share on other sites
I never did get it work right. I finally gave up.

Literally copy Darth's event line for line, I myself made two events (one for shade and each subsequent one for a light source) but he's shown you can do it with one. You can't go wrong then. Since then I've always copied + pasted the event, updating the light ID and event ID as I go, and each light works fine. It's complicated stuff for me still though :P

DarthVollis likes this

Share this post


Link to post
Share on other sites

I took some time to find out what the problem was with ShinGamix's Script or event. He did every thing right, but it wasn't his fault. It turns out that he had a script conflict. The problem is that if you have many scripts as in his case you may have such a conflict. That is a pain.

Share this post


Link to post
Share on other sites

Does this only work with one event per map?

I am trying to use this event for several torches in one room, but only one will light up, even if I change each of the indexes to match the event. :/

Share this post


Link to post
Share on other sites

It can be used as many times as you like, within reason I'd imagine, my first attempt at it that I got working was with 6 torches + a light source between them:

 

Lights.jpg

 

 

I've since been experimenting with dynamic lighting, as in a cutscene with a fire that spreads throughout a town. It's a lot of fun, easily one of my fav scripts.

Share this post


Link to post
Share on other sites
Does this only work with one event per map?

I am trying to use this event for several torches in one room, but only one will light up, even if I change each of the indexes to match the event. :/

 

Reading the instructions on the script helps a lot:

#  The IDs of the light effects are used as identifiers. Don't use the

#  same value for different light spots, if you do so, one light will

#  replace the other. Also the IDs are used as referece to when

#  removing lights and changing light opacity.

Share this post


Link to post
Share on other sites

Yeah, I actually just figured that out.

I knew it was probably in the instructions somewhere, and I had missed it.

Thanks.

 

Dang, it was really specific about that, too.

*fails* OTL

I feel silly, now.

Edited by Schloops

Share this post


Link to post
Share on other sites

Don't feel silly. It happens to everyone sooner or later. That is the reason that I wrote this tutorial so that people could benefit for what I have learned. Now I have lights in every single house, dungeon, and anywhere else I want in my game. It is almost unlimited.

Share this post


Link to post
Share on other sites

I copied Darth's script and pasted it onto my even light but i recieved an error before entering my game

 

Script "Lights" line 1049: NoMethodError occured.

undefined method `[]' for nil:NilClass

 

Help. :/

Share this post


Link to post
Share on other sites

First off, it isn't my script. It belongs to Victor Sant. I wrote this to help people who are using it.

 

Second, do you have both scripts that are needed? If so, do you have a folder called "lights" in your Graphics directory?

 

Third, don't just copy my event. You must make the index the same number as your event. Ergo, if your event is number 118 then the index is 118. If you are still having trouble post a picture here and I will help.

Share this post


Link to post
Share on other sites

Hi, i've got trouble with this script.

I followed step by step your tutorial(Event light with my event ID,Lights folder in Graph folder etc..)

but when i launch the game i get an error:

 

Script "victor engine light effects" line 734:ArgumentError occured.

wrong number of arguments (1or 0)

 

Thats the line in the script:

727 class Spriteset_Map

728    #--------------------------------------------------------------------------
729    # * Alias method: initialize
730    #--------------------------------------------------------------------------
731    alias :initialize_ve_light_effects :initialize
732    def initialize
733        initialize_ve_light_effects
734        2.times { update_light(true) }
735  end

 

All Victor's script i took are updated

Sorry i'm a real noob it's my first game and when i watch a script i see hieroglyph and get headaches

PLEASE HELP :'(

Share this post


Link to post
Share on other sites

Common error.

 

I actually had to tweak it to figure it out.

 

Mine had to do with how I was setting the index to 1 instead of 0 for the index of the actor light. Set it to 0 and it worked.

 

If you continue to have problems, post your comment here.

Edited by Titanhex

Share this post


Link to post
Share on other sites

Hello,

I have  some issues with the lighting effect.

The shades are working perfectly, but the lighting just won't do.

 

Do you guys know what i did wrong?

 

 

 

<event light>
id: 50, index: 4, name: ''light'', opacity: 160
</event light>
 
id of event is 004
paralell procces is on.

Share this post


Link to post
Share on other sites

Hello everyone,

 

I am having some minor issues trying to figure out how to get the flashing/flickering to work correctly. I got the lights to work fine and even got the actor lantern working great and I got the basic "flash" function working, but how do I adjust the speed? For example, if I wanted to make it blink quickly? Or, have it flicker at different intervals (like real flickering lights do)

 

Is there a way to do that and I'm just overlooking it? Thanks!

 

P.S. - Thank you for the screenshot earlier in this thread and the quick little guide, it definitely helped put things into perspective a bit more for me!

 

EDIT - How would I go about adding a campfire-esque light? The torch light image is a bit more yellow than red, would I need to edit the color manually myself, or could this be achieved in the shade event on the same map? Essentially, I would like, in one map, to have lamp light sources, the actor's lantern and a reddish orange burning campfire, if that is possible.

 

Thanks :)

Edited by jaggernaut25

Share this post


Link to post
Share on other sites

Oh, thank goodness. No offense to Victor, since this is a great script, but it was difficult to understand for the brain-dead like me! Thanks for great tut ^-^

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

  • Recently Browsing   0 members

    No registered users viewing this page.