Window Base - Replace/Alter Actor HP colors

Legion

Villager
Member
Joined
Jul 10, 2013
Messages
11
Reaction score
0
First Language
English
Primarily Uses
So I've got an idea for a game, but I need a custom scriptlet to make some alterations to the default engine.

I'm working with Window_Base primarily, but I'm using some bits I learned from how it's written in Zetu's Alternate MP X script.

This is the tidbit I found in the Zetu script.

class Window_Base < Window #-------------------------------------------------------------------------- # * New method: draw_actor_ampx #-------------------------------------------------------------------------- def draw_actor_ampx(resource, x, y, width) color1, color2 = resource.params[:color] draw_gauge(x, y, width, resource.rate, text_color(color1), text_color(color2)) change_color(text_color(color2)) draw_text(x, y, 30, line_height, resource.params[:abbv][0]) draw_current_and_max_values(x, y, width, resource.value, resource.max, mp_color(resource.battler), normal_color) end #-------------------------------------------------------------------------- # * Overwrite method: draw_actor_mp #-------------------------------------------------------------------------- def draw_actor_mp(actor, x, y, width=124) if actor.resources.nil? actor.setup(actor.id) end width /= actor.resources.size offset = width if actor.resources.size != 1 offset += 2 width -= 1 end for i in 0...actor.resources.size draw_actor_ampx(actor.resources, x+offset*i, y, width) end end endSo going from there and the plans I have, I need a script that looks like this:

class Window_Base < Window #--------------------------------------------------- # * New HP Colors #--------------------------------------------------- def hp_gauge_color3; text_color(20); end; # HP gauge 3 def hp_gauge_color4; text_color(21); end; # HP gauge 4 def hp_gauge_color5; text_color(20); end; # HP gauge 1 def hp_gauge_color6; text_color(21); end; # HP gauge 2 #-------------------------------------------------------------------------- # * Overwrite method: draw_actor_mp #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 124) if actor_id == 1 draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color3, hp_gauge_color4) change_color(system_color) draw_text(x, y, 30, line_height, Vocab::hp_a) draw_current_and_max_values(x, y, width, actor.hp, actor.mhp, hp_color(actor), normal_color) elseif actor_id == 2 draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color5, hp_gauge_color6) change_color(system_color) draw_text(x, y, 30, line_height, Vocab::hp_a) draw_current_and_max_values(x, y, width, actor.hp, actor.mhp, hp_color(actor), normal_color) else draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2) change_color(system_color) draw_text(x, y, 30, line_height, Vocab::hp_a) draw_current_and_max_values(x, y, width, actor.hp, actor.mhp, hp_color(actor), normal_color) end endI think I'm fairly close to what I wanted, but I'm not sure what else it might need. Can someone help?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
It uses the colours in the windowskin. Figure out which squares have the colours of the current text (or what they were with the script before you started tinkering with it), then just repaint those squares with the colours you want it to use.
 

Legion

Villager
Member
Joined
Jul 10, 2013
Messages
11
Reaction score
0
First Language
English
Primarily Uses
I know to use the System colors to describe the colors used.

What I'm trying to do is have a different set of colors used based on the actor ID.

I'm trying to modify the Yanfly Core Engine script, because it already recolors them. So in default it is gold/orange for HP, but in Yanfly it's a dark green/light green.

So in essence, it should look like this, at least I think so.

if actor_id is 1

draw hp using gauge 3 and gauge 4

elsif actor_id is 2

draw hp using gauge 5 and gauge 6

else

draw hp using the default gauge 1 and gauge 2.

This is the code taken from the Yanfly Core script. The draw gauge pieces were how they were written by default. I just need to know how to add in the if and elseif lines.

Code:
  #--------------------------------------------------------------------------  # * Overwrite method: draw_actor_hp  #--------------------------------------------------------------------------  def draw_actor_hp(actor, x, y, width = 124)    if actor_id == 1          draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color3, hp_gauge_color4)          change_color(system_color)          draw_text(x, y, 30, line_height, "Blood")          draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,           hp_color(actor), normal_color)    elsif actor_id == 2          draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color5, hp_gauge_color6)          change_color(system_color)          draw_text(x, y, 30, line_height, "Spirit")          draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,           hp_color(actor), normal_color)    else          draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)          change_color(system_color)          draw_text(x, y, 30, line_height, Vocab::hp_a)          draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,           hp_color(actor), normal_color)    end   end
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top