Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Script code for tinting pictures from within Game_Map, Seems like a simple, easy question
Titanhex
post Jan 16 2012, 10:43 PM
Post #1


Guru of Water
Group Icon

Group: Revolutionary
Posts: 1,096
Type: None
RM Skill: Masterful
Rev Points: 5




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


__________________________
Go to the top of the page
 
+Quote Post
   
Kread-EX
post Jan 16 2012, 11:02 PM
Post #2


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




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.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
Titanhex
post Jan 16 2012, 11:08 PM
Post #3


Guru of Water
Group Icon

Group: Revolutionary
Posts: 1,096
Type: None
RM Skill: Masterful
Rev Points: 5




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


__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 17th June 2013 - 09:25 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker