Large Door Fix XP
#1
Large Door Fix XP

by Kyonides

Introduction

Have you ever noticed that all doors that are more than 32 pixels wide are automatically centered by the default event scripts?

There is a reason for that effect. They are supposed to be used as a single event that is wide enough for your heroes to slip into important buildings or dangerous dungeons. Nonetheless, that doesn't look quite good while waiting to enter a modern or futuristic supermarket, does it?

That's exactly why you need to grab this script! Grinning

It will make it possible to use it as if you had placed 2 door events in a row. Winking

Happy with a sweat Actually, the other door event should display NO graphic.

In both VX and VX ACE, that event's priority should be set to Same as Character's.

Remember that the filename should ALWAYS include some @ at symbol.

For RMXP

Code:
# * Large Door Fix XP * #
#  Scripter : Kyonides Arkanthes
#  2023-09-11

# - The file names of Door Character Sprites should begin with an @ symbol. - #
#  That symbol can be either the 1st or 2nd or even the 3rd character of the
#  filename. The fix will work as long as the @ symbol is there!

class Sprite_Character
  def update
    super
    update_bitmap
    update_visible
    update_src_rect
    update_screen
    update_animation
  end

  def update_bitmap
    if @tile_id != @character.tile_id or
      @character_name != @character.character_name or
      @character_hue != @character.character_hue
      @tile_id = @character.tile_id
      @character_name = @character.character_name
      @character_hue = @character.character_hue
      if @tile_id >= 384
        self.bitmap = RPG::Cache.tile($game_map.tileset_name,
          @tile_id, @character.character_hue)
        self.src_rect.set(0, 0, 32, 32)
        self.ox = 16
        self.oy = 32
      else
        c = @character
        self.bitmap = RPG::Cache.character(c.character_name, c.character_hue)
        @cw = bitmap.width / 4
        @ch = bitmap.height / 4
        # Large Door Fix
        self.ox = @character_name[/@/] ? 32 : @cw / 2
        self.oy = @ch
      end
    end
  end

  def update_visible
    self.visible = !@character.transparent
  end

  def update_src_rect
    if @tile_id == 0
      sx = @character.pattern * @cw
      sy = (@character.direction - 2) / 2 * @ch
      self.src_rect.set(sx, sy, @cw, @ch)
    end
  end

  def update_screen
    self.x = @character.screen_x
    self.y = @character.screen_y
    self.z = @character.screen_z(@ch)
    self.opacity = @character.opacity
    self.blend_type = @character.blend_type
    self.bush_depth = @character.bush_depth
  end

  def update_animation
    if @character.animation_id != 0
      animation = $data_animations[@character.animation_id]
      animation(animation, true)
      @character.animation_id = 0
    end
  end
end

Terms & Conditions

Free for use in ANY game. Gamer
Don't remove the header and its comments! Sarcasm
That's it! Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Messages In This Thread
Large Door Fix XP - by kyonides - 09-12-2023, 12:02 AM



Users browsing this thread: 1 Guest(s)