That explanation made all the difference. Thank you so much! I now have it working.
One last question. Is there a way to change the color of the mask?
I don't know why I had never included a param for that. I did now.
Replace
lightSystem.dirty = true;
for:
Hudell.OrangeLighting.dirty = true;
lightSystem is just an "alias" I made for Hudell.OrangeLighting so I don't have to type all of that again inside the player script, but it only exists there.
Well sadly that didn't work.... it's okay though I'm going to test out a theory. Since the max radius is put in by way of a Parameter, I'm going to change (if it's okay to mess with your script 😛 ) the playerRadius parameter and change it to look for a variable instead. This way I should be able to just plugin the variable value where the max radius should go. And of course if the variable changes, then turn .dirty = true; ^_^
In theory this should work to fix my issue until the flicker issue is looked into ((Of course I could've just been doing something wrong with it as I said, but I'll wait for the expert to say 😀 ))
Will report back with the result!
-LordV
The default flicker effect changes the color a little bit instead of changing the radius. The code responsible for that is on line 444 of the main OrangeLighting plugin.
Also, your previous code should have worked.
if (namespace.dirty) {
this.refreshMask();
namespace.dirty = false;
this.currentMapId = newId;
this.currentDisplayX = newDisplayX;
this.currentDisplayY = newDisplayY;
}
Look for this code inside the updateMask method. If you remove the IF condition, the light will refresh every frame. It's a good way to check if the problem is with the code that checks if it needs to be refreshed or the code that actually changes the light.
Well the good news is I got it to work (kinda) by editing the If (flicker === true && wait == 1) section:
//endRadius -= gradRnd;
var flickerMin = $gameVariables.value(65);
var flickerMax = $gameVariables.value(66);
if (endRadius === flickerMin) {
endRadius += 10;
}
if (endRadius === flickerMax) {
endRadius -= 10;
}
Now my only problem is figuring how to make it bigger from here (but I think I can try to figure that on my own (it seems to alternate between 85 and 90 radius, but won't go all the way up to 200 ((Which I define the variables before calling <>.playerFlicker = true; ((<> == all that extra Hudell.line code)) seeing up flickerMin as 90, flickerMax as 200.))
So I'm thinking I may also have done something wrong with that little edit above too (maybe it's updating too fast to go all the way out to 200 before going back down?)
Wow I can't believe how helpful you are! The mask colour parameter worked like a charm.
I have two more questions if anyone can help.
Is there a scriptcall to change the mask colour and opacity in an event?
Also, I'm having trouble just having event lighting on without player lighting. I would like for my events to be lit up, but for the player to be dark. I tried changing the player light radius to 0 but that caused an error. It won't accept anything lower than 10, so that's what I'm currently using, but as a result my character is running around with a glowing crotch.
Any help is much appreciated.
Hey, I am using this and it's great - thanks! I'm wondering how this will affect performance on iOS etc, do you have any idea whether this slows things down too much? I am losing most of my FPS when running the game using Firefox but playtesting in RPG Maker and playing the deployed application is absolutely fine.
I never really played any MV game on mobile, so I have no idea how things go.
Link to Orange Hud thread:
The VariablePicture add-on will look for a picture where the name is the value of the variable that you configure.
So if the value of the variable is 0, it will look for 0.png, if it's one, it will look for 1.png and so on.
You can use the following line to change the value of the variable to something else than a number:
$gameVariables.setValue(1, "empty-bar");
In this case, it will change variable 1 to "empty-bar", so if you used this variable on the add-on, the HUD will load a picture called empty-bar.png
You can also change the Pattern param on the add-on to make it look for a file with a different name. For example, if you want to load a picture called Picture0 when the value is 0, Picture1 when the value is 1 and so on, set "Picture%1" on the Pattern param.