OcRam - Lights plugin

EthanFox

Veteran
Veteran
Joined
Oct 15, 2018
Messages
394
Reaction score
310
First Language
English
Primarily Uses
RMMV
Hi there, thought I'd ask as I'm about to head to sleep but was struggling with this; I managed to get the plugin installed and used an auto-run event on a map to set the BG colour to a 50% grey. After doing this, I was able to enter my map and everything is darker, so I know the plugin is installed and working.

However, none of the lights I've configured display (I've just copied several examples from the tutorial/instructions).

Is there a common mistake which tends to cause this? The lights are specified as comments on events as per the instructions.
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
525
Reaction score
612
First Language
Finnish
Primarily Uses
RMMV
Hi there, thought I'd ask as I'm about to head to sleep but was struggling with this; I managed to get the plugin installed and used an auto-run event on a map to set the BG colour to a 50% grey. After doing this, I was able to enter my map and everything is darker, so I know the plugin is installed and working.

However, none of the lights I've configured display (I've just copied several examples from the tutorial/instructions).

Is there a common mistake which tends to cause this? The lights are specified as comments on events as per the instructions.
Thank you for the message,

Is autorun event erased? Light comments are PAGE specific, are they on correct page?
 

EthanFox

Veteran
Veteran
Joined
Oct 15, 2018
Messages
394
Reaction score
310
First Language
English
Primarily Uses
RMMV
Thank you for the message,

Is autorun event erased? Light comments are PAGE specific, are they on correct page?
Thanks for getting back to me.

So to explain, I have two events.

The first event has two pages. The first page is an auto-run, which at the end of the page, activates self-switch B. The second page is an "Action Button" page which has self-switch B as its condition. This event is used to initialise a bunch of stuff that happens on this map, and on the first page I have a plugin command, "light_bg #50505050 0".

The second event has one page only, an "Action Button" page. This page has a comment reading "<light-ex:0,-96:60:45:1>" (I've also tried a bunch of other ones from the instruction examples).

The end result of this is that the map is darker than usual (suggesting the first event and plugin command work) but the light doesn't appear (suggesting what I'm doing in the second event doesn't work).
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
525
Reaction score
612
First Language
Finnish
Primarily Uses
RMMV
Thanks for getting back to me.

So to explain, I have two events.

The first event has two pages. The first page is an auto-run, which at the end of the page, activates self-switch B. The second page is an "Action Button" page which has self-switch B as its condition. This event is used to initialise a bunch of stuff that happens on this map, and on the first page I have a plugin command, "light_bg #50505050 0".

The second event has one page only, an "Action Button" page. This page has a comment reading "<light-ex:0,-96:60:45:1>" (I've also tried a bunch of other ones from the instruction examples).

The end result of this is that the map is darker than usual (suggesting the first event and plugin command work) but the light doesn't appear (suggesting what I'm doing in the second event doesn't work).
Ok. <light-ex> tag can only be used after <light> notation (see first page of this thread).

For example simple red light with 300px radius would be <light:1:300:#ff0000> then If you want to Set offset, degrees, angle or rotation to that simple light source use <light-ex> notation
 

EthanFox

Veteran
Veteran
Joined
Oct 15, 2018
Messages
394
Reaction score
310
First Language
English
Primarily Uses
RMMV
Ok. <light-ex> tag can only be used after <light> notation (see first page of this thread).

For example simple red light with 300px radius would be <light:1:300:#ff0000> then If you want to Set offset, degrees, angle or rotation to that simple light source use <light-ex> notation
Sorry, afraid that didn't fix it, but thanks for trying to help.

Going to pull the plugin out for now; it might be caused by my plugin stack or a bunch of other things, but I have other areas of development to focus on for now (this part of the game isn't dependent on light as a feature, just polish) - but I'll get back to this in a few weeks.
 

TenTranVN

Veteran
Veteran
Joined
Apr 13, 2017
Messages
165
Reaction score
17
First Language
Vietnam
Primarily Uses
RMMV
It doesn't work on my project, can you show me the demo?
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
525
Reaction score
612
First Language
Finnish
Primarily Uses
RMMV
It doesn't work on my project, can you show me the demo?
All I got is YouTube video(s) and this thread. I'm working on demo but don't yet know when it will be released.

You must use "light_bg" command to set background color where light sources are added. Or is there any error messages?
 

xizorandy

Veteran
Veteran
Joined
Jan 31, 2015
Messages
53
Reaction score
15
First Language
English
Primarily Uses
Hi OcRam,

Was trying out the lights, I really like it so far, but I got an error: "Cannot read property 'offset' of undefined"

It seems to be when using light_event or light_event_name plugin commands.

So I made a new project added only OcRam_Lights v2.01

Then setup some events to test:

Event 1:
Plugin Command: light_bg #303040ff 0
Plugin Command: light_player 1 1 #ffffffff
Result: Worked perfectly

Event 2:
Comment: <light:5:240:#ffdd00ff:360>
Comment: <light-ex:0,-48:240:45:1>
Result: Worked perfectly

Event 3:
Plugin Command: light_event 6 2 400 #ff80000ff
Result: "Cannot read property 'offset' of undefined"

Event 3:
Plugin Command: light_event_name EV006 2 400 #ff80000ff
Result: "Cannot read property 'offset' of undefined"


Can you tell me what I've got wrong? is the console log useful for you?:

OcRam_Lights.js:1105 OcRam_Lights : OcRam_Light_Layer.prototype.initialize OcRam_Light_Layeralpha: 1buttonMode: (...)children: [Sprite]filterArea: nullparent: Spriteset_Map {_events: Events, _eventsCount: 0, tempDisplayObjectParent: null, transform: TransformStatic, alpha: 1, …}renderable: truetempDisplayObjectParent: nulltrackedPointers: (...)transform: TransformStatic {worldTransform: Matrix, localTransform: Matrix, _worldID: 1, _parentID: 1, position: ObservablePoint, …}visible: trueworldAlpha: 1_bg: Bitmap {__canvas: canvas, __context: CanvasRenderingContext2D, _dirty: false, _image: null, _url: "", …}_bounds: Bounds {minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity, rect: null}_boundsID: 401_boundsRect: null_destroyed: false_dx: -1.3333333333333333_dy: -1.3333333333333333_enabledFilters: null_events: Events {}_eventsCount: 0_filters: null_height: 752_lastBoundsID: -1_localBoundsRect: null_mask: null_sprites: [Sprite]0: Sprite {_events: Events, _eventsCount: 0, tempDisplayObjectParent: null, transform: TransformStatic, alpha: 1, …}length: 1__proto__: Array(0)_twh: (2) [48, 48]_width: 944cacheAsBitmap: (...)filters: (...)height: (...)localTransform: (...)mask: (...)pivot: (...)position: (...)rotation: (...)scale: (...)skew: (...)width: (...)worldTransform: (...)worldVisible: (...)x: (...)y: (...)_tempDisplayObjectParent: (...)__proto__: Container
OcRam_Lights.js:1105 OcRam_Lights : light_bg Array(2)0: "#303040ff"1: "0"length: 2__proto__: Array(0)
OcRam_Lights.js:1105 OcRam_Lights : Tint started! #303040ff, 0
OcRam_Lights.js:1105 OcRam_Lights : Tint done! Objecta: "1.00"b: 64g: 48r: 48__proto__: Object
OcRam_Lights.js:1105 OcRam_Lights : light_player Array(3)0: "1"1: "1"2: "#ffffffff"length: 3__proto__: Array(0)
OcRam_Lights.js:1105 OcRam_Lights : light_event Array(4)0: "6"1: "2"2: "400"3: "#ff80000ff"length: 4__proto__: Array(0)
rpg_managers.js:1949 TypeError: Cannot read property 'offset' of undefined
at exParamCopy (OcRam_Lights.js:1296)
at Light_Data.initialize (OcRam_Lights.js:725)
at new Light_Data (OcRam_Lights.js:717)
at Game_Interpreter.pluginCommand (OcRam_Lights.js:404)
at Game_Interpreter.command356 (rpg_objects.js:10508)
at Game_Interpreter.executeCommand (rpg_objects.js:8930)
at Game_Interpreter.update (rpg_objects.js:8838)
at Game_Map.updateInterpreter (rpg_objects.js:6115)
at Game_Map.update (rpg_objects.js:6022)
at Scene_Map.updateMain (rpg_scenes.js:608)
SceneManager.catchException @ rpg_managers.js:1949


Cheers
 

Gabezin

Villager
Member
Joined
Sep 27, 2016
Messages
26
Reaction score
4
First Language
Spanish
Primarily Uses
Hello, is there any way to fix a light on some element of parallax background? For example, I want to put a moon in a parallax, and let it shine... but so that when that light passes behind the tiles (mountains, for example), the light is omitted. Is this something possible to do, or could it be possible in a future update?
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
525
Reaction score
612
First Language
Finnish
Primarily Uses
RMMV
Hi OcRam,

Was trying out the lights, I really like it so far, but I got an error: "Cannot read property 'offset' of undefined"

It seems to be when using light_event or light_event_name plugin commands.

So I made a new project added only OcRam_Lights v2.01

Then setup some events to test:

Event 1:
Plugin Command: light_bg #303040ff 0
Plugin Command: light_player 1 1 #ffffffff
Result: Worked perfectly

Event 2:
Comment: <light:5:240:#ffdd00ff:360>
Comment: <light-ex:0,-48:240:45:1>
Result: Worked perfectly

Event 3:
Plugin Command: light_event 6 2 400 #ff80000ff
Result: "Cannot read property 'offset' of undefined"

Event 3:
Plugin Command: light_event_name EV006 2 400 #ff80000ff
Result: "Cannot read property 'offset' of undefined"


Can you tell me what I've got wrong? is the console log useful for you?:

OcRam_Lights.js:1105 OcRam_Lights : OcRam_Light_Layer.prototype.initialize OcRam_Light_Layeralpha: 1buttonMode: (...)children: [Sprite]filterArea: nullparent: Spriteset_Map {_events: Events, _eventsCount: 0, tempDisplayObjectParent: null, transform: TransformStatic, alpha: 1, …}renderable: truetempDisplayObjectParent: nulltrackedPointers: (...)transform: TransformStatic {worldTransform: Matrix, localTransform: Matrix, _worldID: 1, _parentID: 1, position: ObservablePoint, …}visible: trueworldAlpha: 1_bg: Bitmap {__canvas: canvas, __context: CanvasRenderingContext2D, _dirty: false, _image: null, _url: "", …}_bounds: Bounds {minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity, rect: null}_boundsID: 401_boundsRect: null_destroyed: false_dx: -1.3333333333333333_dy: -1.3333333333333333_enabledFilters: null_events: Events {}_eventsCount: 0_filters: null_height: 752_lastBoundsID: -1_localBoundsRect: null_mask: null_sprites: [Sprite]0: Sprite {_events: Events, _eventsCount: 0, tempDisplayObjectParent: null, transform: TransformStatic, alpha: 1, …}length: 1__proto__: Array(0)_twh: (2) [48, 48]_width: 944cacheAsBitmap: (...)filters: (...)height: (...)localTransform: (...)mask: (...)pivot: (...)position: (...)rotation: (...)scale: (...)skew: (...)width: (...)worldTransform: (...)worldVisible: (...)x: (...)y: (...)_tempDisplayObjectParent: (...)__proto__: Container
OcRam_Lights.js:1105 OcRam_Lights : light_bg Array(2)0: "#303040ff"1: "0"length: 2__proto__: Array(0)
OcRam_Lights.js:1105 OcRam_Lights : Tint started! #303040ff, 0
OcRam_Lights.js:1105 OcRam_Lights : Tint done! Objecta: "1.00"b: 64g: 48r: 48__proto__: Object
OcRam_Lights.js:1105 OcRam_Lights : light_player Array(3)0: "1"1: "1"2: "#ffffffff"length: 3__proto__: Array(0)
OcRam_Lights.js:1105 OcRam_Lights : light_event Array(4)0: "6"1: "2"2: "400"3: "#ff80000ff"length: 4__proto__: Array(0)
rpg_managers.js:1949 TypeError: Cannot read property 'offset' of undefined
at exParamCopy (OcRam_Lights.js:1296)
at Light_Data.initialize (OcRam_Lights.js:725)
at new Light_Data (OcRam_Lights.js:717)
at Game_Interpreter.pluginCommand (OcRam_Lights.js:404)
at Game_Interpreter.command356 (rpg_objects.js:10508)
at Game_Interpreter.executeCommand (rpg_objects.js:8930)
at Game_Interpreter.update (rpg_objects.js:8838)
at Game_Map.updateInterpreter (rpg_objects.js:6115)
at Game_Map.update (rpg_objects.js:6022)
at Scene_Map.updateMain (rpg_scenes.js:608)
SceneManager.catchException @ rpg_managers.js:1949


Cheers
Thank you for the report!

I will fix this ASAP.

Hello, is there any way to fix a light on some element of parallax background? For example, I want to put a moon in a parallax, and let it shine... but so that when that light passes behind the tiles (mountains, for example), the light is omitted. Is this something possible to do, or could it be possible in a future update?
Thank you for the message!

At the moment light sources are ALWAYS below weather sprite. I can't promise that light sources under tileset is coming in near future. But it is cool idea :) (And maybe some day I'll add this feature)
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
525
Reaction score
612
First Language
Finnish
Primarily Uses
RMMV
Latest version - v2.02 (released 2019/11/09)
  • Fixed bug where "light_e*" plugin commands crashed game
    Thank you @Zarchiel for report!
  • Fixed bug where game crashed if OcRam_Local_Coop was used and player joined game while not in map
  • New plugin parameter: Lights kill switch for all lights!
    Thank you @xizorandy for idea!
 

NikkiKaji

Villager
Member
Joined
Jun 30, 2016
Messages
26
Reaction score
6
First Language
English
Primarily Uses
Hey, OcRam! I think I found a bug possibly?
When I set a lighting effect to a terrain tag, transferring to a new map carries over the lighting effects of the tagged terrain from the previous map. It does this for every map I transfer to, and never resets the lighting. I disabled all of my map related plugins, and put this one close to the bottom.
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
525
Reaction score
612
First Language
Finnish
Primarily Uses
RMMV
Hey, OcRam! I think I found a bug possibly?
When I set a lighting effect to a terrain tag, transferring to a new map carries over the lighting effects of the tagged terrain from the previous map. It does this for every map I transfer to, and never resets the lighting. I disabled all of my map related plugins, and put this one close to the bottom.
Thank you for the report!

I will fix this ASAP.

EDIT:

Latest version - v2.03 (released 2019/11/23)

  • Terrain lights will be now cleared properly when transferred to another map!
    (Thank you: @NikkiKaji for reporting this issue!)
 
Last edited:

NikosEdy2

Villager
Member
Joined
Dec 15, 2017
Messages
6
Reaction score
1
First Language
Greek
Primarily Uses
RMMV
Wow! Seems amazying! This plug in also works for parallax map? Or only for tile maps?

EDIT: I test it! Oh it works! It works smoothly! :)
 
Last edited:

DeadlyEssence01

Veteran
Veteran
Joined
Oct 19, 2019
Messages
36
Reaction score
15
First Language
English
Primarily Uses
RMMV
Hey @OcRam, not sure if this is intentional or not, but when transferring a player to a new spot on the same map the lighting effects are reset. Figured I'd give you a heads-up since the hotfix above specified different maps. If it's intentional that's fine too! Pasting the same lighting plugin command right after the player transfer event is a seamless workaround.

Thanks for your hard work!
 

OcRam

Servant of the Universe
Veteran
Joined
Aug 2, 2016
Messages
525
Reaction score
612
First Language
Finnish
Primarily Uses
RMMV
Hey @OcRam, not sure if this is intentional or not, but when transferring a player to a new spot on the same map the lighting effects are reset. Figured I'd give you a heads-up since the hotfix above specified different maps. If it's intentional that's fine too! Pasting the same lighting plugin command right after the player transfer event is a seamless workaround.

Thanks for your hard work!
Thank you for the report,
I'll fix this, but it Will take some time. I'm re-factoring my code base ATM.
 

Feraleth

Veteran
Veteran
Joined
Jun 19, 2019
Messages
53
Reaction score
8
First Language
German
Primarily Uses
RMMV
@OcRam

Hello,

thank you for the great plugin.
I had previously used Khas Light Plugin. Unfortunately, it is apparently no longer compatible with the current MV version (bugs, also in the demo).

My question: I have not yet found an option for the walls here. So the light goes through the walls, or rather above.

Is there a chance that the light will be intercepted by the wall and maybe cast a shadow on the wall? Kha's plugin had such options.

If this option does not exist, will it be added to this great plugin? :)

Best regards
Feraleth
 

dom438

Villager
Member
Joined
Oct 8, 2018
Messages
16
Reaction score
2
First Language
spanish
Primarily Uses
RMMV
good job excellent thanks you!!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Profile Posts

For those who heard MZ’s Battle 2, anybody think it’s a continuation of MV’s Battle 1?
Finally done! Time to continue the other one.
Grass... Earth... Sand... Snow! Working on edits for some new autotiles for MZ/MV
Waiting on approval on my One Map Challenge game, which I made to get a feel for RPG Maker. I was able to complete it before MZ's release, now I can focus fully on the MZ game I want to make. I'm excited, ya'll.

I have recently returned to try and developing games after I learned how to use digital drawing software.

My goal is to start simple and small. I am mostly aiming to create a game that I would play, and to tell a story that I would like to read. :smile:

Forum statistics

Threads
100,811
Messages
979,842
Members
132,450
Latest member
GriffithVIII
Top