MZ - [MZ & MV v1.9.7] Shora Lighting & Shadow System

● ARCHIVED · READ-ONLY
Started by Shora 656 posts Page 8 of 33 View original ↗
  1. Did you ever get my project, Shora?
  2. Dark_Ansem said:
    Did you ever get my project, Shora?
    Did you send them to my mail? Gonna check it!
  3. Version 1.6 are released! A pretty big update including quality, performance, and flexibility! Try it out on itch :kaoluv: .
    Change-logs:
    - Now you can draw static lighting using plugin command/ script, by provide it light type and positions. Currently you can't modify, or even change it status, but in exchange it allow you to draw hundreds, or even thousands of static lighting on the map! Note: MV Version blending mode is NORMAL instead of ADD for technical reason (PIXIJS), and I'm gonna patch it in the future if needed.
    - Added soft shadow customisation. Allow you to customize soft shadow status/strength/quality. The prefer strength/quality params is 2/1; 1/1; 1/2. All old previous version used 1/2.
    - Added customizable color matrix filter to map, which allow you to higher the lights intensity and make lighting blend nicely into map. Currently only 'brightness' is visible in the plugin params, but you can use $shoraLayer.colorFilter to use all the other methods (see http://filters.pixijs.download/dev/demo/index.html)
    - Change lighting registering phase. Now the new lighting type will be registered not only when you create a new game, but when the game boot up (Thanks to @Enigma_Productions ).
    - Fix a pretty serious memory leak when update from v1.4 to v1.5. Now it should work fine (test this by repeatingly switch between complex map).
    - Fix some others minor bugs.
    - Change all both demo's plugin command to use script call instead, for synchronizing easier. You can still use each's plugin commands normally.

    Gallery:
    Soft shadow and color filters.
    unknown.png
    Anyone want their lights to be completely symmetrical? Just set its shadow offset y to -18!
    1643284093174.png
    Adding 100 static lights at once randomly using script... 1000 just made the map fully bright lul.
    1643284135610.png
  4. Wow love it!
  5. A short tutorial and Q&A for Update1.6

    A while back I made a short tutorial for Shora Lighting but since then a few updates have come out and I feel the tutorial should be updated. Again I'll use spoiler tags for each subject so it's easier for people to find what they're looking for. And it makes it easier for people to scroll by.

    Acquiring the Custom Light Parameters & Folder
    To elaborate. The Shora Lighting Demo comes with it's very own set of light images along with custom parameters. If you don't have any premade lights and would like the default ones to start off with please follow these sets of instructions.
    Plugin Settings.png
    Download the latest -ShoraLighting-.js plugin along with the demo that matches your engine.
    if you have the MV Engine download the MV demo
    if you have the MZ Engine download the MZ demo

    Once downloaded, place the js file in the proper folder in your game. [for those who don't know that would be the js/plugins folder]
    Now open your game project using either MV or MZ
    Afterwards extract the Lighting Demo and also open the game project file.

    Copy.png
    Paste.png
    From YOUR game project open the plugin manager and add ShoraLighting to the list however do not close the plugin manager yet because we are not done configuring the parameters on the ShoraLighting plugin.
    From the DEMO game project open the plugin manager and double click the ShoraLighting plugin to bring up the parameters page.

    You're going to want to copy the Lights: Custom parameter from the Demo Plugin Settings to your Game Plugin Settings. If you view the image beneath you'll see the Demo is on the left and your project would be on the right. Forgive me if that sounded confusing. Hopefully the image above clears up any confusion:kaocry:

    Once done. Click OK and Apply

    Transfer Lights folder.png
    For the next step what we're going to want to do is similar to what we did above. From your game project folders navigate to your img folder. Do the same for the Demo project folder.
    Now simply copy the lights folder from the demo to your project folder.
    See below image to better understand. Ignore the black bars I just wanted to cover my username :kaoswt2:

    You should now have the Shora Lighting's Custom Lights!

    Is it possible to make the Picture layer excluded from being shadowed?
    The answer is yes. However in the newest Shora update [1.6] you must change a few lines of code in the js file.
    I'll do my best to make it easy to follow this step by step.

    Open the Shoralighting.js file with whatever 3rd party application you prefer [you may even use Notepad], and click Ctrl and F at the same time.
    Search box.png
    This should bring up a find search engine. In the find what box type createUpperLayer and hit next. This should bring you to a line of code that reads out like this
    Screenshot_2022-01-11-32_340x113.png
    From here simply change all "createUpperLayer" to "createLowerLayer" in this area of code.
    *Please make sure the L is capital as js takes that level of precision very seriously.
    Now you should have something like this by the end of it.
    CreateLower.png
    As you can see all I did was simply change createUpperLayer to createLowerLayer within those three lines of text.
    Now from the Find What box [type] or [copy and paste] in to the box
    if (this._spriteset.filters[1])
    ifspriteset.png
    Now hit search.
    You should be taken to your next line of code that we must change.
    From this line of code merely replace the selected code with this line of code
    if (this._spriteset.filters && this._spriteset.filters[1])
    [This line of code was given to me by Shora and will soon itself be implemented in a future update.]
    Now again save your js file and run your game.
    If you have an image that was originally darkened it should now not be unaffected.

    How do I get top wall corner lights?
    This feature has not yet been made available in the plugin however there is a round-a-bout solution to this.
    If you wish to get a top corner block you must place the lowest Region ID that you have on the corner you wish to have a shadow. In my case it's 1. If you have not changed this parameter then it should also be 1. To better understand and see what I mean I will present a few images to show you.

    As can be seen from the image, the top of the wall [on the bottom right of the image] is now emitting it's own shadow. The only draw back is that the light can sometimes bleed through the wall. If you use big lights this problem will be instantly noticeable. To solve that problem simply add an extra layer of wall. If you use small lights then no bleeding should occur.

    Understanding the parameters in the Shora Lighting Plugin
    When you open up the plugin page You'll notice 4 settings
    [Game Settings] [Map Default] [Lights: Default] [Lights: Custom]
    Like in my previous post I'll only talk about the first two as I am too tired to continue this tutorial however perhaps in the future I will elaborate more on the others.

    [Game Settings]
    The parameters are pretty easy to understand. You set the range of your preferred Region ID numbers and if you have the latest version of Shora Lighting you can also place roof Region ID's or Ignore Shadow Region ID's.

    [Map Default]
    Default Ambient
    is as the name suggests the default Ambient shade the plugin will show as you start the game. It uses hex numbers so if you don't know any hex numbers by heart simply go to this website https://www.color-hex.com/ and use their cursor controlled color chart. Any color you would want is broken down in hex numbers so you can apply it to your game. If you want your game to start off with no shading I recommend changing this parameter to #ffffff

    Default Shadow Ambient This allows you to adjust the shadow itself. For example if you feel like a shadow in a certain map should be darker than usual [Let's say you wish to hide a monster in a corner] Then this setting will adjust that. Or if You wish the shadows wouldnt be so dramatically dark then you can also brighten them. Its an incredibly hand feature that can benefit the game creator quite a bit.
    Default Top Block Ambient If you understand Default shadow ambient then this should also make sense to you. This parameter allows you to adjust the level of intensity of the shadow on the top of your wall. Again very useful for many creative ideas.

  6. RedRaydr said:
    My problem has been resolved, thanks for the help Enigma!
    I'm actually having the exact same issue, what was the solution?
  7. retrofiction said:
    I'm actually having the exact same issue, what was the solution?
    Which Engine version are you using?
  8. Enigma_Productions said:
    Which Engine version are you using?
    Actually, never mind - I'm using MV and I totally overlooked that you have to configure in the plugin which RM version you're using. Works now!
  9. Hi, I'm pretty new to RMMZ so I'm sure this is a simple error that is easily fixed, but I've gone through everything I can think of and can't figure it out. When I try to add a test light into my game project I get this when I test-play:

    Screen Shot 2022-02-05 at 12.50.48 pm.png

    Apologies if this has been covered, and as I mentioned I'm pretty new to RMMZ so apologies if its something obvious. Any help would be appreciated!
  10. ZenMarx said:
    Hi, I'm pretty new to RMMZ so I'm sure this is a simple error that is easily fixed, but I've gone through everything I can think of and can't figure it out. When I try to add a test light into my game project I get this when I test-play:

    View attachment 215229

    Apologies if this has been covered, and as I mentioned I'm pretty new to RMMZ so apologies if its something obvious. Any help would be appreciated!
    It is a weird bugs... Properly because of plugins incompatibility. Can you provide the image of console log (press f12 when the bugs occur), and list of using plugins? I will try to guess what cause the error.
  11. Shora said:
    It is a weird bugs... Properly because of plugins incompatibility. Can you provide the image of console log (press f12 when the bugs occur), and list of using plugins? I will try to guess what cause the error.
    Thanks! Here's the console log and the only plugin is the lighting one.Screen Shot 2022-02-05 at 10.25.41 pm.pngScreen Shot 2022-02-05 at 10.26.08 pm.png
  12. ZenMarx said:
    Thanks! Here's the console log and the only plugin is the lighting one.View attachment 215287View attachment 215288
    That really weird... I just created a new empty project and it still worked fine. Did you try follow the instructions from the wiki? For some reason, when your light created, the "$gameLighting" haven't created (which it should when a new game is created for loaded). If the instructions still not work, please DM/PMs me though forums/Discord, I will try to help resolving the problem.
  13. @Shora I think he/she is using MZ at the looks of his/her database with
    the checks and MV is it visible if its ON/OFF, as it might not work in MZ
    if you read the bottom of it :)

    unless mac have the same view with checks? but I doubt that though.
  14. I like this plugin. :)
  15. Hi @Shora,
    i have the same issue as @ZenMarx, but it only occurs when i load a save where the plugin was previously inactive. If I restart the game, then everything works.

    It is now possible to turn the lightning system on/off?
  16. @Nicke Nice mapping with the lightning system =)
  17. Nicke said:
    I like this plugin. :)
    Thanks! More dynamic features and optimization are coming next update, hope you will like it!
    Ariyana said:
    Hi @Shora,
    i have the same issue as @ZenMarx, but it only occurs when i load a save where the plugin was previously inactive. If I restart the game, then everything works.

    It is now possible to turn the lightning system on/off?
    Thanks for that information! Now I know why the bug occur: It tried to load $gameLighting from a save that don't have that, because the plugin was off when the save was created. @ZenMarx Is this the same as your? If this is it then I can fix this the next update.
    Yes, the dynamic state of lighting (even shadow too) is coming in the next update :). Then you can implement it into your settings or something like that.
  18. Great! A quick question about light position.

    Is it possible to have the same light effect on different events with different x/y position? I know there is a offset command but that change the whole light so all events uses the same x and y position.

    Would be great if there was a command for like forcing different x and y position for the light effect when you create it. Like a comment.

    Maybe like so:
    [light ambient_orange]
    [light_offsetX -48]
    [light_offsetY 48]

    Then the light ambient_orange would use a different x and y position for that event only.
  19. Shora said:
    Yes, the dynamic state of lighting (even shadow too) is coming in the next update :). Then you can implement it into your settings or something like that.
    :thumbsup-right:
  20. Nicke said:
    Great! A quick question about light position.

    Is it possible to have the same light effect on different events with different x/y position? I know there is a offset command but that change the whole light so all events uses the same x and y position.

    Would be great if there was a command for like forcing different x and y position for the light effect when you create it. Like a comment.

    Maybe like so:
    [light ambient_orange]
    [light_offsetX -48]
    [light_offsetY 48]

    Then the light ambient_orange would use a different x and y position for that event only.
    Yes, it WAS possible. Long ago, to override default settings the comment were something like this:
    Code:
    [light ambient_orange]
    [offsetx 48]
    [offsety -48]
    [radius 1.5]
    [angle 120]
    .. etc.
    Unfortunately, I removed those since the 1.0 release (because scale and rotation mess up performance that time).
    But since I figured out how to optimize those, the next update will have scale and rotation parameters, plus new comment syntax. It will be something like this:
    Code:
    [ambient_orange -radius 1.5 -angle 120 -offsetx 48 -offsety -48]
    and can be shortened to:
    Code:
    [ambient_orange -r 1.5 -a 120 -x 48 -y -48]
    That what I planning to do (and doing). Do you have any suggestions?