I came here looking to see if someone clever had done this very thing - and I find a lot of clever people! I mainly want this for room and street lighting. So far all I have done is put the plugin in my MZ project that I have brought over from MV and copied the Terrax notetag from an MV light event into an MZ one to see what would happen. It works perfectly. When I have time I shall be investigating fully what I can do (it's a long time since I set up the Terrax stuff in MV so can't even remember that!).
So thank you to everyone who had a hand in this, it is much appreciated by this non-coding numpty.
EDIT: PS Thanks for the demo game also, this will be invaluable for seeing how things work. I fear Bobo will have to have a make-over though - clowns creep me out too much!
Edit: found out that if you put this plugin below YEP_CoreEngine, it works as intended. Problem solved.
I may have encountered a bug in latest MV 1.027 version, perhaps someone could confirm?
In the plugin, last block of options, if I set Light Mask Position to Above Battlers, I get the expected result: both the battleback and the battlers are affected. But if I set the Light Mask Position to Between Background and Battlers, neither the battleback or the battlers are affected.
It's 0am in game
Between should have the background darkened, but not the battlers, correct?
First of all, thanks a lot for getting a lighting plugin for MZ working so soon!
Second, I have been trying to read through the thread, and I have an issue: I still don't understand how to make a light be "switch on-able". I'd like the player to be able to walk into a pitch-dark room, walk around, and light torches to be able to gradually light up those parts of the map. I've been futzing with switches and the killswitch option and whatnot, but I don't know how to set this up.
I can do the reverse, have a light already on and killswitch it, but then I guess I can't "unkillswitch" it? One post mentioned something about conditional lights, and I didn't really get it.
EDIT: I guess while I'm here, is there a way to set the tint of the screen to really dim grey instead of pitch black? I'm not interested in the day/night cycle, but would I need to implement that somehow?
For switching lights on, either use the plugin command "Activate Light by ID" or use the built-in "kill switch" function in the plugin parameters. I do believe though that you need to first shut off the lights when you enter the map to then "reactivate" them, because lights are ON by default.
One useful thing to remember is, you can remotely control self switches of other events by using the script command and executing "$gameSelfSwitches.setValue([X,Y,'Z'], true);"
X = ID of the Map where the event is located
Y = ID of the Event with the light
Z = What self switch you want to select (e.g. A, B, C, D)
at the end put true or false depending on if you want the switch to be ON (true) or OFF (false)
That way you can use the killswitch function to switch lights on and off
Its probably still best though to just use the "Activate Light by ID" plugin command
for the screen-tint, use the plugin command "Set Tint" and set it to something like #999999
with any fade speed you wish (0 for instantly)
Thank you for answering, but unfortunately, I'm not seeing any "Activate Light by ID" option in the command list. I'm pretty sure I've got the latest version running. (Using MZ).
I also don't understand a lick of coding, so if I need to go into the script itself to adjust things, I'm gunna need, like, a visual guide a four year old could understand.
As for using the killswitch, what I try to do is, set the killswitch to, say, B. Then I try to have the event be set at B from the start, and have the second page be A, or "none" on the self-switch, which the player has to activate by touching the event and hitting the button. However, it seems like once a light is Killswitched, it will not be "unkilled", and its just stuck on the light being "off". I'm sure I'm not doing it right or something, but if it's as simple as switch self-states, I don't know what I'm doing wrong. Likewise, and I guess this is just how events work, even if I set the first page of the event to "B", that doesn't effect the light... it'll be on when I go into the room and the event character itself might be invisible.
If you want to begin in a dark room where lights are put on one by one, conditional lights are definitively what you need. See the Conditional light hall in the demo to get the feeling of how it works. You can also do it with kill switch, but as you figured out, it is more tricky.
By default, a conditional light is off until you light it up with "Activate Light by ID" plugin command. Use the same command to switch them off if needed. Unless you modified the parameters, this will carry over if there is a map change.
"Activate Light by ID" is the third plugin command from the top, it is placed between "Reset Light Switches" above and "Light Color By ID" under.
"Set Tint" is the fourth plugin command from the bottom, it is placed between "Show Time" above and "Reset Battle Tint" under. As it was said, it is the way to get something else that a pitch black screen where there is no lights.
If kill switches is more your thing, the way to do it is as you said, have the first page of the event as a parallel process who just activate the kill switch (B in your case). The second event page would be active when B is ON, and would be the object the player can interact with. When the player interact with the light source to light it on, deactivate the self-switch B so the light shows on, and make sure the event uses now a third event page (for example, activate self-switch A and create a third event page active when switch A is ON, showing off the lighted light source), so the parallel process of the first page don't repeat again and set the kill switch back to ON.
OH! Cripes, okay, I misunderstood. Sorry, I've never used plugin commands before, I was thinking this was all being done directly on the plugin's menu. I'll mess around with this, then. Thank you very much!
Okay, I was having trouble there, but I figured it out finally. Thanks again!
Hey again, you said at one time that you edited the plugin to make it significantly faster and smaller, right?
I do have interest in a cut-down version of the plugin, since I don't really use many of the more exotic plugin functions either and I sometimes have some slight performance issues.
Now, I am not very good at JS and while I do edit plugins from time to time (if I succeed that is),
this particular .js file for the plugin looks like a mess to me and I don't even know where to start without breaking everything.
So, without wanting to bother anyone, would anyone be willing to edit the newest version of the MV Community Lighting plugin to effectively remove these functions for me? (Would removing these functions even improve performance? If not, don't even bother lol)
- DayNight functions, anything related to that, since I don't have a time system
- Anything to do with battle-tints, I don't plan on having lights in battle
- Player flashlight (I mean the cone-shaped one, notthe circular light)
This is just a friendly request, you don't need to bother if you don't have time or whatever reason you might have. You could even release the cut-down version as "Community Lighting Light" or something stupid like that and post it on GitHub aswell.
Oh yeah, my "Ultra Mini Community Lighting" fork of the plugin... I forgot to add that to the GitHub. Which honestly I need to organize better at some point when I've got some free time. Anyway they're on the GitHub as umc_Lighting.js or umc_Lighting_mz.js files (depending on your flavor).
I'm pretty certain I've updated the MV version since I posted it in this thread. The MZ version however is basically the same since I don't own MZ. Also just to recap, the purpose of this variant is to be as fast as possible, not to be feature rich. People are free to edit it and post better versions to here, or on the GitHub. All that I ask is you keep in mind the goal of the variant. If you wish to just add lots of features with disregard for speed, this version is not for you.
I really tried to pull off something for halloween, but I don't feel like going on. I feel like the plot I was building was too generic, and I couldn't connect to it as I do with other projects. On the bright side, I've been working on my cosmic-puzzle project, so far I think the core mechanics are working properly, so I'll be creating some large test maps to see how it works out.
M.Healer: I'm wearing M.Mage's Costume. M.Mage: I'm wearing M.Healer's Costume. M.Knight: Why not using the Scary Costume like me,The Scary Frankenstein? M.Healer: Err…Because we have low of Budget. M.Mage: Yeah,right.