Terrax Lighting system

Novacalico

Also known as Mikeneto
Member
Joined
Oct 26, 2015
Messages
10
Reaction score
7
First Language
English
Primarily Uses
RMMV
1582345702119.png

1582345903425.png
Running into this when using Terrax lighting with Yanfly core. Any suggestions?
Tried placing script above and below Yanfly's stuff. Set resolution parameters to match what currently set.

Thanks in advance.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,225
Reaction score
1,131
First Language
English
Primarily Uses
RMMV
It works fine with yanfly's stuff, including his core engine. I'm betting the problem is Foreground.js, whatever that is.
 

Novacalico

Also known as Mikeneto
Member
Joined
Oct 26, 2015
Messages
10
Reaction score
7
First Language
English
Primarily Uses
RMMV
It works fine with yanfly's stuff, including his core engine. I'm betting the problem is Foreground.js, whatever that is.
Thank you for the quick reply.
I read that so many were using Terrax with Yanly without issue which is why I was confused that anything Yanfly was even in the bug report.

Foreground is one of the super early free scripts that was released when the MV first came out.

"Author: Sasuke Kannazuki (thanks to YojiOjima)
'foreground' is like a parallax that displays over the map.

put bitmap file at img/parallaxes."


I'll disable that and run some tests. That did it!
Thanks again!
 
Last edited:

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
303
Reaction score
37
First Language
Italian
Primarily Uses
Hi guys, i'm having a little problem.

I want to set a radius on player, with "Fire radius 50 #E2B822"

But, when i set a tint on the screen with the command "Tint set #333333", the flickering effect of the fire, around the player, stops... and i must replay the command "Fire radius 50 #E2B822" for play the flickering effect around radius player.

I noticed that every single time you use a "plugin call", the flickering stop. For example, even if you use the yanfly quest journal and use the call script "Quest add 1", the flickering stop.

I really don't understand why and what to do.

Is it a bug? Can you help me guys? :(
 
Last edited:

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
303
Reaction score
37
First Language
Italian
Primarily Uses
Guys? Nobody is able to take this script and support it? :(
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,225
Reaction score
1,131
First Language
English
Primarily Uses
RMMV
Looking at it, I think I found the problem. In this line in his override of Game_Interpreter.prototype.pluginCommand, he's basically saying "if the plugin command (regardless of which plugin it targets) isn't "fire" then turn off flickering which is...horrible to say the least

Code:
            // ******************* FIRE *******************
            if (command === 'fire') {
                $gameVariables.SetFire(true);
            } else {
                $gameVariables.SetFire(false);
            }
You can fix it (maybe, no promises it'll work or won't break other things) by replacing the else statement with this:

Code:
            } else if (command === "light" || command === "flashlight") {
So:

Code:
            // ******************* FIRE *******************
            if (command === 'fire') {
                $gameVariables.SetFire(true);
            } else if (command === "light" || command === "flashlight") {
                $gameVariables.SetFire(false);
            }
 

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
303
Reaction score
37
First Language
Italian
Primarily Uses
Looking at it, I think I found the problem. In this line in his override of Game_Interpreter.prototype.pluginCommand, he's basically saying "if the plugin command (regardless of which plugin it targets) isn't "fire" then turn off flickering which is...horrible to say the least

Code:
            // ******************* FIRE *******************
            if (command === 'fire') {
                $gameVariables.SetFire(true);
            } else {
                $gameVariables.SetFire(false);
            }
You can fix it (maybe, no promises it'll work or won't break other things) by replacing the else statement with this:

Code:
            } else if (command === "light" || command === "flashlight") {
So:

Code:
            // ******************* FIRE *******************
            if (command === 'fire') {
                $gameVariables.SetFire(true);
            } else if (command === "light" || command === "flashlight") {
                $gameVariables.SetFire(false);
            }
@Aesica

My good, it seems that you have fixed it!! You are incredible, really.
I didn't noticed that this fix break other things, it's perfect! T_T

EDIT: That error is fixed, but i found another thing that break the flickering. T_T A simple plugin call "Light on 1" or the off one, break the flickering of the radius. If i call a "fire radius 0..." and another "fire radius 50..." (off and on), the flickering return.



why don't you try taking this plugin and cleaning it? i think that you are really amazing and this project could become much cooler! I tried to write to Terrax on email that is written in the plugin.
I wonder if it is still reachable or not ...


I take this opportunity to ask you something. I asked terrax a while ago to implement an item in the options menu, to give the player the possibility to disable the script, if he doesn't want the lighting effects. (i found it, i think that it's the part in the very bottom of the plugin.

The fact is that with the new options of yanfly, this entry is gone, probably the code is not compatible with the yanfly script. Would you be able to make it compatible and make it appear? T_T
 
Last edited:

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,225
Reaction score
1,131
First Language
English
Primarily Uses
RMMV
I don't know, I've considered taking it up multiple times to fix various things, but every time I look at the code, I find myself running in the opposite direction. Maybe after I finish my current game, but that's not a promise. It really is a messy script and again, I mean no disrespect to Terrax when I say that. (This issue you've seen with fire flickering is a great example of what I mean)

Anyway, you actually can switch the script on or off via plugin command:
to turn it on:
Code:
script activate
-or-
light activate
to turn it off:
Code:
script deactivate
-or-
light deactivate
Now a little insight into the fix I added to the flickering: Before, it was basically saying "if the plugin command is 'fire' then turn on flickering. If the plugin command is anything else, no matter what, turn off flickering." The fix I made was "if the plugin command is 'fire' turn on flickering, otherwise, if the plugin command is 'light' or 'flashlight' then turn flickering off.

While it wasn't an ideal fix, it was a fix that would be easiest to share via these forums. This might work a little better:

Just below what we changed, there should be the following line:

Code:
            // ******************** MAIN PLAYER SETTINGS ***************
            if (command === 'light' || command === 'fire') {

                //******************* Light radius 100 #FFFFFF ************************
                if (args[0] == 'radius') {
And a bit lower down:

Code:
                //******************* Light radiusgrow 100 #FFFFFF ************************
                if (args[0] === 'radiusgrow') {
Right after those two, insert the following:

Code:
                    if (command === 'fire') $gameVariables.SetFire(true);
                    else $gameVariables.SetFire(false);
So each should look like this, respectively:

Code:
                //******************* Light radius 100 #FFFFFF ************************
                if (args[0] == 'radius') {
                    if (command === 'fire') $gameVariables.SetFire(true);
                    else $gameVariables.SetFire(false);
Code:
                //******************* Light radiusgrow 100 #FFFFFF ************************
                if (args[0] === 'radiusgrow') {
                    if (command === 'fire') $gameVariables.SetFire(true);
                    else $gameVariables.SetFire(false);
Finally, locate this line:

Code:
            // ************* FLASHLIGHT *******************
            if (command === 'flashlight') {
And right below it, add

Code:
$gameVariables.SetFire(false);
So:

Code:
            // ************* FLASHLIGHT *******************
            if (command === 'flashlight') {
                $gameVariables.SetFire(false);
You may want to back the plugin up before applying these changes, first. I haven't tested them, but they should work
 

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
303
Reaction score
37
First Language
Italian
Primarily Uses
I don't know, I've considered taking it up multiple times to fix various things, but every time I look at the code, I find myself running in the opposite direction. Maybe after I finish my current game, but that's not a promise. It really is a messy script and again, I mean no disrespect to Terrax when I say that. (This issue you've seen with fire flickering is a great example of what I mean)

Anyway, you actually can switch the script on or off via plugin command:
to turn it on:
Code:
script activate
-or-
light activate
to turn it off:
Code:
script deactivate
-or-
light deactivate
Now a little insight into the fix I added to the flickering: Before, it was basically saying "if the plugin command is 'fire' then turn on flickering. If the plugin command is anything else, no matter what, turn off flickering." The fix I made was "if the plugin command is 'fire' turn on flickering, otherwise, if the plugin command is 'light' or 'flashlight' then turn flickering off.

While it wasn't an ideal fix, it was a fix that would be easiest to share via these forums. This might work a little better:

Just below what we changed, there should be the following line:

Code:
            // ******************** MAIN PLAYER SETTINGS ***************
            if (command === 'light' || command === 'fire') {

                //******************* Light radius 100 #FFFFFF ************************
                if (args[0] == 'radius') {
And a bit lower down:

Code:
                //******************* Light radiusgrow 100 #FFFFFF ************************
                if (args[0] === 'radiusgrow') {
Right after those two, insert the following:

Code:
                    if (command === 'fire') $gameVariables.SetFire(true);
                    else $gameVariables.SetFire(false);
So each should look like this, respectively:

Code:
                //******************* Light radius 100 #FFFFFF ************************
                if (args[0] == 'radius') {
                    if (command === 'fire') $gameVariables.SetFire(true);
                    else $gameVariables.SetFire(false);
Code:
                //******************* Light radiusgrow 100 #FFFFFF ************************
                if (args[0] === 'radiusgrow') {
                    if (command === 'fire') $gameVariables.SetFire(true);
                    else $gameVariables.SetFire(false);
Finally, locate this line:

Code:
            // ************* FLASHLIGHT *******************
            if (command === 'flashlight') {
And right below it, add

Code:
$gameVariables.SetFire(false);
So:

Code:
            // ************* FLASHLIGHT *******************
            if (command === 'flashlight') {
                $gameVariables.SetFire(false);
You may want to back the plugin up before applying these changes, first. I haven't tested them, but they should work
@Aesica

I tried. Unfortunately, the problem is not fixed T_T When i activate/deactivate a light with "Light on 1" or "Light off 1", the flickering of player radius stop... (and the flickering of the fire that i've activate works, of course, without problem). i really don't understand what is the connection. (i attach my script, but i think that it's correct, i follow your instruction...

About the option menu, unfortunately, the Yanfly Options Core have a part that explain how to set up a new option, but it's too difficult for me. Terrax made that final part of code for have it in option menu standard, but with Yanfly Option Core, the thing change... Maybe you can understand better how to set up that specific function in the Yanfly Option Core... (I know that there are two call plugin that disable the light, but i think that it's better that function in the option menu...).

Let me know T_T Thank you very much in advance...
 

Attachments

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,225
Reaction score
1,131
First Language
English
Primarily Uses
RMMV
Oh right, you should delete the part we initially added--the one that was working sort of, but not really:

Code:
            // ******************* FIRE *******************
            // ******************* FIRE *******************
            if (command === 'fire') {
                $gameVariables.SetFire(true);
            } else if (command === "light" || command === "flashlight") {
                $gameVariables.SetFire(false);
            }
Those lines. You can soft delete them by adding /* to the start and */ to the end, like so:

Code:
            // ******************* FIRE *******************
            // ******************* FIRE *******************
/*
            if (command === 'fire') {
                $gameVariables.SetFire(true);
            } else if (command === "light" || command === "flashlight") {
                $gameVariables.SetFire(false);
            }
*/
As for the options menu, I really don't have a lot of experience with yanfly's options menu since I don't use it, so not much I can do there.
 

Kovos_Datch

Potatomancer
Veteran
Joined
Jun 6, 2015
Messages
84
Reaction score
39
First Language
English
Primarily Uses
RMMV
I just started using the plugin no problem. Thank you to the creator of this and thank you for those who run tech support for others.

Top notch plugin and easy to use.
 

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
303
Reaction score
37
First Language
Italian
Primarily Uses
@Aesica

OH YEAH!! OH YEEEAH! IT WORKS NOW!! You are the best! Thank you so much for your help! T_T

For the option part, i will open a topic, maybe someone is able to help me in that way.

However, thank you so much... really. Now the effect is perfect. I hope that no other things will crash the flickering effect. I found only this problems...
 

Manjini

Dummy
Member
Joined
Jan 6, 2019
Messages
26
Reaction score
22
First Language
German
Primarily Uses
RMMV
I am not sure if this has been asked before or not. But my question would be, if there is any way to have multiple instances of ''tint fade'' happening. Tinting the entire screen for day and night cycle is obvious but in addition I would like to tint a specific instance parallel to it(I sadly had to use terrax tint system because moghunter's doesn't seem to be working as I intended to use it and Terrax script seems to have stuff about moghunters tint system to begin with, so I managed to use it almost identical anyways).

I am using light sources for windows inside a building to emit sunlight coming in and I wish to slowly tint those light sources parallel to the normal day night tint system so that at night the screen tint is something like #222222 and the window light tint would be for example #444444 for possible moonlight or whatever coming in from outside.

I was kind of thinking of something as simple as ''Tint fade #XXXXXX D1 100 5'' in which D1 is for direction of the light source, 5 indicates the switch to turn this specific fade on or off in it's respective event note-tag similar to ''Light on 5 / Light off 5''.
This would probably be the perfect outcome for my needs.

The only working way I found was to just turn off the light at a specific hour. But this totally breaks the immersion and looks wrong.

If there is anybody who has an idea or perhaps solution I couldn't think of myself, I would gladly appreciate it.
 

belatucadrus

Veteran
Veteran
Joined
Mar 6, 2017
Messages
105
Reaction score
15
First Language
french
Primarily Uses
RMMV
Hey, didn't read all of the 71 pages, but has the compatibility fix with Mog's Time System updated yet ?

My maps goes dark in maps with the tag <Disable Tint Screen> applied
 

Kkool05

Warper
Member
Joined
Jan 27, 2019
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hi, just wondering how to use the flashlight effect. It tells me the code in the description but I don't know if it's supposed to be in an event or what.
 

bashenkman

Warper
Member
Joined
Jan 23, 2020
Messages
2
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hi All,

I didn't read through all 70 pages, but I was having a problem with the latest version where I couldn't change the player brightness.

Toward the bottom of the code there is a section that looks like this:

Game_Variables.prototype.SetPlayerBrightness = function(value) {
this._Terrax_Lighting_PlayerBrightness = value;
};
Game_Variables.prototype.GetPlayerBrightness = function(value) {
this._Terrax_Lighting_PlayerBrightness = value || 0.0;
};


I looked at the surrounding code for other functions, and figured it should look more like this:

Game_Variables.prototype.SetPlayerBrightness = function(value) {
this._Terrax_Lighting_PlayerBrightness = value;
};
Game_Variables.prototype.GetPlayerBrightness = function(value) {
return this._Terrax_Lighting_PlayerBrightness || 0.0;
};

When I made those changes, player brightness started working.

Just sharing my fix!
 

ImaginaryVillain

Now A YouTube Cool Kid! =D
Veteran
Joined
Jun 22, 2019
Messages
551
Reaction score
2,157
First Language
Absurdism
Primarily Uses
RMMV
So in my quest to make this script work with PIXI5 (which I've only half succeeded in) I ended up removing 1,200+ lines of WTF code. Stuff like support for his ABS system that nobody uses, checks for PIXI v2, blah, blah, blah. I also removed the time systems (his and compatability for Mog's) because I don't use them. I've added in Ultra Mode 7's compatibility as well.

Anyway the result is a significantly faster script that I use for my game. Figured I'd post it here. Obviously if you use the time systems don't use this, this is really just if you want the extra speed.
 

Attachments

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,225
Reaction score
1,131
First Language
English
Primarily Uses
RMMV
Haha, yeah Terrax I think said somewhere in the help comments that he isn't from an object-oriented background, so the whole thing is raging mess. I'm happy that somebody else with more patience than me did what had to be done, although I do use (and have greatly improved upon) the time-based portion in order to create a better-working day-night system so I'm still stuck with the slow version. For now. One thing I did that you might also want to do is change the weird-ass not-really-notetag system into an actual note tag system so that other plugins (or just script snippets using the note space for meta-based stuff) don't break the light tags.

As in:

Light 250 #ff0000

becomes

<Terrax: Light 250 #ff0000>

So yeah, just wanted to say nicely done. :)
 

ImaginaryVillain

Now A YouTube Cool Kid! =D
Veteran
Joined
Jun 22, 2019
Messages
551
Reaction score
2,157
First Language
Absurdism
Primarily Uses
RMMV
Thanks and haha yes, this script... I feel like I should have a large bottle of something alcoholic available whenever I go to edit it. :LZSwink:

I might look more into it to improve it... But I already have working versions of a PIXI text, PIXI sprite, procedural world generator, and an event interaction/movement scripts that I'm improving for my game. No idea when I'll get around to this one. I just wanted to squeeze as many frames as possible by switching to PIXI5 and this script wasn't having any of it (it's still not). But my super demanding game is basically the Cthulhu of frames, I must constantly sacrifice more to it to make it happy. So I edited it for our eldritch lord.:kaoback:

I'm actually more interested in PIXI lights... Considering just making something with that. But I kind of want to see what MZ has available before I commit to anything I don't specifically need for my game on MV.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,600
Reaction score
394
First Language
Portuguese
Primarily Uses
RMMV
Don't use this plugin anymore, been using mv3d and it has its own light system, but used it a lot before then...

Instead of removing the compatibility with those, why not just add a check at the start to see if they were imported, saving it in a variable/constant, and make it so if they are not the relevant code is just skipped?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Kitchen counters! I am on my second version of counters. It is slow going and I always see little details that could be done better. Have to force myself to say that's good enough for now and continue on.
I always thought I was just really, really bad at communication, then the internet proceeds to say "lol no".
Almost 100,000 Threads! We should make a celebration. Make a 100K logo? :p
Cursed problem: Multiple language switches. Say, you want to switch to EN language from JP but you have no idea where the language switch in JP menu language.
Tonight I'm finally going to start putting the dungeons my team has made on grid paper into the engine. That's the final step of making the game world.

Forum statistics

Threads
99,435
Messages
965,256
Members
131,052
Latest member
norem
Top