Changing tint back to what it was before?

gambles

Villager
Member
Joined
Jul 19, 2016
Messages
7
Reaction score
0
First Language
English
Primarily Uses
So the player character has a gun that when fired calls up a common event.


In this common event, the map's tint changes to (200, 200, 200, 0) @1 briefly which is pretty bright, then changes the tint to pitch black (-255, -255, -255, 0) @15, which is the same tint as the map I'm using to test this out.


It makes a neat effect in a pitch black map that lets you see the entire area for a split second whenever you shoot.


So here's the problem:


If I try firing the gun in a map that isn't pitch black, it'll change the tint to pitch black afterwards even if the map was perfectly lit before.


I guess my question is, is it possible to make the second tint change depend on the map you're currently in?


Some other solutions I've thought of are just using a flash effect instead of a tint (lame, unless there's some kind of transparent flash I don't know of it just ruins the effect), or having multiple common events with different second tints and tying the gun to a different common event depending on the map the player is currently in.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Try this ... before you start any of the tone changes, put the current screen tone into a variable (I'll use variable 15, but you use whatever you have available, and make sure you use the same number in both places below)  This variable doesn't need to stay around - you're setting it, doing a few things, then using it again.  So it's okay to use a 'dummy' variable that you can use for multiple things that you set then check again within the same event:

Code:
Control Variables: [0015 - dummy] = Script: screen.tone.clone


After all the tone changes, when you want it to go back to normal, do this:

Code:
Script: screen.start_tone_change($game_variables[15], 1)
 

gambles

Villager
Member
Joined
Jul 19, 2016
Messages
7
Reaction score
0
First Language
English
Primarily Uses
Works perfectly, I had to change the last number from 1 to 15 to get it just right.


Thanks a bunch.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If that was the very last number (the 1), that's the time it takes for the tint to change, in frames.  It's got nothing to do with the variable id.
 

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
39
First Language
German
Primarily Uses
If that was the very last number (the 1), that's the time it takes for the tint to change, in frames.  It's got nothing to do with the variable id.
Hey Shaz, do you know the same commands for MV ?
This would be awesome :)
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
@styx92 This should have been posted as its own thread, but ... for MV you would use $gameScreen.tone.clone() and $gameScreen.startTint(tone, duration) 


$gameVariables.value(variableId) to get the value of a variable, and $gameVariables.setValue(variableId, value) to set the value of a variable.
 
Last edited by a moderator:

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
39
First Language
German
Primarily Uses
@styx92 This should have been posted as its own thread, but ... for MV you would use $gameScreen.tone.clone() and $gameScreen.startTint(tone, duration) 


$gameVariables.value(variableId) to get the value of a variable, and $gameVariables.setValue(variableId, value) to set the value of a variable.

Oh sorry, i dont want to create a new one for the same problem :D
Thanks for the help, but i think i have made some mistakes. Can you create a example screenshot? This would be usefull. Here is my try.

Unbenannt3.PNG
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
@styx92 What effect are you after? A quick flash, or something else ... ?
 

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
39
First Language
German
Primarily Uses
I want to use it in battles. For example i fight by sunlight. Than the actor charge a skill an teleport the enemy in a dark forest than i want to change the tint to night and after the skill all should be like before. 
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
@styx92 This should work 

Code:
◆Show Choices:Change Tint, Reset Tint (Window, Right, #1, #2)
:When Change Tint 
  ◆Comment:// Copy Current Screen Tone to Variable
  ◆Script:$gameVariables.setValue(1, $gameScreen._tone.clone());
  ◆Comment:// Set New Screen Tone
  ◆Tint Screen:(-68,-68,0,68), 60 frames (Wait)
:When Reset Tint 
  ◆Comment:// Set Screen Tone to Saved Tone
  ◆Script:$gameScreen.startTint($gameVariables.value(1), 60);
:End
 
Last edited by a moderator:

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
39
First Language
German
Primarily Uses
Thanks, i will test it, if i'm at home :)
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@styx92  If you have any further questions/queries/difficulties, please post in MV.  As was pointed out to you, that is where it should be.  Anyone with MV who has a similar problem will never find your solution here in Ace. That is precisely why we have separate forums for different engines - the solutions are often different.
 

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
39
First Language
German
Primarily Uses
@Exhyra It works pretty! Many thanks!


@ksjp17 Aye, Sir!  :o I won't do it again. I'm sorry.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top