Changing tint back to what it was before?

Discussion in 'RPG Maker VX Ace' started by gambles, Jul 22, 2016.

    Tags:
  1. gambles

    gambles Villager Member

    Messages:
    7
    Likes Received:
    0
    First Language:
    English
    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.
     
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,579
    Likes Received:
    11,299
    Location:
    Australia
    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)
     
    #2
    styx92 and gambles like this.
  3. gambles

    gambles Villager Member

    Messages:
    7
    Likes Received:
    0
    First Language:
    English
    Works perfectly, I had to change the last number from 1 to 15 to get it just right.


    Thanks a bunch.
     
    #3
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,579
    Likes Received:
    11,299
    Location:
    Australia
    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.
     
    #4
    styx92 likes this.
  5. styx92

    styx92 Veteran Veteran

    Messages:
    310
    Likes Received:
    38
    First Language:
    German
    Hey Shaz, do you know the same commands for MV ?
    This would be awesome :)
     
    #5
  6. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    725
    Likes Received:
    530
    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: Sep 6, 2016
    #6
    styx92 likes this.
  7. styx92

    styx92 Veteran Veteran

    Messages:
    310
    Likes Received:
    38
    First Language:
    German

    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
     
    #7
  8. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    725
    Likes Received:
    530
    First Language:
    English
    Primarily Uses:
    RMMV
    @styx92 What effect are you after? A quick flash, or something else ... ?
     
    #8
  9. styx92

    styx92 Veteran Veteran

    Messages:
    310
    Likes Received:
    38
    First Language:
    German
    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. 
     
    #9
  10. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    725
    Likes Received:
    530
    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: Sep 6, 2016
    #10
    styx92 likes this.
  11. styx92

    styx92 Veteran Veteran

    Messages:
    310
    Likes Received:
    38
    First Language:
    German
    Thanks, i will test it, if i'm at home :)
     
    #11
  12. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,598
    Likes Received:
    10,511
    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.
     
    #12
  13. styx92

    styx92 Veteran Veteran

    Messages:
    310
    Likes Received:
    38
    First Language:
    German
    @Exhyra It works pretty! Many thanks!


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

Share This Page