Reader Functions for Features/Effects
Script by Mr. Bubble
Summary
This is a scripter’s tool. This means programming knowledge and Ruby knowledge are required to understand and utilize this script. This script does nothing by itself.
All RPG::BaseItem objects have an array of RPG::BaseItem::Feature objects that contain all Feature properties defined by the developer in the database. Unfortunately, the way Feature objects is coded makes it not immediately understandable by humans. It requires checking the methods in Game_BattlerBase and Game_Battler to decipher what the values in a Feature mean. This makes trying to display a specific object’s Features difficult to accomplish.
This script is essentially a collection of wrapper functions based off the methods defined in Game_BattlerBase and Game_Battler. This was mostly a copy and paste job and most of the return values are similar to the ones from those original classes.
For example, if you have a $data_items object, you can do
Code:
- $data_items[id].hp_recovery
复制代码
to directly get that item’s total hp recovery value. There are many other usable methods.
RPG::UsableItem objects do not have Features, but have a similar inner class called RPG::UsableItem::Effect which have their own reader functions.
This script was made for my own use, but other scripters can use it if they want.
Script
Can be found here:
http://wp.me/PxlCT-rC
Installation
Paste this script into its own page within the "Materials" section in the script editor of your project.
How to Use
This is a scripter’s tool. This means programming knowledge and Ruby knowledge are required to understand and utilize this script. This script does nothing by itself.
Compatibility
There are no default method overwrites.
Requests for compatibility with other scripts are encouraged and welcome.
Terms and Conditions
Free for non-commercial use.
If you wish to use this for commercial games, contact me first.
Please feel free to post coding and efficiency suggestions, script features suggestions, and bug reports.
本贴来自国际rpgmaker官方论坛作者:Mr. Bubble处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/reader-functions-for-features-effects.4235/