Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Bob423

Change color of changed stats on equipment screen.

Recommended Posts

so what i'm going to show you how to do, is this

 

HBqR9.png

ignore the window sizes and arrangements. focus on the numbers that are green and red

 

when you select equipment on this screen, it shows the stat changes right?

but if you ever want to make it easier to see the difference in the stats, here's how you do it.

 

first, you need to go to window_base, and find this

def normal_color
return Color.new(255, 255, 255, 255)
end

 

this should be number 64 or something.

 

what it does, is, it tells the game what to do if the script says

self.contents.font.color = normal_color

 

which changes the color to the default white.

 

this color can be changed by changing the 4 numbers that come after Color.new

 

(255, 255, 255, 255)

 

this means solid white. if any of these is less than 0, or greater than 255, then it won't work.

each number represents something different.

 

(Red, Green, Blue, brightness)

 

0 brightness will make anything black, but 255 brightness won't make it white.

to make solid green text, you would set it to (0, 255, 0, 255)

to make black text, you set it to all 0

if you combine Red and Green, you'll get yellow

if you combine red and blue, you get purple.

 

simple enough?

if you're not sure how to make the color you want, you can try this http://www.colorpicker.com/

on there, from top to bottom(ignore the first 2) is Brightness, Red, Green, Blue.

 

to add a new color, type

def your_color_name_here
return Color.new(R, G, B, B)
end

after all the other colors.

 

once you've done that, go to Window_EquipLeft and find this line

if @new_atk != nil

self.contents.font.color = system_color

self.contents.draw_text(160, 64, 40, 228, "->", 1)
self.contents.font.color = normal_color

 

what you need to do, is change the line that ends in normal_color

 

delete it, add a comment above and below where it was if it helps (commented lines start with #)

 

now, we need an if statement. this is like a conditional branch in eventing. if this is true, this happens, if not, this does.

 

here's what i did


if @new_atk > @actor.atk
then self.contents.font.color = stat_up_color
elsif @new_atk < @actor.atk
then self.contents.font.color = stat_down_color
elsif @new_atk == @actor.atk
then self.contents.font.color = normal_color
end

 

that means:

 

 

if the actor's atk, after equiping this item will be greater than it is now,

then change the color to the stat up color

 

if the actor's atk, after equping this item will be less than it is now,

then change the color to the stat down color

 

if the actor's atk, after equping this item will be equal to what it is now,

then change the color to the normal color

 

end if statement

 

 

 

replace all the lines between 31 and 43 that say "self.contents.font.color = normal_color" with the above code (or similar), but replace the atk with the name of the sat.

e.g if it says "if @new_pdef != nil

" change the atk to pdef (defense stat)

 

does that make sense?

Edited by Bob423

Share this post


Link to post
Share on other sites

This is great, but I'm afraid of screwing something up in the base game files. Would it be possible to put this in a stand alone script?

Share this post


Link to post
Share on other sites

i have no idea. I guess I could try.

 

edit: i did it! :D

 

 



# this will Change color of changed stats on the equipment screen.  

class Window_EquipLeft < Window_Base

 # new colors. (Red, Green, Blue, Brightness)
 #===================================#
 # This is where you edit the colors #
 #===================================#

 # get stat increase color
 def stat_up_color
   # (Red, Green, Blue, Brightness) all numbers must be between 0 and 255
   return Color.new(0, 255, 0, 255)
 end

 # get stat decrease color
 def stat_down_color
   # (Red, Green, Blue, Brightness) all numbers must be between 0 and 255
   return Color.new(255, 0, 0, 255)
 end

#==============================================================================#
# this part completely replaces the def refresh in Window_EquipLeft            #
#==============================================================================#

 def refresh
   self.contents.clear
   draw_actor_name(@actor, 4, 0)
   draw_actor_level(@actor, 4, 32)
   draw_actor_parameter(@actor, 4, 64, 0)
   draw_actor_parameter(@actor, 4, 96, 1)
   draw_actor_parameter(@actor, 4, 128, 2)
   if @new_atk != nil
     self.contents.font.color = system_color
     self.contents.draw_text(160, 64, 40, 32, "->", 1)

     # change the color of the number
   if @new_atk > @actor.atk
     then self.contents.font.color = stat_up_color
   elsif @new_atk < @actor.atk
     then self.contents.font.color = stat_down_color
   elsif @new_atk == @actor.atk
     then self.contents.font.color = normal_color
   end
   #

     self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
   end
   if @new_pdef != nil
     self.contents.font.color = system_color
     self.contents.draw_text(160, 96, 40, 32, "->", 1)

     # change the color of the number
   if @new_pdef > @actor.pdef
     then self.contents.font.color = stat_up_color
   elsif @new_pdef < @actor.pdef
     then self.contents.font.color = stat_down_color
   elsif @new_pdef == @actor.pdef
     then self.contents.font.color = normal_color
   end
   #

     self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
   end
   if @new_mdef != nil
     self.contents.font.color = system_color
     self.contents.draw_text(160, 128, 40, 32, "->", 1)

     # change the color of the number
   if @new_mdef > @actor.mdef
     then self.contents.font.color = stat_up_color
   elsif @new_mdef < @actor.mdef
     then self.contents.font.color = stat_down_color
   elsif @new_mdef == @actor.mdef
     then self.contents.font.color = normal_color
   end
   #

     self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
   end
 end
end

 

 

 

just put it above main like all other scripts.

Edited by Bob423

Share this post


Link to post
Share on other sites
Can I post it on another site with your tutorial link and your name?

 

Next time please private message the user instead of necroposting ok? :ok:

Share this post


Link to post
Share on other sites
go ahead

Oh, Thank you

 

Next time please private message the user instead of necroposting ok? :ok:

Ok, So sorry about it :wave:

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...