FenixFyreX

Fire Deity
Veteran
Joined
Mar 1, 2012
Messages
434
Reaction score
310
First Language
English
Primarily Uses
FyxLFX

Version 1.1


Introduction

This script allows the user to setup light effects on their maps. Its unique - you can use any image, at any size. You can also add effects to these light effects.

This is the Ace equivalent of my VX script.

Features

  • Use any sized image for a light effect.
  • Add lots of effects to said light effects.
  • Define these light effects from the script editor, or on the spot in an event's comment!
  • A switch is given that turns the system of/on..this can be used in conjunction with a time script!
  • Lots of control over how the lights work.

Screenies

Day:


Night:



Example:

Script

Actually, its a demo! Here you go: FyxLFX v1.0

FAQ / Notes

How do I setup a light effect?

First, you need to create a light preset in the config section of the script. This is an example:

Code:
    "Ghost" => {
      :filename => "ghost",
      :flicker => [0,0],
      :zx => 2,
      :zy => 2,
      :blend => 1,
      :color => [-1,-1,-1],
      :offset => [0,-16],
      :opacity => -170,
      :wave => [2,5,1],
      :fadein => true,
    },
As you can see there are lots of things you can define when making a preset; here is a list of them:

Code:
  # Options for the preset are as follows; if a * is next to it, its mandatory:
  #
  #   :filename *  The name of the file in Graphics/Lights/
  #   :fadein      Should the effect fadein? 0 is false(default), 1 is true.
  #   :flicker     Should the light flicker? Must be an array of two numbers.
  #   :zx          Zoom X of the effect, 1 is default
  #   :zy          Zoom Y of the effect, 1 is default
  #   :z           Z coordinate of the effect. 0 is in front, 1 is behind.
  #   :blend       0 is normal, 1 is add, 2 is subtract
  #   :switch      Adheres to the light switch? true or false. Default is true.
  #   :color       An array of 3-4 numbers, like so: [155,100,0] # Yellow
  #                To make a random color, put -1 in the color index spot, so
  #                a fully random color would be [-1,-1,-1]
  #   :offset      An array of two numbers. [-1,1] will offset the image left
  #                and down one pixel.
  #   :opacity     Anything from 0 to 255. Sets maximum opacity for the effect.
  #   :wave        An array of 3-4 numbers, [amp, length, speed, phase]
  #
  # :wave makes the image wiggle. Use the help file for further information on
  # wave effects. Look up Sprite in the help file.
After you've set up your preset, then you add a comment on an event page of an event whom you want the light effect to display at/on.



Code:
#  <prelfx string> OR <prelfx=string> OR <prelfx = string>    # You get the idea.
If you'd rather define the light effect on the spot, you just place a comment like so in the event's page:



Code:
# <lfx fn lantern; zx 1; zy 1; bl 1; cl [0,150,255]; os [0,0]; op 210; w [2,50,10]>
That would use the fn(filename) lantern.png from the Graphics/Lights/ folder. the zoom_x is 1, the zoom_y is 1, etc, so on and so forth.

If you have any questions, feel free to ask.

If you use this in your project, don't forget to credit me ;)
 
Last edited by a moderator:

Dr.Yami

。◕‿◕。
Developer
Joined
Mar 5, 2012
Messages
1,004
Reaction score
758
First Language
Vietnamese
Primarily Uses
Other
Yay, FFXLFX Ace version XD.

Nice work Fenix XD XD XD
 

Ronove

♫꒰・‿・๑꒱
Veteran
Joined
Mar 12, 2012
Messages
1,063
Reaction score
363
First Language
English
Primarily Uses
RMMV
Looks snazzy! I do have a question though: what do the numbers for flicker mean? Like you say it has to be an array of two numbers, but I have no idea what it means! Could you explain that a bit better so I know how/if the numbers determine the frequency of flickering or whatnot?

Also I'm not sure if the z direction works right. I set something to 0, and the light disappears. But if I don't set anything at all, the light appears behind characters. If I set to 1, likewise can't see it anymore. Am I doing something wrong? Even in your demo using something set to 0 for z doesn't appear to do anything.
 
Last edited by a moderator:

FenixFyreX

Fire Deity
Veteran
Joined
Mar 1, 2012
Messages
434
Reaction score
310
First Language
English
Primarily Uses
Hmm...must be a bug; I'll look into it. As for the flicker option, here is how it goes:

The first number is the chance of the effect flickering completely off for a few frames. The formula is as follows:



Code:
self.visible = (rand(@flicker[0]) != @flicker[0]-1)
which means that if a random number between 0 and the first flicker value equals the first flicker value - 1, the effect will flicker off (completely invisible) until it is NOT equal again.

The second number is



Code:
self.opacity = 255-rand(@flicker[1])
which means that a random value anywhere from 0 to the second flicker number is subtracted from 255 and set as the opacity value of the effect.

Basically, The lower the first number, the larger chance of the effect snuffing out for a frame; smaller numbers might mean more frames where the effect is completely invisible.

The lower the second value, the less chance of opacity change in the effect (more or less opaque).
 
Last edited by a moderator:

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
410
Reaction score
61
First Language
English
Primarily Uses
Hmmm very nice!

I have a question, I have something that changes my screen to greyish color, but when that happens the lighting effects darken as well and are barely visible... Is there a way to have the lighting effects unaffected by color tint?
 

Chaos17

Dreamer
Veteran
Joined
Mar 13, 2012
Messages
1,311
Reaction score
485
First Language
French
Hi,

Is it possible to add this feature please ?

Create a light effect on a specific map postion
 
Last edited by a moderator:

Chaneque

Prince of Strange Things
Veteran
Joined
Mar 17, 2012
Messages
687
Reaction score
45
First Language
English
Primarily Uses
N/A
My only problem is the lights seem a bit faint. Is there any way to make them brighter?
 

FenixFyreX

Fire Deity
Veteran
Joined
Mar 1, 2012
Messages
434
Reaction score
310
First Language
English
Primarily Uses
@Kumori - You make all the lights in your favorite image editor. You can adjust the zoom_x/y of the effect and tone / color in the script as well. I think its safe to say you have full control over the sprite's brightness :) IF that's not what you mean, PM me the problem again, and I'll see what I can do.

@Chaos17 - Just use an event on that map location. Check out my snippet thread for a scriptlet to displace an event by x,y,z pixels.

@Icenick - That feature will be available in the next update :)
 
Last edited by a moderator:

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
Hello,

  I don't know if someone noticed, or if it's just happening with me, but then i try to enter a map with one or more light effects on (like some lanterns through comment tags), the player crashes with no mention of a line code (RGSS3 stopped working). When i already begin at the map, the game and the light effect works normally, but when i try to teleport to the map, the testplay crashes 100% of the time.

  I am sure it's pretty hard to know what might be happening, as the crash is leaving no clue of why it's happening. But could someone else test it out to check if the same thing happens?

  I really want to use this script, it make wonders and adds immersion to a castle interior (per example).
 
Last edited by a moderator:

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
This is a great script, but I've noticed that when you activate a light effect on the player, then remove said light effect that the effect comes back whenever you switch maps( ex. get drunk in the demo, have the lady dunk you in water and then when you walk back up to the house you are glowing red again) I'm hoping there's a way to fix this as I've been using this script for a while to make effects for a ghost-viewing ability in my game but it doesn't work right when the effect keeps popping back up on it's own.
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
What are the terms for this script? Free to use for both commercial and non-commercial?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,718
First Language
English
Primarily Uses
RMVXA
If I play the game in the editor I have no problems.

However, if I encrypt it and then play the encrypted version, I get the error message

File does not exist: Graphics/Lights/lantern.png

The same thing happened with the file fireplace.

Is it possible that the encrypted file is unable to read the existence of the graphic or perhaps the whole folder?

EDIT

In case it is of any use, there was another script I had which was unable to read the data once the game was encrypted.  The discussion and solution can be found on this topic http://forums.rpgmakerweb.com/index.php?/topic/21203-passability-messed-up-by-encrypting-the-game/  I do not know anything like enough about scripts to know if it is the same type of issue here, so the link may be irrelevant.

EDIT AGAIN

Apparently it was the same issue.  The solution is the second method shown in this post by Shaz http://forums.rpgmakerweb.com/index.php?/topic/21315-data-not-being-read-after-encryption/?p=203905

Without that amendment it appears that any encrypted game will crash on entering a map which calls up this script.
 
Last edited by a moderator:

Elpropax

Warper
Member
Joined
Sep 10, 2015
Messages
2
Reaction score
0
First Language
Visual Basic
Primarily Uses
Can i use this script for a commercial game? Thanks!
 

Latest Threads

Latest Posts

Latest Profile Posts

Stream will be live shortly! I will be beginning a play-through of Resident Evil 4! Feel free to drop by!

1st iteration on castle interior in Tiled.
I've started up Pillars of Eternity. It's interesting how the game does a "select choice" cutscene using still image art for dramatic flair. I wonder if that might work for my RPGMaker project.
The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.
Gamedev for relaxing? yes or no?

Forum statistics

Threads
107,735
Messages
1,031,745
Members
139,872
Latest member
ExSaNTIEr76
Top