Changing tint back to what it was before?

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.
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)
Works perfectly, I had to change the last number from 1 to 15 to get it just right.


Thanks a bunch.
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.
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 🙂
@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.
Spoiler
@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 😀
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.

Spoiler
Unbenannt3.PNG
@styx92 What effect are you after? A quick flash, or something else ... ?
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. 
@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
Thanks, i will test it, if i'm at home 🙂
@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.
@Exhyra It works pretty! Many thanks!


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

Original thread: https://forums.rpgmakerweb.com/threads/changing-tint-back-to-what-it-was-before.65709/