"Suffix Script" for Sprites

Robert-Character Creator

Waiting for Replies
Veteran
Joined
Feb 8, 2014
Messages
518
Reaction score
223
First Language
English
Primarily Uses
RMVXA
Hi! One of the features in my game, that of an idle animation, works by changing the character's sprite. The name changes from "Filename" to "Filename[Idle]", However, I have other features that change the sprite, so these will naturally conflict with one another. I could solve this with an unholy amount of conditional branches due to the number of possibilities, or...

A script allowing me to call "Add suffix [Suffix] would allow me to change an event or characters sprite to "'Current Sprite Name'+[Suffix]". For example, "P11_R_[f8][Walk][Rain]" would become "P11_R_[f8][Walk][Rain][Blink]". This would allow for better implementation of differently clothed, rained-on, damaged, and blinking sprites. Preferably, making the order of the [#]s not matter as well would be important. Also, it would be helpful if there would be no difference to the script between "[f8][Walk][Rain][Blink].png" and "[f8][Walk][Blink][Rain].png", if you know what I mean.

Thank you in advance for any help with this odd request.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
You have to have a context on this matter. Is this map sprites? what scripts you're already in use?
 

Robert-Character Creator

Waiting for Replies
Veteran
Joined
Feb 8, 2014
Messages
518
Reaction score
223
First Language
English
Primarily Uses
RMVXA
It would be for character sprites, for the player specifically. I have many, many, scripts. Should I list & link all of them?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Not necessarily all, only the one that is affecting the map sprites.
 

Robert-Character Creator

Waiting for Replies
Veteran
Joined
Feb 8, 2014
Messages
518
Reaction score
223
First Language
English
Primarily Uses
RMVXA
I'm using:
Zeus 81's Map Effects
Galv's Character Effects
GaryCXJk's Free Movement (links are down?)
Victor's Multi-Frame Sprites
Victor's Diagonal Movement
Victor's Character Control
Vlue's Fine Tuning Script
Another Fen's Diagonal Movement and Multiframes Patch (Only I have it)
Another Fen's Eventing Fine Tuning Patch for the previous Patch (Only I have it)

I'll post the patches here.

Code:
#=============================================================================
#
#  Compatibility Patch for Galv's Character Effects and
#    Victor Sant's Multiframes and Diagonal Movement
#  Version 0.1 (28th June, 2018)
#  By Another Fen <forums.rpgmakerweb.com>
#
#  (Consists in large parts of code copied from the aforementioned scripts)
#
# Contents: ------------------------------------------------------------------
#  This Script modifies the Sprite part of Galv's Character Effects to make
#  them compatible to Victor Sant's Multiframes and Diagonal Movement.
#
# Usage: ---------------------------------------------------------------------
#  Requires Victor Sant's Multiframes (1.03) and Diagonal Movement (1.09)
#  Should be placed below Galv's Character Effects (2.1).
#
#=============================================================================

#=============================================================================
#  Sprite_Character
#=============================================================================
class Sprite_Character
 
  #---------------------------------------------------------------------------
  # Sprite_Character#update_src_rect  (Modified)
  #   Extracted character index. Includes Multiframes / Diagonal Movement.
  #---------------------------------------------------------------------------
  def update_src_rect
    if @tile_id == 0
      index = character_index
      sx = (index % 4 * horizontal_frames + pattern_index) * @cw
      sy = (index / 4 * vertical_frames + direction_index) * @ch
      self.src_rect.set(sx, sy, @cw, @ch)
    end
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Character#character_index
  #   Displayed character set index.
  #---------------------------------------------------------------------------
  def character_index
    @character.character_index
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Character#horizontal_frames
  #   Number of horizontal frames per character set
  #---------------------------------------------------------------------------
  def horizontal_frames
    @character_name[/\[F(\d+)\]/i] ? @character.frames : 3
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Character#vertical_frames
  #   Number of vertical frames per character set
  #---------------------------------------------------------------------------
  def vertical_frames
    4
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Character#pattern_index
  #   Displayed character pattern index
  #---------------------------------------------------------------------------
  def pattern_index
    pattern = @character.pattern
    return (pattern < 3 || @character_name[/\[F(\d+)\]/i]) ? pattern : 1
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Character#direction_index
  #   Displayed character direction index
  #---------------------------------------------------------------------------
  def direction_index
    if @character.diagonal?
      return { 1 => 0, 7 => 1, 3 => 2, 9 => 3 }[@diagonal]
    else
      return (@character.direction - 2) / 2
    end
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Character#extended_bitmap_name
  #   Extended alternate bitmap names for subclasses (see Diagonal Movement)
  #---------------------------------------------------------------------------
  def extended_bitmap_name(name)
    extended_name = name + ($imported[:ve_visual_equip] ? "" : diagonal_sufix)
    return character_exist?(extended_name) ? extended_name : name
  end
end


#=============================================================================
#  Sprite_Reflect
#=============================================================================
class Sprite_Reflect
 
  #---------------------------------------------------------------------------
  # Sprite_Reflect#set_character_bitmap  (Modified)
  #   Moved changes to other methods designated by the VE Basic Module.
  #---------------------------------------------------------------------------
  def set_character_bitmap
    super
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Reflect#set_bitmap_name  (Overridden)
  #   See Sprite_Reflect#set_character_bitmap
  #---------------------------------------------------------------------------
    def set_bitmap_name
    reflect = @character.reflect_sprite
    return (reflect) ? extended_bitmap_name(reflect[0]) : super
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Reflect#set_bitmap_position  (Overridden)
  #   See Sprite_Reflect#set_character_bitmap
  #---------------------------------------------------------------------------
  def set_bitmap_position
    self.mirror = true
    self.angle = 180
    self.opacity = 220
    self.z = Galv_CEffects::REFLECT_Z
    self.wave_amp = $game_map.reflect_options[0]
    super
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Reflect#character_index  (Overridden)
  #   Specify reflection character index
  #---------------------------------------------------------------------------
  def character_index
    @character.reflect_sprite ? @character.reflect_sprite[1] : super
  end
end


#=============================================================================
#  Sprite_Mirror
#=============================================================================
class Sprite_Mirror
 
  #---------------------------------------------------------------------------
  # Sprite_Mirror#set_character_bitmap  (Modified)
  #   Move changes to methods designated by the VE basic module
  #---------------------------------------------------------------------------
  def set_character_bitmap
    super
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Mirror#set_bitmap_name  (Overridden)
  #   See Sprite_Mirror#set_character_bitmap
  #---------------------------------------------------------------------------
  def set_bitmap_name
    reflect = @character.reflect_sprite
    return (reflect) ? extended_bitmap_name(reflect[0]) : super
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Mirror#set_bitmap_position  (Overridden)
  #   See Sprite_Mirror#set_character_bitmap
  #---------------------------------------------------------------------------
  def set_bitmap_position
    self.mirror = true
    self.opacity = 255
    self.z = Galv_CEffects::REFLECT_Z
    super
  end

  #---------------------------------------------------------------------------
  # Sprite_Mirror#character_index  (Overridden)
  #   Specify reflection character index
  #---------------------------------------------------------------------------
  def character_index
    @character.reflect_sprite ? @character.reflect_sprite[1] : super
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Mirror#direction_index  (Overridden)
  #   Mirror direction
  #---------------------------------------------------------------------------
  def direction_index
    return vertical_frames - 1 - super
  end
end


#=============================================================================
#  Sprite_Shadow
#=============================================================================
class Sprite_Shadow < Sprite_Character

  #---------------------------------------------------------------------------
  # Sprite_Shadow#set_character_bitmap  (Modified)
  #   Move changes to methods designated by the VE basic module
  #---------------------------------------------------------------------------
  def set_character_bitmap
    super
  end
 
  #---------------------------------------------------------------------------
  # Sprite_Shadow#set_bitmap_position  (Overridden)
  #   See Sprite_Mirror#set_character_bitmap
  #---------------------------------------------------------------------------
  def set_bitmap_position
    self.color = Color.new(0, 0, 0, 255)
    self.z = Galv_CEffects::SHADOW_Z
    self.wave_amp = 1 if $game_map.shadow_options[2]
    self.wave_speed = 1000
    super
  end
end

Code:
class Sprite_Shadow
 
  #---------------------------------------------------------------------------
  # Sprite_Shadow#blend_update  (Overridden)
  #   Remove the color change introduced by Vlue's Eventing Fine Tuning
  #---------------------------------------------------------------------------
  def blend_update
  end
end
 

Robert-Character Creator

Waiting for Replies
Veteran
Joined
Feb 8, 2014
Messages
518
Reaction score
223
First Language
English
Primarily Uses
RMVXA
Hey everyone! We've reached the tenth consecutive bump! It's time to celebrate! Break out the party hats and fizzy soda, we're going to have a great time! I even brought my favorite party game, the waiting game! ;)

No but seriously, may need to commission this one as well once I start getting paid. This is taking a very long time.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top