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?
Orange Lighting
● ARCHIVED · READ-ONLY
-
-
I don't know why I had never included a param for that. I did now.
-
I don't know why I had never included a param for that. I did now.
Was that to me or Sobro? lol -
Was that to me or Sobro? lol
Sobro. I had seen your first edit and thought you had solved the problem you had.
I'll check if there's anything wrong with the default flicker later, but if you want to force a refresh on the light system, you have to call the refreshMask method or set the "dirty" property to true for it to refresh automatically on the next frame.
On the playerlight addon, there's an update method that checks if anything changed and set this dirty property to true if needed. -
Sobro. I had seen your first edit and thought you had solved the problem you had.
I'll check if there's anything wrong with the default flicker later, but if you want to force a refresh on the light system, you have to call the refreshMask method or set the "dirty" property to true for it to refresh automatically on the next frame.
On the playerlight addon, there's an update method that checks if anything changed and set this dirty property to true if needed.
Sorry, just wanting to verify:
So in my common event that changes the "flicker_player" variable, setting the variable and dirty via script call will work? *took a screenshot*
-
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 :p ) 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 :D ))
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. -
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.
Ah well I'll probably have to edit there then... as my test failed.I got an error "Cannot set property 'enabled' of undefined" with the following changes (see attached)missed a "}" which fixed the error, but now no playerLight appears at all.
And also the previous code didn't work :( Well I mean once again it does "something" when moving, but not automatically like how you had the opacity update fixed (which that does work now by the way). Just the player radius changing isn't working at the moment.
EDIT2: Hudell I think I'm only making it worse LOL ... going to undo those changes (in attached), and try to edit the flicker portion only I think... I just want the radius to increase/decreased -- and update like you did with the opacity -- by variable >.>
EDIT: I added a new parameter up top:
playerLight.Param.playerRadiusVariable = Number(playerLight.Parameters.playerRadiusVariable || 0); // NEW - if > 0; use this instead of above
((I put it right below PlayerRadius parameter)
-
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.
-
@Hudell the transitions still are not smooth. They immediately change from one thing to the other no matter what setting I have it on. Would you mind taking a look at my project and seeing what I'm doing wrong, because if you've fixed it there must be some issue on my end.
-
@Hudell the transitions still are not smooth. They immediately change from one thing to the other no matter what setting I have it on. Would you mind taking a look at my project and seeing what I'm doing wrong, because if you've fixed it there must be some issue on my end.
Sure, send it to me in a message. -
@Hudell Sorry to bother you (wrong topic too I think, but it's related to one of your other scripts) - about OrangeHud; I'm confused on how to setup a variable picture? The parameters don't seem to ask for the picture(s) file? Like would I be able to use the following to work as a variable hud?
The bar is supposed to be like a "feed" bar. When the vampire feeds the bar is supposed to deplete, showing how much blood is left in the enemy based on their "HP" variable (kinda like vampire: the masquerade) ^_^
-
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. -
$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
Just saw this ... where would I need to add this code? -
@Hudell So this might seem like a dumb question then... so how would I set them up for different variables?
EDIT: Forgot to mention I already have this variable system setup; but currently using a crude window/var hud = ugly black/red bar :p
----------
I.e - NPC 1 has a random variable for health (let's say 5..8) For this NPC when fed on, I would like the Min Var = 0; Max Var = HPVar for the Hud itself.
But then let's say later player meets NPC 2 who gets an HPVar of (8..12) now the variables have changed for Max Var which would make the Picture hud a bit.... weird? If I set each picture up little bit at a time? Or am I just going to have to bite the grit on this one and make a picture for each possible HP scenario? lol ((I mean if I -have- to, I'll deal with it :p
I just remember for VX(+Ace) there were variable huds that would increase/decrease on a separate/hidden layer or something? So they would only show within the hud bar background. Which was pretty cool when you designed custom huds that had slanted or rounded edges so the variable fill itself wouldn't show beyond those slants or rounded edges.
---------
@keeno79 you would use a Script Call command, and then place it in there.