Terrax Lighting system

● ARCHIVED · READ-ONLY
Started by Terrax 1467 posts Page 50 of 74 View original ↗
  1. New version (1.4.5) now available


    http://mvplugins.com/plugin/Terrax/Terrax%20Lighting%20System


    or


    https://github.com/Terraxz/TerraxLighting


    Update:


    1) You can use a new event-notetag to cycle colors on an event.


    Light 200 cycle #FF0000 50 #00FF00 50 #0000FF 50


    It will create a light with radius 200, the first color will be #FF000 (red) and will stay for 5 seconds.


    The 2nd light will be #00FF00 (green) and will also remain for 5 seconds.


    The 3rd light will be #0000FF (blue) and will also remain 5 seconds.


    Then it will cycle back to red.


    Minimum of 2 cycle colors, maximum of 4 cycle colors.

    XGuarden said:
    No i man that once I activate the script, automaticly, it's activat on all my maps. So I ask myself where I need to tell witch map need to have it activatd.



    The script only activates on maps that have at least 1 event with a light in the note-tag or if the map has 'daynight' in the map's tag.


    So if you need maps that stay light, just don't put events with light-definitions in the note-tag, or leave the maptag empty.
  2. Terrax said:
    The script only activates on maps that have at least 1 event with a light in the note-tag or if the map has 'daynight' in the map's tag.


    So if you need maps that stay light, just don't put events with light-definitions in the note-tag, or leave the maptag empty.



    Thanks for the info. But let say that I have days/night cycle and light only open at night. It's possible?
  3. XGuarden said:
    Thanks for the info. But let say that I have days/night cycle and light only open at night. It's possible?

    Yes, but it takes a little scripting.


    You start in the plugins options by setting 'SaveDayNightHours' to 10 (for example)


    This will store the current hour of the daynight cycle in game variable 10.


    Then you make a paralel script with something like this in it.

    Code:
    ◆If:Daynight cycle > 19
      ◆If:Self Switch A is ON
        ◆Plugin Command:Light on 2
        ◆Control Self Switch:A = OFF
        ◆
      :End
      ◆
    :Else
      ◆If:Daynight cycle < 6
        ◆If:Self Switch A is ON
          ◆Plugin Command:Light on 2
          ◆Control Self Switch:A = OFF
          ◆
        :End
        ◆
      :Else
        ◆If:Self Switch A is OFF
          ◆Plugin Command:Light off 2
          ◆Control Self Switch:A = ON
          ◆
        :End
        ◆
      :End
      ◆
    :End
  4. Can I just use your other script that start common event at specific moment of the day instead?
  5. Updated the plugin and used those tags instead of my previous event's commands and recieved the same issue.

    • My RPG Maker is updated
    • screen resolution is 1920x1080
    • All lighting events present remain the same as before

    When the light plugin is activate it crashes with the same error, seems it's having problems with line 2489
  6. Skurge said:
    Updated the plugin and used those tags instead of my previous event's commands and recieved the same issue.

    • My RPG Maker is updated
    • screen resolution is 1920x1080
    • All lighting events present remain the same as before

    When the light plugin is activate it crashes with the same error, seems it's having problems with line 2489

    It looks like you have an event somewhere that has a wrong colorvalue. The error is in the flashlight section, so its probably a flashlight.


    I have updated the plugin to check for wrong colors, just download the latest version again (1.4.5). If the color used is wrong, it will


    default back to black. So you probably will see an NPC that has no flashlight because the tag is wrong.
  7. Hm, I just started playing around with this plugin so I might be missing something. That being said, I'm just trying to make a certain region light up (flash) while being synced to some cool thunder SFX. I don't understand why it wouldn't work (because it doesn't, nothing happens) when I use "TileRegion 2 ON #ffffff 200" as a plugin command.
    I am using other (not so bright) light sources on the map. And I'm also using Galv's Layer Graphics combined with Yanfly's region restrictions & Core plugin for parallax mapping so there is no tiles on the map. I doubt that has anything to do with it but in case you need to know.

    Currently very messy (why do I have 2 wait commands in a row? :guffaw: ) but you can see the event I'm trying to make below.

    Spoiler
    thunderfail.png
  8. Parallax Panda said:
    Currently very messy (why do I have 2 wait commands in a row? :guffaw: ) but you can see the event I'm trying to make below.


    I don't think tile-lights are good for those kinds of effects, your better off creating a fast flash with the effect functions.


    Plugin Command:effect_on_xy 192 192 600 #444488 5


    This will create a short flash on coordinates 192,192 with radius 600, color white, 5 cycles (short flash)


    It will be circular, but if you position it correct it might do the job.
  9. @Terrax


    Is there a script call or plugin command to change the opacity of the black layer?


    Thanks for the script btw, it's awesome.
  10. What is the best way for make light for a windows, that need to light on one direction so... But I alwayt want inside of the house do no be black at all lol. Thanks
  11. Terrax said:
    It looks like you have an event somewhere that has a wrong colorvalue. The error is in the flashlight section, so its probably a flashlight.


    I have updated the plugin to check for wrong colors, just download the latest version again (1.4.5). If the color used is wrong, it will


    default back to black. So you probably will see an NPC that has no flashlight because the tag is wrong.

    Updated the plugin and tried it on a map that contains flash lights, event lights, and the general terrain tag lights including some regional ones, the game functions without crashes but the frame rate is incredibly harsh giving about from what I can estimate almost 3 frames a second.


    So my next plan was to copy the map- remove each light type and test at a time from removing flash light events to light events and so on- I've concluded that the updated plugin is infact having difficulties with events that have light tags including standard circular ones. When the map is left with nothing but region and terrain lighting the game lags almost as bad with the events but shortly afterwards runs smoother until gradually being the smoothest frame rate possible. Pausing also resets the lag briefly also.


    I am however uncertain how to configure the screen size paramitters, my screen resolution may different to other players so I am uncertain what to do with it- and if it's an essential reason for my projects lag with the plugin. I'm sure you've kept things mostly the same except for the new functions, are there any drastic changes I should make with how light sources are executed?


    Thank you :)
  12. killerfer said:
    @Terrax


    Is there a script call or plugin command to change the opacity of the black layer?


    Thanks for the script btw, it's awesome.



    Plugin call : Tint set #333333


    For more opacity, increase the color value upwards.


    Plugin call : Tint set #000000  : total darkness


    Plugin call : Tint set #222222  : very dark


    Plugin call : Tint set #444444  : dark


    Plugin call : Tint set #666666  : early dawn

    XGuarden said:
    What is the best way for make light for a windows, that need to light on one direction so... But I alwayt want inside of the house do no be black at all lol. Thanks

    Improved flashlight and square beams for windows are next on the development list, after frame-rate improvements.

    Skurge said:
    Updated the plugin and tried it on a map that contains flash lights, event lights, and the general terrain tag lights including some regional ones, the game functions without crashes but the frame rate is incredibly harsh giving about from what I can estimate almost 3 frames a second.


    So my next plan was to copy the map- remove each light type and test at a time from removing flash light events to light events and so on- I've concluded that the updated plugin is infact having difficulties with events that have light tags including standard circular ones. When the map is left with nothing but region and terrain lighting the game lags almost as bad with the events but shortly afterwards runs smoother until gradually being the smoothest frame rate possible. Pausing also resets the lag briefly also.


    I am however uncertain how to configure the screen size paramitters, my screen resolution may different to other players so I am uncertain what to do with it- and if it's an essential reason for my projects lag with the plugin. I'm sure you've kept things mostly the same except for the new functions, are there any drastic changes I should make with how light sources are executed?


    Thank you :)



    I've been doing some testing on framerates and there are some improvements that 'm going to work on


    Currently the plugin works like this


    - Each frame update, all the events are scanned if they contain lights. if they do a lightsource is made. If you have a lot of events this scanning can take a lot of time.


    --> improvement : Scan all events on map-load and save them. In subsequent scans, only update the mapsources that have lights.


    --> expected problem : A way to handle spawned events that have lightsources, since they do not exist on mapload. Plugin call  to counter this effect.


    - Each frame update, the complete map is scanned for region and tag lights -> more then 3 tag/region lights takes 3 scan and kill framerates in a dramatic way.


    --> improvement : Build a stack on map-load and in subsequent scans work from the stack instead of continues slow mapscans.


    This is what i'm going to focus on first, before new features.


    I've updated the plugin on Github, it includes a speed-test function you can call. If displays the average time in ms that plugin takes


    each cycle to update the screen.


    You can use : Plugin command : 'script speedtest on' to display the timer.


    The timer will appear after 500 cycles have past, and give the average time it took to complete a cycle messured over 500 cycles.)


    It will give you a clue to what is causing the most delay in your game. Give it a test and ill get started on what causes most delays.
  13. @Terrax

    I don't think tile-lights are good for those kinds of effects, your better off creating a fast flash with the effect functions.




    Plugin Command:effect_on_xy 192 192 600 #444488 5


    This will create a short flash on coordinates 192,192 with radius 600, color white, 5 cycles (short flash)


    It will be circular, but if you position it correct it might do the job.

    Thank you for taking your time to answer my question. I really like this plugin, it does so much for the atmosphere that it's a must have.
    Unfortunately this thunder lighting I'm trying to make does not want to work for me. I can get the note tags part of the plugin to work just fine but plugin commands referring to "TileRegion" and the above suggested "effect_on_xy" does not work at all?

    I've disabled all plugins except YEP_CoreEngine, YEP_RegionRestrictions and GALV's LayerGraphics. Furthermore, TerraxLighting is at the top of the listed plugins.
    I also have a small "wall light" placed next to the window on the east wall. It has the note tag: "Light 40 #aca1a1 D2". There is also another event placed at the center of the map a few screens away, as to not make it pitch dark. That event have this note tag: "Light 1000 #726565"

    I'm using RPG maker MV 1.3.4 and besides what I said the project is kind of empty except the background layer and regions placed. It's essentially a new game.

    Here is another screenshot from the editor:

    Thunderfail2.png
  14. Parallax Panda said:
    @Terrax


    Thank you for taking your time to answer my question. I really like this plugin, it does so much for the atmosphere that it's a must have.
    Unfortunately this thunder lighting I'm trying to make does not want to work for me. I can get the note tags part of the plugin to work just fine but plugin commands referring to "TileRegion" and the above suggested "effect_on_xy" does not work at all?

    The effect coordinates are dot-based. So your effect is displayed at xcoor - 22 dots and 78 dots.


    To get the right coordinates, multiply the tile-width (48 dots) by the tile coordinates. (22x48) and (78x48)


    That would make the plugin call : effect_on_xy 1056 3744 600 #FFFFFF 5

    I've disabled all plugins except YEP_CoreEngine, YEP_RegionRestrictions and GALV's LayerGraphics. Furthermore, TerraxLighting is at the top of the listed plugins.
    I also have a small "wall light" placed next to the window on the east wall. It has the note tag: "Light 40 #aca1a1 D2". There is also another event placed at the center of the map a few screens away, as to not make it pitch dark. That event have this note tag: "Light 1000 #726565"

    To make the screen les dark its much better to use the tint plugin call


    Plugin command : tint set #726565
  15. @Terrax

    Damn, didn't expect an answer this fast! Again, thanks a lot! I guess me overseeing that the the X/Y coordinates was calculated as dots instead of tiles was the the problem! It now works great and the fact that you can refer to individual pixels instead of tiles makes this plugin even more flexible! Really super cool!

    Also thanks for pointing out the tint command. I literally started using this yesterday so there is a lot of stuff I've missed probably. Reason I choose a big light source in the middle of this map however was because I wanted to gradually fade a wall up north in darkness. :)

    I am going to use this in all my projects moving forward and I'm looking forward to the performance fixes in the future! :D :thumbsup-right:
  16. Terrax said:
    Plugin call : Tint set #333333


    For more opacity, increase the color value upwards.


    Plugin call : Tint set #000000  : total darkness


    Plugin call : Tint set #222222  : very dark


    Plugin call : Tint set #444444  : dark


    Plugin call : Tint set #666666  : early dawn


    Improved flashlight and square beams for windows are next on the development list, after frame-rate improvements.


    I've been doing some testing on framerates and there are some improvements that 'm going to work on


    Currently the plugin works like this


    - Each frame update, all the events are scanned if they contain lights. if they do a lightsource is made. If you have a lot of events this scanning can take a lot of time.


    --> improvement : Scan all events on map-load and save them. In subsequent scans, only update the mapsources that have lights.


    --> expected problem : A way to handle spawned events that have lightsources, since they do not exist on mapload. Plugin call  to counter this effect.


    - Each frame update, the complete map is scanned for region and tag lights -> more then 3 tag/region lights takes 3 scan and kill framerates in a dramatic way.


    --> improvement : Build a stack on map-load and in subsequent scans work from the stack instead of continues slow mapscans.


    This is what i'm going to focus on first, before new features.


    I've updated the plugin on Github, it includes a speed-test function you can call. If displays the average time in ms that plugin takes


    each cycle to update the screen.


    You can use : Plugin command : 'script speedtest on' to display the timer.


    The timer will appear after 500 cycles have past, and give the average time it took to complete a cycle messured over 500 cycles.)


    It will give you a clue to what is causing the most delay in your game. Give it a test and ill get started on what causes most delays.

    Just to confirm before I proceed with this little update, although I do use Galv's spawn event plugin- no events spawned whatsoever contain light sources as I use graphical tricks to simulate as if they were spawning (Cars)
  17. I want to know, if we want some option that was unlikly to be included in the script before a lot of time,


    did you accept paid job for add it?
  18. XGuarden said:
    I want to know, if we want some option that was unlikly to be included in the script before a lot of time,


    did you accept paid job for add it?



    No, i don't do paid jobs, i do this just for fun :)


    But if you have brilliant idea's, i just might get excited and build them very fast.
  19. Skurge said:
    Just to confirm before I proceed with this little update, although I do use Galv's spawn event plugin- no events spawned whatsoever contain light sources as I use graphical tricks to simulate as if they were spawning (Cars)

    I've been doing timing in the script to see whats parts of the code are causing the most processor time. I've localized the main drain points and i'm happy to report those can be avoided by rewriting some parts. Going to start on it right away.
  20. I guess I have to bother with another question, this time about the event flashlight. I'm trying to use it as a light source from a dim spotlight but it seems you can't change the brightness on the flashlight the same way I can with other light sources, true? For all my other light sources I just picked a color value that was close to the map tint, just a little brighter and the effect was achieved. The flashlight only seems to decide what color it's supposed to be and then make a super bright beam out of it. If that's the way it works I guess it can't be helped. Just want to know if I missed something.

    Since the spotlight is static I'm using the note tag (Flashlight 8 12 #6f1d1d 1 3).