Ops! My bad!
This should be fixed now. I forgot to remove the "tiletype" argument here, on line 383:
this[result](command, args,
Ops! My bad!

This is...only half true, at least for the chromium-based engine RMMV runs on. I ran some tests using the various methods using this quick throw-together in the RMMV debug console:
function forTest()
{
var test = new Array(90000000).fill(undefined);
var timeStamp = new Date().getTime();
var result;
for (let i = 0; i < test.length; i++) test[i] = 1;
result = "test.length & i++: " + (new Date().getTime() - timeStamp);
timeStamp = new Date().getTime();
var len = test.length;
for (let i = 0; i < len; i++) test[i] = 2;
result += "\nlet len = test.length: " + ((new Date().getTime()) - timeStamp);
timeStamp = new Date().getTime();
for (let i = test.length; i--;) test[i] = 3;
result += "\ni--: " + ((new Date().getTime()) - timeStamp);
return result;
}
forTest();
Does MZ use typescript? I haven't been paying as much attention to it compared to most others I imagine. That said, I don't know a whole lot about typescript and how it would integrate with RMMV's javascript, so if being in typescript requires extra work in order to add it to a project, I'd hold off on it.
Hi!
let key = [mapid, eventid, 'D'];
$gameSelfSwitches.setValue(key, false);
for (let i = 0; i < event_eventcount; i++) {
if ($gameMap.events()[i]) {
if ($gameMap.events()[i].event()) {
let note = getTag.call($gameMap.events()[i].event());
let note_args = note.split(" ");
let note_command = note_args.shift().toLowerCase();
if (note_command == "light" || note_command == "fire" || note_command == "flashlight") {
event_note.push(note);
event_id.push($gameMap.events()[i]._eventId);
event_x.push($gameMap.events()[i]._realX);
event_y.push($gameMap.events()[i]._realY);
event_dir.push($gameMap.events()[i]._direction);
event_moving.push($gameMap.events()[i]._moveType || $gameMap.events()[i]._moveRouteForcing);
event_stacknumber.push(i);
}
else if (note_command == "daynight") daynightset = true;
}
}
}
// *********************************** DAY NIGHT Setting **************************
daynightset = false;
not it doesn't I am the one that will be making the definition files for MZ once it get out. As I am working with Kino on allowing other superset language support for plugin making.
The number of elements in the array can be changed to pretty much whatever you want to test with. I just chose a large number to allow for greater precision in the results. (A smaller number might not show any difference between iterating in either direction. Also yeah, JS has changed a lot since 2010 and a lot of browsers have varying optimizations. For example, cloning an array via the spread operator is lightning fast in Chrome, but slice is faster in Firefox.
Honestly, no idea, but I suspect that's the case. That's original Terrax code. 🙂
That was checked in the original code and was part of that big long fire || light || ...etc if block, but I split it out since it had another conditional check for "daynight" inside the block. I assume Terrax intended for daynight to be usable on events or maps alike originally, but then never got around to properly implementing it for events. Yeah, that else if... line can safely be deleted.
I guess what I'm saying is I don't want other developers to feel like they have to download and and install a bunch of other stuff just to make this work with their projects, so unless typescript is supported natively by MV (I don't think it is) or MZ when it finally comes out, I'm going to have to be the unfortunate "no" vote for this.
I tested it a few moments ago, and so far so good. I do have the following thoughts though:
That's pretty cool, but if I may nitpick a bit, the tint layer should probably be drawn over the battlebacks layer and not the entire battlefield. The default night tint looks like this in battle, which kind of washes out the battlers and especially animations, especially those that should be a bit brighter and glowy:



Yeah, that's perfect! And I agree, a plugin parameter is probably the best way to handle that so people can choose either method to suit their tastes. Nicely done!
Original thread: https://forums.rpgmakerweb.com/threads/community-lighting-mv-mz.124274/