Formulas are one of the most powerful features available to RPG Maker game developers. They allow developers to enjoy the full capabilities of the Ruby scripting language while keeping their databases and events separate from their scripts.
My old way of writing scripts was to simply use the
eval command that Ruby provides. This is great, as you can evaluate any (valid) formula using the scripting engine, but it comes with a performance cost of actually evaluating your formula, which is not cheap.
Rather than constantly evaluating a formula over and over again, however, what if there was a way to evaluate it once, and then simply re-use it later?
This tutorial shows one way to achieve this with a few minor tweaks to your scripts are written.
This script allows you to assign multiple equip types to an equip. By default, each equip has only one equip type. For example, a sword is a “Weapon” equip type and can only be placed in “Weapon” slots. A wooden shield is a “Shield” equip type and can only be placed in “Shield” slots.
With multiple equip types, you can place an equip in any slot that it is compatible with. For example, you could create a slot called “left hand” and another slot called “right hand” and then specify that certain equips can only be held in your left hand, certain equips in your right hand, and certain equips in any hand.
Devs that use my scripts may notice that I really like using formulas. You might recognize this one from your default attack damage formula
a.atk * 2 - b.def * 4
Or in the case of note-tags, you might write something sophisticated like this
<some name: a.state?(23) || a.hp < a.mhp * 0.5>
The focus of this post is not what a formula is, but what happens when
Your formula just doesn’t seem to work
An update has been made to the Shop Manager to address a major limitation that developers may have found quite irritating:
Amazingly, developers weren’t able to accomplish this. But now you can!
Two updates have been made to the Parameter Bonuses script.
- Classes, weapons, armors, and states all support parameter bonuses
- You can reference each object’s own attributes in the bonus formula
When you add bonuses to an actor, the bonus will always be applied. However, sometimes you want bonuses to be activated under certain circumstances, such as wearing a piece of armor or applying a state.
By note-tagging parameter bonuses to different database objects, you can create all kinds of equips and states with unique functionality.
I’ve added a patch for my Enemy Levels script specifically for Falcao’s Pearl ABS. This patch allows you to manage the levels of existing enemies on the map using script calls.
An update has been made to the Feature Conditions script. First, I have created a preview image as an attempt to demonstrate what the script does and how it works:
A bug report was sent to me indicating that when the Choice Options script was installed, developers could no longer use the “branch” cancel option when setting up their conditional branches. Here’s a basic summary:
This led to a few issues, all of which were related to canceling. The problem has been addressed now.
The Map Screenshot script has been updated to support a new feature that allows you to indicate that an event is a “tile” event.
You can choose to show or hide events in your screenshots, but sometimes you might have events that are meant to act as tiles, but you still don’t want to show other events such as NPC’s.
The solution here is to distinguish between normal events and “tile” events so that even if you don’t draw events, the tile events are still drawn.
This is an update for the Map Regions script. When you go from one region to another, you can have a common event automatically run. It enables you to access script call, allowing you to run any logic when you move into a new region.