OcRam - Lights plugin (MZ/MV)

● ARCHIVED · READ-ONLY
Started by OcRam 300 posts Page 6 of 15 View original ↗
  1. Thank you for the message @DesVerides ,

    I think that's "Elements" tab - I need information on "Console" tab :)

    Also I have released new version, below more information.

    Latest version - v2.06 (released 2020/05/21)
    • New plugin command light_player_ex and same for followers
      Now you may change player and follower light-ex parameters via plugin commands!

    • New light-ex param: startAt (starts light gradient at %)
      I always thought that flashlight shouldn't have so pointy start. Now you may adjust cones' gradient relative start position from light source epicenter.

    • New plugin param: "Flashlight up fix value"
      Now that you may tamper with light cone startAt parameter. It's natural to have flashlight Y fix value as parameter. Find best value for your settings.

    • New JS calls for player, follower and event objects to get all objects in current light radius
      How cool this can be?! Quest: Find something in dark room only with your flashlight! -or- Escape dark dungeon without any guard can see you! Etc...

    • Game events will have additional isPlayerInLightRadius() -function
      Same as above, but algorithm is more efficient and it will return true/false instead of object array.

    • Credits to @rohzek and @PresaDePrata for ideas for this patch!

      Screen shot
      NOTE: This is just an example and there are tons of different methods to do this differently.

      Use JS conditional check to check in parallel event page if player is in radius. event_page_light_radius_check.jpg

      When player is not in event light radius.
      light_radius_check_not_in_sight.jpg
      When player is in event light radius.
      light_radius_check_in_sight.jpg
  2. OcRam said:
    Thank you for the message @DesVerides ,

    I think that's "Elements" tab - I need information on "Console" tab :)

    You are definitely right, my mistake! Here is the actual console tab:
    Console
    Code:
    rpg_managers.js:1949 TypeError: Cannot read property 'r' of null
        at Light_Data.update (js/plugins/OcRam_Lights.js:1121)
        at js/plugins/OcRam_Lights.js:1266
        at Array.forEach (<anonymous>)
        at OcRam_Light_Layer.updateMapLights (js/plugins/OcRam_Lights.js:1264)
        at Spriteset_Map.<anonymous> (js/plugins/OcRam_Lights.js:974)
        at Spriteset_Map.c.(anonymous function) [as update] (chrome-extension://odlameecjipmbmbejkplpemijjgpljce/js/plugins/OcRam_Lights.js:28:135)
        at rpg_scenes.js:262
        at Array.forEach (<anonymous>)
        at Scene_Map.Scene_Base.updateChildren (rpg_scenes.js:260)
        at Scene_Map.Scene_Base.update (rpg_scenes.js:113)
  3. DesVerides said:
    You are definitely right, my mistake! Here is the actual console tab:
    Console
    Code:
    rpg_managers.js:1949 TypeError: Cannot read property 'r' of null
        at Light_Data.update (js/plugins/OcRam_Lights.js:1121)
        at js/plugins/OcRam_Lights.js:1266
        at Array.forEach (<anonymous>)
        at OcRam_Light_Layer.updateMapLights (js/plugins/OcRam_Lights.js:1264)
        at Spriteset_Map.<anonymous> (js/plugins/OcRam_Lights.js:974)
        at Spriteset_Map.c.(anonymous function) [as update] (chrome-extension://odlameecjipmbmbejkplpemijjgpljce/js/plugins/OcRam_Lights.js:28:135)
        at rpg_scenes.js:262
        at Array.forEach (<anonymous>)
        at Scene_Map.Scene_Base.updateChildren (rpg_scenes.js:260)
        at Scene_Map.Scene_Base.update (rpg_scenes.js:113)
    Thank you for the report,

    Line numbers seems very odd... what version of Lights -plugin are we talking about?

    But it is most certainly related to light source color parameter (it is missing or in invalid format).
  4. Curious to try this plugin, but before I do so since my project is currently using Kha's various light plugins but I am having difficulty with events lighting, specifically torches and cycling through different colours.

    I'm after assigning large sprite events like cars with lights and the ability to have said events turn them off by plugin commands or script calls, police lights are also something I would like to tamper with having them cycle through 3 colours but given the current circumstances I can't do it with common events and having multiple pages removes functionality on other things like follow commands and such.
  5. Thank you for the message,
    I will implement light source color cycles to next version.

    light_cycles eventId fade_time [color1,color2,etc...]

    If fade time is negative number fade will be curved otherwise it will be linear.

    eventId:
    -1 = player, -2 to -4 followers, positive numbers are corresponding eventId.

    Also all objects will have setLightCycle(fade, colors) method.
  6. I hope for a demo for it, so I can learn from it. While Khas is nice, and region light, this one have more potentional
    on the other hand khas doesn't have.

    It might be a more complex to use, but it will be worth it ^^
  7. ShadowDragon said:
    I hope for a demo for it, so I can learn from it. While Khas is nice, and region light, this one have more potentional
    on the other hand khas doesn't have.

    It might be a more complex to use, but it will be worth it ^^
    This is by far the best light plugin I’ve seen. It can be a bit of work to get fancy effects, but for me, making the simple things like a campfire or light post or torch easy to implement scores high in my book. This with Ocram’s other plugins and the game immersion factor is off the scale.
  8. I saw a plugin (very early alpha dev) with nice torch particals, magic particals etc,
    can be neat if that is or become available, it can even fire the player :p

    found here (2:24 for torch), (8:30 for player on fire), but that pixi effect in this light plugin,
    would be way to hard, while i require pixi, and probably pixi edit while I got the demo to play with.
    but it can add some neat light to the torch once that plugin is stable.

    the only thing this plugin is basicly missing is the shadow that khas has, but it might be added
    in the near future or never :D. he does already a nice job creating this, and fix issues within a week
    when possible or a compability issue.
  9. OcRam said:
    Thank you for the message @DesVerides ,

    I think that's "Elements" tab - I need information on "Console" tab :)

    Also I have released new version, below more information.

    Latest version - v2.06 (released 2020/05/21)
    • New plugin command light_player_ex and same for followers
      Now you may change player and follower light-ex parameters via plugin commands!

    • New light-ex param: startAt (starts light gradient at %)
      I always thought that flashlight shouldn't have so pointy start. Now you may adjust cones' gradient relative start position from light source epicenter.

    • New plugin param: "Flashlight up fix value"
      Now that you may tamper with light cone startAt parameter. It's natural to have flashlight Y fix value as parameter. Find best value for your settings.

    • New JS calls for player, follower and event objects to get all objects in current light radius
      How cool this can be?! Quest: Find something in dark room only with your flashlight! -or- Escape dark dungeon without any guard can see you! Etc...

    • Game events will have additional isPlayerInLightRadius() -function
      Same as above, but algorithm is more efficient and it will return true/false instead of object array.

    • Credits to @rohzek and @PresaDePrata for ideas for this patch!

      Screen shot
      NOTE: This is just an example and there are tons of different methods to do this differently.

      Use JS conditional check to check in parallel event page if player is in radius.event_page_light_radius_check.jpg

      When player is not in event light radius.
      light_radius_check_not_in_sight.jpg
      When player is in event light radius.
      light_radius_check_in_sight.jpg

    Amazing work, OcRam! Thanks for inserting my suggestions.
  10. I might be completely stupid when it comes to setting up advance lights lol. I want to know if there is a way to make a light source (street lamp for example) where it doesn’t have a full 360 degree radius but gives the illusion of illuminating like a normal street lamp (beneath with arc).

    another thing I thought about would be if there was a way to stop the light of it hits a wall but still look natural.

    thanks much!
  11. dragonx777 said:
    I might be completely stupid when it comes to setting up advance lights lol. I want to know if there is a way to make a light source (street lamp for example) where it doesn’t have a full 360 degree radius but gives the illusion of illuminating like a normal street lamp (beneath with arc).

    another thing I thought about would be if there was a way to stop the light of it hits a wall but still look natural.

    thanks much!
    Hi,

    There are many ways to set/edit light sources.

    But if you want to set degrees and angles (or even rotation) then light-ex params are needed (comments or via plugin commands).

    Comment syntax is:
    *Comment* <light:[type:0-9]:[radius:1-1000]:[color:#rrggbbaa]>
    *Comment* <light-ex:x,y:degrees:angle:rotation:startAt>

    Easiest way to do this >> set comments to ACTIVE event page (this is just an example):
    * Comment * <light:3:300:#ffeeaa88>
    * Comment * <light-ex:0,0:60:-90:0:0.1>

    lights-ex.jpg

    EDIT: Oh and shadows are WIP (no schedule atm - but I wouldn't expect it to be ready in near future)
  12. OcRam said:
    Hi,

    There are many ways to set/edit light sources.

    But if you want to set degrees and angles (or even rotation) then light-ex params are needed (comments or via plugin commands).

    Comment syntax is:
    *Comment* <light:[type:0-9]:[radius:1-1000]:[color:#rrggbbaa]>
    *Comment* <light-ex:x,y:degrees:angle:rotation:startAt>

    Easiest way to do this >> set comments to ACTIVE event page (this is just an example):
    * Comment * <light:3:300:#ffeeaa88>
    * Comment * <light-ex:0,0:60:-90:0:0.1>

    View attachment 145471

    EDIT: Oh and shadows are WIP (no schedule atm - but I wouldn't expect it to be ready in near future)

    cool. This works well. And I know that shadows can be a pain to implement. Thanks for all the hard work.
  13. Latest version - v2.07 (released 2020/05/30)
    • Fixed Bug: Clears light data when exited to menu

    • Fixed bug where "Test event" crashed game
      Requires OcRam_Core v1.5 (Credits to @jjraymonds )

    • Added color cycles to all light sources!
      Use new syntax and replace color param with it. (Credits to @Skurge )

    • Multiple lights per event (Credits to @EthanFox )
      NOTE: Officially available only via EVENT comments!
      (or advanced JS - need to know basics at least)


      Create some crazy looking stuff with kill switch on it!

      multiple_lights.jpg

      On page 2:
      Trigger: Action Button
      Condition: "Self Switch D"
      * Comment * <light:0>
      Control Selft Switch : D = OFF

    EDIT: Noticed that old save files won't load in v2.07 because of multiple lights update. Released backward compatible update v2.08 where this issue is fixed.

    Latest version - v2.08 (released 2020/05/31)

    • Backward compatible with save files that have been created before v2.07 (before multiple lights update)
  14. would you be able to make a master package with all plugins (updated) to latest version.
    so you wont need to search for each plugin?

    otherwise, amazing job as always. (still hoping on a demo to playtest it with your plugins how
    everything works ^^
  15. Just curious since I'm using yanfly's light plugins as a general environment light source, how you would position this plugin to avoid conflicts with others? I really want to use the plugin and follow up with some examples of how they look in game :)
  16. Skurge said:
    Just curious since I'm using yanfly's light plugins as a general environment light source, how you would position this plugin to avoid conflicts with others? I really want to use the plugin and follow up with some examples of how they look in game :)
    Hi, can you link the plugin can't seem to find it?
  17. Hello ! I was wondering, is there a way to add your own custom lights ? For example, doing your light in a png file with the shape and color you want. This could resolve belatucadrus 's problem i believe.


    Anyways , good work on this plugin !
  18. 2biim2 said:
    Hello ! I was wondering, is there a way to add your own custom lights ? For example, doing your light in a png file with the shape and color you want. This could resolve belatucadrus 's problem i believe.


    Anyways , good work on this plugin !
    Thank you for the message,

    Adding pictures is way more resource intensive than gradients this plugin uses. I would have to re-write whole plugin again and use only WebGL.

    This plugin uses canvas and PIXI.Container which is more backward compatible. Downside here is performance, which I have managed to overcome with some serious optimization.

    For example in maps where I have not spared lights (hundreds of light sources on same screen) I still got steady 144 FPS.
  19. Hey, quick question. Is there an algorithm that can be used to figure out what the values set by a tint screen command would be using your plugin?

    Likewise, for those of you that have been working with the plugin for a while now, would you be willing to share some light codes that you have found to work well, for things such as caves, night time, and touches?

    EDIT: One other question, is there any steps I have to take add light in a battle on a darkened map? Without editing the Battle Tint configuration, the whole screen is tinted the map's tint in battle.