じ☆ve冰风 发表于 2026-8-1 20:02:20

Custom Database

Custom Database

Author: Tsukihime

Overview

This script provides a set of methods that allow you to add new objects to the database and update existing objects in database.

It abstracts all of the details for you and provides a set of simple-to-use methods for interacting with the database.

The script uses a custom database to record any changes to the database in your current game, and is stored with the savefile so that any changes in one game does not affect any other game.

The custom database only supports adding and updating at the moment.

Download

Get it at Hime Works

Usage

Creating objects

A set of "add" methods have been provided for you in the script.

Suppose you wanted to make a new weapon. It would look something like

# create your weaponw = RPG::Weapon.neww.wtype_id = 1 w.params = * 8 # make it overpowered# now add it to the databaseid = CustomData.add_weapon(w)# you can do something with the IDThe general process is to create the RPG object, add it to the database, and then use that ID somewhere.

Updating objects

To update an object, you would call the appropriate `update` method provided by the script.

For example, if you wanted to update a skill's MP cost, you might do something like

                Code:       
# Updating skill 51s = $data_skills# change its mp costs.mp_cost = 20# now update the databaseCustomData.update_skill(s)




本贴来自国际rpgmaker官方论坛作者:Tsukihime处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/custom-database.2896/
页: [1]
查看完整版本: Custom Database