Database Limit Breaker
#1
Database Limit Breaker
Version 2.0
by Woratana
Release Date: 24/01/2009


Introduction
It is the script for the big game that need more than 5000 variables/switches,
or more than 999 weapons, skills, and anything in Database window.

I finished this script for a while, but haven't post it till there is
request in here:
http://www.hbgames.org/forums/index.php?topic=47546.0

This script worked with both XP and VX.

Actually, I'm not sure how many people will use this script.
But I hope it will at least ensure people who want to make big game,
that they don't have to worry about the database limit.

However, this script cannot make more than 999 maps.

Enjoy~ :lol:

Screenshots
[Image: 33nkktk.jpg]

Script
Place it above main
Code:
#===============================================================
# ● [XP/VX] ◦ Database Limit Breaker II ◦ □
# * Break limit of data number in database files *
#--------------------------------------------------------------
# ◦ by Woratana [woratana@hotmail.com]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 22/02/2008
# ◦ Version: 2.0
# ◦ Instruction language(s): English, Thai (ภาษาไทย)
#--------------------------------------------------------------

#==========================================
# ** HOW TO USE - วิธีการใช้สคริปต์
#------------------------------------------
# [English]
# 0. Open your project (Recommend to backup your database files first~)
# 1. Paste this script in above 'Main'.
# 2. Set DLB_USE_IT = true
# 3. Setup database files you want to change, in DLB_DATA
# 4. Run your game...
# 5. When it finished, game will close itself
# 6. Close your project *without save*
# 7. Open your project again. Done!
# 8. Set DLB_USE_IT = false. Leave this script in your Script Editor.
#------------------------------------------
# [Thai ภาษาไทย]
# 0. เปิดโปรเจคเกมขึ้นมา (แนะนำให้แบ็กอัพไฟล์ฐานข้อมูลก่อนนะครับ~)
# 1. วางสคริปต์นี้ไว้ในช่องไหนก็ได้ แต่ให้อยู่เหนือ 'Main'
# 2. ตั้ง DLB_USE_IT = true
# 3. ตั้งค่าฐานข้อมูลในส่วน DLB_DATA
# 4. รันเกม...
# 5. เมื่อสคริปต์ทำงานเสร็จ เกมจะปิดตัวโดยอัตโนมัติ
# 6. ปิดโปรเจคเกม *โดยไม่ต้องกดเซฟใด ๆ ทั้งสิ้น*
# 7. เปิดโปรเจคเกมขึ้นมาใหม่ เช็คไฟล์ฐานข้อมูลจะเห็นว่ามันเปลี่ยนไปแล้ว!
# 8. ตั้ง DLB_USE_IT = false แล้วปล่อยสคริปต์นี้ทิ้งไว้ใน Script Editor ของคุณ
#==========================================

  #===========================================================================
  # [ENG] Use limit breaker? (set this to false after you run this script,
  # and haven't change anything in DLB_DATA after that)
  # or REMOVE this script when finished~
  #---------------------------------------------------------------------------
  # [THA] ต้องการรันสคริปต์ลิมิตเบรกเกอร์๋มั้ย? (ตั้งค่านี้เป็น false หลังจากที่รันสคริปต์นี้ไปแล้ว และยังไม่ได้
  # แก้ไขส่วน DLB_DATA หลังจากนั้น) หรือจะลบสคริปต์นี้ออกไปจากเกมหลังจากใช้เสร็จแล้วก็ได้~
  #+==========================================================================
  DLB_USE_IT = false # (true / false)

  if DLB_USE_IT # Do NOT edit this line
    DLB_DATA = {
    #======================================================
    # [ENG] Database file you want to change their number~
    # * Limit of normal database files are 999
    # * Limit of variables and switches are 5000
    # This script will allow you to change their number over their limit~
    #===============================
    # ** How to setup **
    #-------------------------------
    # Add 1 line below per 1 database file you want to change.
    # Structure: 'Database_File' => (number),
    # e.g. 'switch' => 5500,
    # (* Don't forget to put , behind the line!)

    #-----------------------------------------------------
    # [THA] ไฟล์ฐานข้อมูลที่คุณต้องการแก้ไขจำนวน~
    # * ลิมิตของไฟล์ฐานข้อมูลปกติ คือ 999
    # * ลิมิตของตัวแปร กับสวิตช์ คือ 5000
    # สคริปต์นี้จะทำให้คุณสามารถแก้ไขจำนวนของข้อมูลเหล่านี้ให้เกินลิมิตได้
    #===============================
    # ** วิธีการตั้งค่า **
    #-------------------------------
    # เลือกเพิ่มบรรทัดด้านล่าง สำหรับแก้ไขจำนวนข้อมูลในฐานข้อมูลที่ต้องการ
    # รูปแบบ: 'ชื่อฐานข้อมูล' => (จำนวน),
    # ตัวอย่างเช่น... 'switch' => 5500,
    # (* อย่าลืมใส่สัญลักษณ์๋ , ท้ายบรรทัดนั้น)

    #==============================================
    # ** [List / ลิสต์] Database_File / ชื่อฐานข้อมูล**
    #----------------------------------------------
    # 'switch' for Game Switches สำหรับสวิตช์
    # 'variable' for Game Variables สำหรับตัวแปร
    # 'actor' for Actors สำหรับตัวละคร (ฮีโร่)
    # 'class' for Classes สำหรับคลาส
    # 'skill' for Skills สำหรับสกิล
    # 'item' for Items สำหรับไอเทม
    # 'weapon' for Weapons สำหรับอาวุธ
    # 'armor' for Armors สำหรับเครื่องป้องกัน
    # 'enemy' for Enemies สำหรับศัตรู
    # 'troop' for Troops สำหรับกลุ่มศัตรู
    # 'state' for States สำหรับอาการผิดปกติ
    # 'tileset' for Tilesets (RMXP only) สำหรับไทล์เซ็ต (สำหรับ RMXP เท่านั้น)
    # 'animation' for Animations สำหรับอนิเมชั่น
    # 'commonev' for Common Events สำหรับเหตุการณ์ทั่วไป
    #======================================================
    # * START to setup from here! เริ่มการตั้งค่าตรงนี้
    #======================================================

    'actor' => 1011,

    #========================================================
    # * [END] Database Limit Breaker Setup Part
    # * จบส่วนตั้งค่าสคริปต์~
    #========================================================
    'end' => nil # Close hash
    }

    dformat = defined?(Graphics.wait) ? '.rvdata' : '.rxdata'
    start_time = Time.now
    DLB_DATA.each do |k,v|
      dvar = nil
      case k
      when 'switch'; dname = 'System'; dvar = 'switches'; dnewdata = ''
      when 'variable'; dname = 'System'; dvar = 'variables'; dnewdata = ''
      when 'actor'; dname = 'Actors'; dnewdata = 'RPG::Actor.new'
      when 'class'; dname = 'Classes'; dnewdata = 'RPG::Class.new'
      when 'skill'; dname = 'Skills'; dnewdata = 'RPG::Skill.new'
      when 'item'; dname = 'Items'; dnewdata = 'RPG::Item.new'
      when 'weapon'; dname = 'Weapons'; dnewdata = 'RPG::Weapon.new'
      when 'armor'; dname = 'Armors'; dnewdata = 'RPG::Armor.new'
      when 'enemy'; dname = 'Enemies'; dnewdata = 'RPG::Enemy.new'
      when 'troop'; dname = 'Troops'; dnewdata = 'RPG::Troop.new'
      when 'state'; dname = 'States'; dnewdata = 'RPG::State.new'
      when 'animation'; dname = 'Animations'; dnewdata = 'RPG::Animation.new'
      when 'tileset'; dname = 'Tilesets'; dnewdata = 'RPG::Tileset.new'
      when 'commonev'; dname = 'CommonEvents'; dnewdata = 'RPG::CommonEvent.new'
      when 'end'; next
      else; p 'unknown DLB_DATA!', 'Check carefully what you typed in DLB_DATA'
      end
      base_data = load_data('Data/' + dname + dformat)
      data = dvar.nil? ? base_data : eval('base_data.' + dvar.to_s)
      unless data.size > v and v - (data.size - 1) <= 0
        add_data = Array.new(v - (data.size - 1)) { eval(dnewdata) }
        data.push *add_data
        save_data(base_data, 'Data/' + dname + dformat)
      end
    end
    p 'Finished in ' + (Time.now - start_time).to_s + ' sec'
    exit
  end

class Game_Switches
  #--------------------------------------------------------------------------
  # * Set Switch
  #     Make the system be able to set switch ID more than 5000
  #--------------------------------------------------------------------------
  def []=(switch_id, value)
    @data[switch_id] = value
  end
end

class Game_Variables
  #--------------------------------------------------------------------------
  # * Set Variable
  #     Make the system be able to set switch ID more than 5000
  #--------------------------------------------------------------------------
  def []=(variable_id, value)
    @data[variable_id] = value
  end
end


Instruction
There is instruction step-by-step in the script.
QUOTE
# 0. Open your project (Recommend to backup your database files first~)
# 1. Paste this script in above 'Main'.
# 2. Set DLB_USE_IT = true
# 3. Setup database files you want to change, in DLB_DATA
# 4. Run your game...
# 5. When it finished, game will close itself
# 6. Close your project *without save*
# 7. Open your project again. Done!
# 8. Set DLB_USE_IT = false. Leave this script in your Script Editor.

* I'm not sure if there's limit in database size.
As far as I test, 20000 weapons works fine~*


* You may run to 'Script is hanging' error, if the script use too long time to process.
(e.g. when you create 20000 actors, and you already have only 10 in database)
My suggestion to fix this is to create new actors about 1000 - 5000 at a time. smile.gif
Do that again and again until you get the number you want.

Mostly, it takes overall about 1 - 3 seconds when I tested to create 1000 data for all database files,
and 6000 for switches and variables.


Author's Notes
Free for use in your work if credit is included.


Bug Report?
Please give me these informations:
Quote:- What is it says in error window?
- When is it get error? (Right after run game, when you choose something, etc.)
- Do you have any other scripts running in your game that may crash with this script?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
   Victor Engine - Damage Limit Victor Sant 0 6,554 01-04-2012, 09:14 AM
Last Post: Victor Sant
   Limit Break VX DerVVulfman 2 9,142 07-20-2009, 04:37 PM
Last Post: DerVVulfman



Users browsing this thread: 1 Guest(s)