Jump to content
Sign in to follow this  
TheYungVxAce

Victor Visual Equipment color change in-game

Recommended Posts

H​I. I am currently using the Visual Equipment by Victor. I made a character creation scene through events and the hair is used as a type of equipment for the head so players can choose a variety of hair styles. Is it possible if someone can make a script or snippet that enables players to change the hue/brightness of the specific equipment sprites (or in my case, the hair) in-game?

 

Here is the link to the script

 

 

Edited by TheYungVxAce

Share this post


Link to post
Share on other sites

Hmm i think its allready implemented...

Look at the code, i have found this:

 

#--------------------------------------------------------------------------
# * New method: get_bitmap
#--------------------------------------------------------------------------
def get_bitmap(filename, part, sufix)
  base = part[:name] =~ /^[!]?[$](.*)/i ? $1 : part[:name]
  char = filename + base
  pose = part[:name] + sufix
  file = filename + base + sufix
  name = character_exist?(char) ? char : part[:name]
  name = character_exist?(pose) ? pose : name
  name = character_exist?(file) ? file : name
  bmp = ["Graphics/Characters/", name, part[:hue]]                            <------------ This line!
  [load_bitmap(*bmp).clone, name] rescue [empty_bitmap, name]
end

 

so there should be a way to change the hue somehow, is there nothing about it in the header?

Edited by buddysievers

Share this post


Link to post
Share on other sites

Hmm i think its allready implemented...

Look at the code, i have found this:

 

#--------------------------------------------------------------------------

# * New method: get_bitmap

#--------------------------------------------------------------------------

def get_bitmap(filename, part, sufix)

  base = part[:name] =~ /^[!]?[$](.*)/i ? $1 : part[:name]

  char = filename + base

  pose = part[:name] + sufix

  file = filename + base + sufix

  name = character_exist?(char) ? char : part[:name]

  name = character_exist?(pose) ? pose : name

  name = character_exist?(file) ? file : name

  bmp = ["Graphics/Characters/", name, part[:hue]]                            <------------ This line!

  [load_bitmap(*bmp).clone, name] rescue [empty_bitmap, name]

end

 

so there should be a way to change the hue somehow, is there nothing about it in the header?

 

I'm sorry. I forgot to add in-game. I also looked through the script again, but couldn't find a way to give players the options of change hues in-game.

Share this post


Link to post
Share on other sites

can you send me a demo or a screenshot of you event,it would help me find a solution

Share this post


Link to post
Share on other sites

If the character creation scene is throgh events, why not use a conditional branch to add different part. You can crate several parts with different hur. But once a part is created, you can't change it's hue without editing the script.

Share this post


Link to post
Share on other sites

can you send me a demo or a screenshot of you event,it would help me find a solution

 

I have screenshots attached since I couldn't get them to show up.

 

If the character creation scene is throgh events, why not use a conditional branch to add different part. You can crate several parts with different hur. But once a part is created, you can't change it's hue without editing the script.

 

I see. That was the the original plan, but then I thought about the space and the amount of styles I'm including.

bandicam 2016-01-27 22-36-58-750.bmp

bandicam 2016-01-27 22-37-01-157.bmp

bandicam 2016-01-27 22-37-03-830.bmp

Share this post


Link to post
Share on other sites

 

I see. That was the the original plan, but then I thought about the space and the amount of styles I'm including.

Anyway you won't be able to change that. To improve performance, instead of several independent part, the plugin creates a singe bitmap.

When the part is added, it's melded into the original bitmap and is no longer a separated part. 

Share this post


Link to post
Share on other sites

I'm not sure it will work but try this

class Game_Actor < Game_Battler
  
  
  def change_hue_part(name,hue)
    clear_visual_parts
    regexp = get_all_values("VISUAL PART")
    note.scan(regexp) { set_visual_parts_hue($1,name,hue) }
    self.class.note.scan(regexp) { set_visual_parts_hue($1,name,hue) }
    
  end
  
  def set_visual_parts_hue(info,name,hue)
    info = check_hue_part(info,name,hue)
    @visual_parts.push(info)
    
  end
  
  
  def check_hue_part(info,name,hue)
   
    a=(info =~ /NAME: #{get_filename}/i ? $1.to_s : "")
    
    if a==name
      string=sprintf("hue %i",hue)
      info.gsub!(/hue: \d+/,string)
     
    end
    return info
  end
  
end

Put the script below Victor's one and above main

you use the command $game_party.members.change_hue_part(name,hue)
(if it's too long for the script box split it in 2 lines eric= $game_party.members and eric.change_hue_part(name,hue) )

 

where 

i is the number of your party member you want to change

name is the name of the part you want to change the hue (same as what you put in the notebox for the visual part)

hue is the value of the new hue

 

Also make sure to have an hue defined in the first place (even if it's 0) in your notebox.

If it doesn't work can you send me screenshots of your noteboxes pls.

Share this post


Link to post
Share on other sites

I'm not sure it will work but try this

class Game_Actor < Game_Battler
  
  
  def change_hue_part(name,hue)
    clear_visual_parts
    regexp = get_all_values("VISUAL PART")
    note.scan(regexp) { set_visual_parts_hue($1,name,hue) }
    self.class.note.scan(regexp) { set_visual_parts_hue($1,name,hue) }
    
  end
  
  def set_visual_parts_hue(info,name,hue)
    info = check_hue_part(info,name,hue)
    @visual_parts.push(info)
    
  end
  
  
  def check_hue_part(info,name,hue)
   
    a=(info =~ /NAME: #{get_filename}/i ? $1.to_s : "")
    
    if a==name
      string=sprintf("hue %i",hue)
      info.gsub!(/hue: \d+/,string)
     
    end
    return info
  end
  
end

Put the script below Victor's one and above main

you use the command $game_party.members.change_hue_part(name,hue)

(if it's too long for the script box split it in 2 lines eric= $game_party.members and eric.change_hue_part(name,hue) )

 

where 

i is the number of your party member you want to change

name is the name of the part you want to change the hue (same as what you put in the notebox for the visual part)

hue is the value of the new hue

 

Also make sure to have an hue defined in the first place (even if it's 0) in your notebox.

If it doesn't work can you send me screenshots of your noteboxes pls.

 

It doesn't work. I get this error.

 

 

 

oppwet.jpg

 

 

 

This is what I had down. I tried them separately and before and after I equip the part.

 

 

 

98al1y.jpg

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×