OpenChest ACE

OpenChest ACE

by Kyonides
​

Introduction

Did you ever wanted to configure your chests the easiest way possible?

Now you can do that at any time! 😀

And how exactly does that work?

:eswt: Well guys, you simply need to create your event and turn on a single game switch and start adding gold, items, weapons or armors at will. 😀

The script will turn off the switch before exiting the scene.

Open an OpenChest Scene
Ruby:
OpenChest.open(ChestID)

Open an OpenChest Scene - Flag the Player as a Thief
Ruby:
OpenChest.open(ChestID, true)

You can use some special script calls to test if the party had stolen anything anywhere or from the current map's chests. XD

Ruby:
$game_system.chests_stolen?
$game_system.chests_stolen_here?

They are ideal for conditional branches, don't you think? 😉

Spoiler: Screenshots
openchestace01.jpg

openchestace02.jpg

openchestace03.jpg

openchestace04.jpg

​

Terms & Conditions

Free for use in any game.
Due credit is mandatory.
I would appreciate if you send me a copy of your game.
That's it!
OpenChest Has Been Improved!​

Now version 1.2.0 offers you more options to customize your favorite chest menu!
The Title submodule includes a couple of Constants to allow you change the menu's title font.

You can now count on your Snag All button as well.

And now the Label event command has a brand new use: it lets you name your beloved chest! 😉

openchestace06.jpg
openchestace07.jpg

​
Version 1.2.1 is OUT! 😮​

What makes this teeny version particularly interesting for some people is that it FINALLY allows the game developer to replace the default black box with a custom Painter backdrop picture.

Detective Go look for the BACKDROP_TYPE and BACKDROP_NAME Constants found inside the Title module.

This new feature is available on all of the RGSS based engines!

Nope, I won't provide you with any custom backdrop this time. 😛

😉 Just be creative, guys!
Hey there! Excellent work with script - it's a really cool idea! So I'm trying to implement it into my project but I'm having some issues. My game window is 640x360 so I had to adjust the windows. Took care of that but now I'm having problems centering the "NumberInputWindow". I can't code at all so it's just been me fiddling around with the x and y numbers. Would you be able to point me in the right direction so I can get this aligned? Thank you!

1706852224485.png


I figure the issue lies around here but I can't figure it out.

Code:
class NumberInputWindow < Window_Base
  attr_reader :number
  attr_writer :icon_index
  def initialize(wx, wy)
    #super(wx, wy, 320, 96)
    super(wx, wy, 230, 96)
    #@bitmap = Bitmap.new(width - 32, height - 32)

    @bitmap = Bitmap.new(width - 32, height - 32)
    @cursor_width = @bitmap.text_size("0").width + 8
    self.contents = @bitmap
    self.z += 9999
    self.back_opacity = 255
    @text_max = []
    @offset_x = LABELS[2]
    @ox = @offset_x + 2
    @index = 0
    @rect = Rect.new(@offset_x, 32, @bitmap.width - @offset_x, 32)
    2.times {|n| @text_max << @bitmap.text_size(LABELS[n]).width }
    update_cursor_rect
  end

  def draw_basic_data
    @bitmap.clear
    2.times do |n|
      label = LABELS[n]
      draw_icon(@icon_index, 0, n * 32 + 4)
      @bitmap.draw_text(28, n * 32, @offset_x - 28, 32, label)
    end
  end
Nah, I preferred to update my script once again by adding new Constants that will store the windows' widths and then each window will center itself right at the beginning of the scene. I mean, this will happen even before you can read anything on screen.

Ruby:
  CHEST_WIN_WIDTH   = 320
  NUMBER_WIN_WIDTH  = 320
  OPTIONS_WIN_WIDTH = 160
Whoa - it's working perfectly now! Thank you so much for the update!

Original thread: https://forums.rpgmakerweb.com/threads/openchest-ace.159479/