Help - Search - Members - Calendar
Full Version: Script code for tinting pictures from within Game_Map
RPG RPG Revolution Forums > Scripting > Script Development and Support
Titanhex
I am using a rather big script (RATS) for my time system, so that I can have a window, seasons, screen tinting and years displayed. I plan on putting the tint picture script in with the tint screen stuff so it works with parallaxing, but I don't know the code to tint pictures loaded through Show Picture from the Game_Map (Game_Map is where the screen tinting is called from). I'm sure I'll figure out how to do it through the interpreter at least, but it'll probably take me some time. I'm hoping someone who already knows can provide that answer for me.

I'll pretty much be inserting it here:
CODE
class Game_Map
  include Rafidelis::Advanced_Time_System

  def update_rats_map_tone
    if name.include?(Interior_Map_Name_Symbol)
      tone_set(Tone.new(0,0,0,0))
      return
    end
    if $rats.in_early_morning?
       tone = Early_Morning_Tone
    elsif $rats.in_morning?
      tone = Morning_Tone
    elsif $rats.in_afternoon?
      tone = Afternoon_Tone
    elsif $rats.in_evening?
      tone = Evening_Tone
    elsif $rats.in_night?
      tone = Night_Tone
    elsif $rats.in_earliness?
      tone = Earliness_Tone
    else
      tone = Tone.new(0,0,0,0)
    end
    tone_set(tone)
    end
Kread-EX
This can be a bit annoying to do. The current game screen is stored in $game_map, so to access a picture, you have to type this:
CODE
$game_map.screen.pictures[i]

i must be between 0 and 20 (though 0 isn't used in the editor).
Now, to tint it, there is the start_tone_change method. It takes two arguments, the tone and the duration. The tone is really just a Tone object, so you'll have to create it beforehand.
For instance:
CODE
$game_map.screen.pictures[1].start_tone_change(Tone.new(0,0,0,255), 40)

Will make the 1st picture turn grey in 40 frames.
Titanhex
Ah alright. Makes sense.

It's good to have an actual scripter on the staff too. I've not gotten this same question answered on another board for the last 2 days. Finally took a break from art and eventing to look how to do this just now as you were writing your reply.

Since I'm running this from Game_Map anyways I just did @screen.

For whatever reason it doesn't tint. (no error though)

So I'm still working on that part.

Ah it was @screen. Needs to be $game_map even in Game_Map. lol

Thanks much Kread :3
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.