FyxLFX

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by FenixFyreX, Apr 26, 2012.

  1. FenixFyreX

    FenixFyreX Fire Deity Veteran

    Messages:
    434
    Likes Received:
    307
    Location:
    A Volcano Somewhere
    First Language:
    English
    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:[​IMG]

    Night:

    [​IMG]

    Example:

    [​IMG]
    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: Apr 26, 2012
    #1
  2. Dr.Yami

    Dr.Yami 。◕‿◕。 Developer

    Messages:
    994
    Likes Received:
    738
    Location:
    Finland
    First Language:
    Vietnamese
    Primarily Uses:
    Other
    Yay, FFXLFX Ace version XD.

    Nice work Fenix XD XD XD
     
    #2
  3. Ronove

    Ronove ♫꒰・‿・๑꒱ Veteran

    Messages:
    1,027
    Likes Received:
    345
    Location:
    Over the moon
    First Language:
    English
    Primarily Uses:
    RMVXA
    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: Apr 29, 2012
    #3
  4. FenixFyreX

    FenixFyreX Fire Deity Veteran

    Messages:
    434
    Likes Received:
    307
    Location:
    A Volcano Somewhere
    First Language:
    English
    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: Apr 29, 2012
    #4
    Ronove likes this.
  5. Icenick

    Icenick Veteran Veteran

    Messages:
    158
    Likes Received:
    19
    First Language:
    English
    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?
     
    #5
  6. Chaos17

    Chaos17 Dreamer Veteran

    Messages:
    1,253
    Likes Received:
    420
    Location:
    France
    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: May 4, 2012
    #6
  7. Chaneque

    Chaneque Prince of Strange Things Veteran

    Messages:
    687
    Likes Received:
    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?
     
    #7
  8. FenixFyreX

    FenixFyreX Fire Deity Veteran

    Messages:
    434
    Likes Received:
    307
    Location:
    A Volcano Somewhere
    First Language:
    English
    @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: May 5, 2012
    #8
  9. Nosleinad

    Nosleinad Storyteller Veteran

    Messages:
    351
    Likes Received:
    28
    Location:
    Brazil
    First Language:
    Portuguese
    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: Jan 27, 2013
    #9
  10. Alexander Amnell

    Alexander Amnell Jaded Optimist Veteran

    Messages:
    3,405
    Likes Received:
    1,730
    Location:
    Zaječí
    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.
     
    #10
  11. Napoleon

    Napoleon Veteran Veteran

    Messages:
    869
    Likes Received:
    96
    First Language:
    Dutch
    What are the terms for this script? Free to use for both commercial and non-commercial?
     
    #11
  12. Kes

    Kes Global Moderators Global Mod

    Messages:
    21,052
    Likes Received:
    10,701
    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: Dec 23, 2013
    #12
  13. Elpropax

    Elpropax Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    Visual Basic
    Can i use this script for a commercial game? Thanks!
     
    #13

Share This Page