Hi,
$gamePlayer._lightData should return null or undefined if player is not lit.
So: ($gamePlayer._lightData && event.isPlayerInLightRadius()) returns true only when player has light and is in radius.
Hi,
typeof $gamePlayer._lightData === "object" && !$gamePlayer._lightData
It might be that player actually has _lightData, but it's type is 0...
Thank you for the message,
Hey,
No problem. And I'm glad you got it all figured out! 🙂
this.event().getObjectsInLightRadius().forEach(obj => {
console.log(obj);
});
// Is player or follower in radius of this event?
Game_Event.prototype.isPlayerInLightRadius = function () { // Must have valid light source - else will return always false
if (!$gameMap) return false;
if (!this._lightData || this._lightData[0]._lightType == 0) return false;
var ld = this._lightData[0]; var r = Math.floor(ld._radius / 48);
var in_range = _this.isInRange(this._x, this._y, $gamePlayer._x, $gamePlayer._y, r, ld._lightExParams.degrees, this._direction);
if (in_range) return true; var tc = this;
$gamePlayer._followers.visibleFollowers().forEach(function (f) {
if (_this.isInRange(tc._x, tc._y, f._x, f._y, r, ld._lightExParams.degrees, tc._direction)) in_range = true; return;
}); return in_range;
};
if (_useTimeSystem) { // Use OcRam_Time_System?
if (!$gameMap._forcedTint_OC) {
if (_isIndoors && !_useTintIndoors) {
_this.debug("Indoors", "NO TINT!");
if (_intervalHandle != null) {
window.clearInterval(_intervalHandle);
_intervalHandle = null; // Let's clear this interval
} _tintBG = '#ffffffff'; _currentTintColor = hexToRGBA("#ffffffff");
} else {
if (!_this._menuCalled) {
_prevDayPhase = -1; triggerDayPhase(true);
}
}
}
}
Thank you for the message,
Thank you for the message,
Ok now I think I understood the issue. I will check that if <indoor> autotint is set false in plugin parameters it should not meddle with existing light layer tint.
_tintBG = '#ffffffff'; _currentTintColor = hexToRGBA("#ffffffff");
Thank you for the message,
Original thread: https://forums.rpgmakerweb.com/threads/ocram-lights-plugin-mz-mv.108614/