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
> Changing an events hue? (RMXP had it), Is there a manual script call that can do this?
Titanhex
post Oct 18 2011, 11:38 PM
Post #1


Guru of Water
Group Icon

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




If you've ever used RMXP you will know one of it's features over RMVX was that it could tint events, allowing for a multitude of chars without many differently colored charsheets. Unfortunately this feature is void in RMVX.

Is there a way to change the tint of an event floating around somewhere in RMVX though?

This post has been edited by Titanhex: Oct 25 2011, 06:52 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Blacklight Sudio...
post Oct 19 2011, 04:32 PM
Post #2



Group Icon

Group: Member
Posts: 4
Type: None
RM Skill: Undisclosed




As in, is there a way to change the color palette of a sprite outside of changing it in other software? No, it's not possible to change the coloration of JUST one thing on the screen in any kind of editor feature(other than enemy graphics), Event command, or script call (that I know of). Besides, re-colorozing parts of a sprite in an image editor isn't all that difficult, IMO.
Go to the top of the page
 
+Quote Post
   
Zarby
post Oct 24 2011, 01:24 PM
Post #3



Group Icon

Group: Member
Posts: 2
Type: Scripter
RM Skill: Advanced




change_color(eventid,color)
@event_id for the current event
here a small video of what it look,
http://www.youtube.com/watch?v=NbCwI9gN2QQ

here the code :
code
CODE
#--------------------------------------------------
#in a event add a new script :              #
#change_color(eventid,color)             #
#to self event id use "@event_id"       #
#By Zarby, no credit needed                #
#--------------------------------------------------


class Game_Interpreter
  def change_color(eventid,color)
    $game_map.events[eventid].changecolor(color)
    end
end


class Spriteset_Map
  
  def create_characters
    @character_sprites = []
    for i in $game_map.events.keys.sort
      sprite = Sprite_Character.new(@viewport1, $game_map.events[i],$game_map.events[i].color)
      @character_sprites.push(sprite)
    end
    for vehicle in $game_map.vehicles
      sprite = Sprite_Character.new(@viewport1, vehicle)
      @character_sprites.push(sprite)
    end
    @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  end
  
end

class Sprite_Character < Sprite_Base
  
  
    def initialize(viewport, character = nil,color = 0)
    super(viewport)
    @character = character
    @balloon_duration = 0
    @color = color
    update
  end
  
  
  def update_bitmap
    if @tile_id != @character.tile_id or
       @character_name != @character.character_name or
       @character_index != @character.character_index
      @tile_id = @character.tile_id
      @character_name = @character.character_name
      @character_index = @character.character_index
      if @tile_id > 0
        sx = (@tile_id / 128 % 2 * 8 + @tile_id % 8) * 32;
        sy = @tile_id % 256 / 8 % 16 * 32;
        self.bitmap = tileset_bitmap(@tile_id)
        self.src_rect.set(sx, sy, 32, 32)
        self.ox = 16
        self.oy = 32
      else
        self.bitmap = @character.bitmap
        sign = @character_name[/^[\!\$]./]

          @cw = self.bitmap.width / 3
          @ch = self.bitmap.height / 4
        self.ox = @cw / 2
        self.oy = @ch
     end
    end
    if @character.color != @character.oldcolor
    self.bitmap.hue_change(@character.color)
    @character.oldcolor = @character.color
      end
  end

  
  def update_src_rect
    if @tile_id == 0
      index = 0
      pattern = @character.pattern < 3 ? @character.pattern : 1
      sx = (index % 4 * 3 + pattern) * @cw
      sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch
      self.src_rect.set(sx, sy, @cw, @ch)
    end
  end
end


class Game_Player < Game_Character

  def refresh
    if $game_party.members.size == 0
      @character_name = ""
      @character_index = 0
    else
      actor = $game_party.members[0]   # Get front actor
      @character_name = actor.character_name
      @character_index = actor.character_index
      set_graphic(@character_name,@character_index)
    end
  end

end


class Game_Event < Game_Character


def setup(new_page)
    @page = new_page
    if @page == nil
      @tile_id = 0
      @character_name = ""
      @character_index = 0
      @move_type = 0
      @through = true
      @trigger = nil
      @list = nil
      @interpreter = nil
    else
      @tile_id = @page.graphic.tile_id
      @character_name = @page.graphic.character_name
      @character_index = @page.graphic.character_index
      if @tile_id == 0
      set_graphic(@character_name,@character_index)
      end
      if @original_direction != @page.graphic.direction
        @direction = @page.graphic.direction
        @original_direction = @direction
        @prelock_direction = 0
      end
      if @original_pattern != @page.graphic.pattern
        @pattern = @page.graphic.pattern
        @original_pattern = @pattern
      end
      @move_type = @page.move_type
      @move_speed = @page.move_speed
      @move_frequency = @page.move_frequency
      @move_route = @page.move_route
      @move_route_index = 0
      @move_route_forcing = false
      @walk_anime = @page.walk_anime
      @step_anime = @page.step_anime
      @direction_fix = @page.direction_fix
      @through = @page.through
      @priority_type = @page.priority_type
      @trigger = @page.trigger
      @list = @page.list
      @interpreter = nil
      if @trigger == 4                       # Trigger is [Parallel Process]?
        @interpreter = Game_Interpreter.new  # For parallel processing
      end
    end
    update_bush_depth
    
  end
  
  end




class Game_Character
  attr_accessor  :color
  attr_accessor  :oldcolor
  attr_accessor  :bitmap
    def initialize
    @id = 0
    @x = 0
    @y = 0
    @real_x = 0
    @real_y = 0
    @tile_id = 0
    @character_name = ""
    @character_index = 0
    @opacity = 255
    @blend_type = 0
    @direction = 2
    @pattern = 1
    @move_route_forcing = false
    @priority_type = 1
    @through = false
    @bush_depth = 0
    @animation_id = 0
    @balloon_id = 0
    @transparent = false
    @original_direction = 2               # Original direction
    @original_pattern = 1                 # Original pattern
    @move_type = 0                        # Movement type
    @move_speed = 4                       # Movement speed
    @move_frequency = 6                   # Movement frequency
    @move_route = nil                     # Move route
    @move_route_index = 0                 # Move route index
    @original_move_route = nil            # Original move route
    @original_move_route_index = 0        # Original move route index
    @walk_anime = true                    # Walking animation
    @step_anime = false                   # Stepping animation
    @direction_fix = false                # Fixed direction
    @anime_count = 0                      # Animation count
    @stop_count = 0                       # Stop count
    @jump_count = 0                       # Jump count
    @jump_peak = 0                        # Jump peak count
    @wait_count = 0                       # Wait count
    @locked = false                       # Locked flag
    @prelock_direction = 0                # Direction before lock
    @move_failed = false                  # Movement failed flag
    @color = 0
    @oldcolor = 0
    @bitmap = Bitmap.new(96,128)
  end
  
    def set_graphic(character_name, character_index)
    @tile_id = 0
    @character_name = character_name
    @character_index = character_index
    frombitmap = Cache.character(@character_name)
    
    @bitmap.clear
      if @character_name.include?('!')
    if @character_index <= 3
      ch = frombitmap.height/2
      @bitmap = Bitmap.new(96,ch)
    @bitmap.blt(0,0,frombitmap,Rect.new(@character_index*96,0,96,ch))
    
    end
      if @character_index > 3
        ch = frombitmap.height/2
        @ci = @character_index-4
        @bitmap = Bitmap.new(96,ch)
    @bitmap.blt(0,0,frombitmap,Rect.new(@ci*96,ch,96,ch))
    end
    end
    if @character_name.include?('$')
      @bitmap.clear
      @bitmap = Bitmap.new(frombitmap.width,frombitmap.height)
     @bitmap.blt(0,0,frombitmap,Rect.new(0,0,frombitmap.width,frombitmap.height))
   end
   if @character_name.include?('$') == false and @character_name.include?('!') == false
    @bitmap.clear
    if @character_index <= 3
    @bitmap.blt(0,0,frombitmap,Rect.new(@character_index*96,0,96,128))
    end
      if @character_index > 3
        @ci = @character_index-4
    @bitmap.blt(0,0,frombitmap,Rect.new(@ci*96,128,96,128))
  end
  end
  @bitmap.hue_change(@color)
  end
  
  
    def changecolor(color)
  @color = color
  refresh
end

end
Go to the top of the page
 
+Quote Post
   
Titanhex
post Oct 25 2011, 06:51 AM
Post #4


Guru of Water
Group Icon

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




Thanks Zarby.

To be more specific, it's the hue that I actually was interested in changing. If you pop open your RMVX, open the database (F9), and go to the enemies tab, try changing the enemies picture. You'll see a hue slider that lets you alter the hue.

While I understand that there can be no GUI, the hue is probably represented by an integer.. Being able to change that hue integer for an event would be very useful.

While changing an event's hue is as easy as downloading GIMP and using the color tool, the access to new hues could be very useful in lowering picture space.

This post has been edited by Titanhex: Oct 25 2011, 06:54 AM


__________________________
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: 20th May 2013 - 01:06 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker