Trouble with Khas' awesome lighting

Klaykrow

masochistfox
Veteran
Joined
Apr 7, 2017
Messages
31
Reaction score
1
First Language
English
Primarily Uses
RMVXA
I really hope this is in the right place to post this, I don't use forums too often as I try my hardest to scour google to fix my problem, but I'm sadly out of luck in this case.

Alright, Now to my problem.

I'm using Khas' awesome lighting effects in my game and it's running fine for lighting and such.

My problem is, I have it to go dark at a certain spot using the call:

s = $game_map.effect_surface
s.change_color(120,0,0,0,200)

and it makes things go dark and makes the lights show up very nicely (though it makes text boxes and pictures darker which sucks)

My problem is when I want it to go back to a normal lighting (as if I didn't use the dark call), It will not change back and remains dark.

I've tried using the call:

s = $game_map.effect_surface
s.change_color(0,0,0,0,0)

and also this call

s = $game_map.effect_surface
s.change_color(120,0,0,0,150)

neither works.

I dont want to use the lighting effects for the whole game since the tint screen works fine for most of the game, but I need this for flashlight and other lights for very specific parts.

I've already tried erase event after the call as well as a control switch to erase it, I've tried tint screen back to normal and I've set
Surface_UE = false

I have no idea how to turn off the darkening. I'm probably an idiot, but I can't figure it out for the life of me.
 

Niam

Villager
Member
Joined
Jun 25, 2018
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMVXA
s.change_color(tint fade time, red ,green ,blue, alpha)

so for default use s.change_color(0,0,0,0,255) for maximum brightness.
edit: context would help to. if those are both on the same map it can be buggy unless attached to transitions.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
We have a section devoted to problems connected with scripts.
[move]RGSSx Script Support[/move]
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
89
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
One of the way is to do this:

Code:
s = $game_map.effect_surface
s.set_alpha(0)
If you want to be gradual, then use this:
Code:
s = $game_map.effect_surface
s.change_alpha(time, alpha)
Replace time with time in frames (60 frames are one second in default frame rate), and alpha with the alpha color's opacity ( from 0 to 255).

Also, since you mentioned the alpha color goes above your pictures, check the settings at line 214, where you should see this:
Code:
Surface_Z = 180
Edit it to lower value (I did to 20 in my project, and it works fine so far).
 

Klaykrow

masochistfox
Veteran
Joined
Apr 7, 2017
Messages
31
Reaction score
1
First Language
English
Primarily Uses
RMVXA
s.change_color(tint fade time, red ,green ,blue, alpha)

so for default use s.change_color(0,0,0,0,255) for maximum brightness.
edit: context would help to. if those are both on the same map it can be buggy unless attached to transitions.
ah sorry, yeah its a different map.
this didnt work though :/ it didnt change the lightness of the area at all uou

We have a section devoted to problems connected with scripts.
[move]RGSSx Script Support[/move]
sorry! i looked around and wasnt sure where to put this OTL

One of the way is to do this:

Code:
s = $game_map.effect_surface
s.set_alpha(0)
If you want to be gradual, then use this:
Code:
s = $game_map.effect_surface
s.change_alpha(time, alpha)
Replace time with time in frames (60 frames are one second in default frame rate), and alpha with the alpha color's opacity ( from 0 to 255).

Also, since you mentioned the alpha color goes above your pictures, check the settings at line 214, where you should see this:
Code:
Surface_Z = 180
Edit it to lower value (I did to 20 in my project, and it works fine so far).
I tried to use both of those, but all it did was flash the same darkened screen, but then go totally pitch black.

the surface z thing fixed my picture issue though.
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
89
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
Hmm... Goes back to dark screen, you say.
It sounds to me like something else change it back to pitch black. Is there any parallel process event that have the code for
setting dark screen?
 

Klaykrow

masochistfox
Veteran
Joined
Apr 7, 2017
Messages
31
Reaction score
1
First Language
English
Primarily Uses
RMVXA
Hmm... Goes back to dark screen, you say.
It sounds to me like something else change it back to pitch black. Is there any parallel process event that have the code for
setting dark screen?
ok so i figured out what the problem was! there was another tint screen thing hiding off in a corner. OTL

the script:

s = $game_map.effect_surface
s.set_alpha(0)

worked after removing it, but not the other one, but thats totally fine because it works how i want it to now ;u;

thank you so so so much for your help!

this thread can be closed now!
 

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

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,230
Members
137,607
Latest member
Maddo
Top