Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Rearranging presentation of charasets.

Yo!

Someone was able to do this for me some time ago, however I have lost the file in which I kept the little script (Much apologies to whoever you were, and I'm so sorry I can't remember your name, I think you were or are one of the support staff, but I died in between times so give me a break. ;)) and was wondering if someone would mind... er... doing it again for me?

Basically, I just want to be able to alternate between regular characterset presentation, as within the XP RTP - the one which has been standard for years with the following:

http://img181.imageshack.us/img181/11/exampleig9.png[/img]

Not permanently, and with a global command, rather than an individual change for each event's graphic.

Thanks ever so in advance!
 
okay....this SHOULD be a simple edit...I'll see what I can do
EDIT: Okay, I've got it all working correctly now. Just one thing...did you want this to work only for the character? or also for events?
If you want it to only work for the character, it'll take a bit longer, since I need to figure out how it separates the 2
 
For the characters and the events actually - presuming by events you also mean other people one can have in the area. So... you've... done it?

Wow.

Are you the kind of scripting deity who likes the heart of live goats in a ritual sacrifice, or will you be happy with lots of thank yous and credit? :P
 
hmmm....goat hearts may be tempting...but credit will do.
Just paste this in a script above main, should not cause incompatibilities unless you have something rewriting you Sprite_character class (which I doubt)
Code:
class Sprite_Character
  alias update_sprite_character_first update
  def update
    update_sprite_character_first
    if $game_system.spritesheet
      unless @tile_id >= 384
        self.bitmap = RPG::Cache.character(@character.character_name,
          @character.character_hue)
        @cw = bitmap.width / 4
        @ch = bitmap.height / 2
        self.ox = @cw / 2
        self.oy = @ch
      end
      if @tile_id == 0
        # Set rectangular transfer
        sy = @character.pattern % 2 * @ch
        case @character.direction
        when 2
          sx = 0
        when 4
          sx = @cw
        when 6
          sx = 3 * @cw
        when 8
          sx = 2 * @cw
        end
        self.src_rect.set(sx, sy, @cw, @ch)
      end
    end
  end
end

class Game_System
  
  attr_accessor :spritesheet
  
  alias initialize_first initialize
  def initialize
    initialize_first
    @spritesheet = false
  end
  
end

If you have any issues with it, let me know.
Just use a script call saying $game_system.spritesheet = true to turn it on
and $game_system.spritesheet = false to turn it off again. That way, it actually gets saved with your savegame so that you really only have to turn it on and off once until you want to change it.
Once again, lemme know any issues
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top