Items

From OHRRPGCE-Wiki
Jump to navigation Jump to search
Items Menu.png

From the player's point of view, an item is anything that the player can access through the Item menu from the main menu while playing a game. From the game maker's point of view, an item is a link to either an attack or a text box, and/or a piece of equipment.

You can define up to 32000 different items, all with a unique name and ID number.

Item Editor[edit]

Main Menu > Edit Items then select an existing item or Add new item to enter Item Editor.

Name is limited to eight characters long, so make good use of special characters from your font (press CTRL+SPACE to see your available font characters).

Once an item is named, it can be referred to in all other menus (and plotscripts) by ID number or name.

Info text will be visible to the player when they have their cursor on this item, either in their inventory menu or in a shop.

Value will be the default cost in every shop that has it available. Every item's sell-back price is default to one half of its assigned Value. Both of these prices can be altered on a shop-by-shop basis in the Shop Editor however, so these values are only defaults.

Items have the special privilege of being available to shops (standard OHR shops cannot sell other things like attacks, for example, though they can sell items that teach them).

Consumability assigns one of three standard consumption rates. Default is Unlimited Use, also Consumed By Use and Cannot be Sold/Dropped. These are self-explanatory, but one should note that "Cannot Be Sold/Dropped" automatically implies "Unlimited Use".

There is no simple way to prevent a player from being able to 'drop' an item, and at the same time have it be consumed if he uses it. For suggestions on this see the bottom of this page, -Advanced Item Techniques-.

Equippable in upto five equipment slots, including weapon.

If the item is a weapon, there are additional graphical options. This attack must be defined in the attack editor, and it will be the hero's standard attack in all battles where this weapon is equipped. Using an item as equipment in this way does not consume the item (currently there is no way to have a weapon be consumed by its own use as a regular attack).

As long as an item is equippable it can have Stat Bonuses.... Equipment can affect any stat, both positively and negatively. It can also be assigned "Equipment Bits", which basically endow certain elemental effects upon the wearer. This does NOT affect an elemental weapon's attack. To do that you should make the relevant attack have an elemental bitset in the attack editor.

Finally, an equippable item needs to be told what heroes can equip it in the "Who Can Equip?" menu.

Note that none of this information (value, stats, bits, or who can equip) is visible to the player highlighting the item in game. If you would like the player to know these things, you should find a way to show this information in the "Info" text for that item.


What can an item do when used outside of battle?[edit]

Teach spell[edit]

One way to make your hero learn spells is to make a special item that must be used on the hero to teach the spell.

Teach Spell links an item to an attack defined in the Attack Editor. But selecting this option alone isn't enough to make the attack/spell learnable, the hero must be able to learn the spell as well, otherwise nothing will happen. This is achieved by reserving a slot for it in one of the hero's Spell lists in the Hero Editor.

Go into Edit Hero from the main menu, choose the hero who is going to learn the spell, and edit their spell list. 
(If you haven't already, name the spell list first to activate it)
In one of the EMPTY slots put the same spell that the item teaches 
(You can jump to the attack menu from both the Item Teach Spell and Hero Spell List to edit/add attacks)
Make sure the spell is set to learned from an item: Yes.

Now that the item can teach the spell, and the hero has the capacity to learn it, you are all set.

Use an Attack[edit]

An item can do Out-of-battle attacks on one of your heroes. This is usually a cure attack that restores health, used to make healing potions. Therefore the item needs to be linked to a corresponding attack defined in the attack editor. Attacks that change stats other than Health and Magic (HP and MP) are permanent when used outside of battle (they are temporary when used inside of battle). If you want the attack to be used out of battle, make sure it has the "usable outside of battle" bitset turned on in the Attack Editor. Some attack features such as chaining have no effect outside of battle (only the first attack in a chain is used). See Out-of-battle attacks for details.

Open Text Box[edit]

An item can also cause a text box to be displayed. You can also indirectly trigger a script with an item by attaching the script to a text box, and then making the item show the text box. This is under the option called When Used Outside of Battle: which is used to assign an attack to an item. However, you can also assign a text box here. This is done using negative numbers (moving to the left). When you use this item from your inventory, it will immediately pop up that text box. If you want to attach a plotscript of a battle or something like that to an item, attach it to a text box, and then attach the text box to the item

Another thing to note is that all of this is based on using the item through the menu, NOT on using it as equipment, which will be explained next.

What Items Cannot Do[edit]

Items cannot be assigned to call plotscripts. However, they can call a textbox that itself is set to call a script instead of itself all the time. Unfortunately, this means they can never pass arguments to a script.

Items are used and sold one at a time. However, without plotscripting, items cannot be dropped by the player one at a time. There should never be a need for this kind of functionality in a standard OHR RPG, because...

There is no easy way to limit the number of items a player can carry, even with plotscripting. The standard item menu in game has a LOT of room, and items are grouped in one slot up to 99 at a time. If a player acquires more than 99, the items in question begin a new group in a new slot. Thus the player should never have a need to throw one of anything away.

Equipped items are not considered part of the inventory. That means that equipped items cannot be used in the item menu, and thus cannot use their "When Used In Battle" attack at all unless they are unequipped BEFORE the battle. This is because equipment cannot be changed during a battle.

Items, like attacks, are not very flexible. Once defined in custom, they cannot be altered in any way mid-game via plotscripts (contrast with things like Maps and NPCs which can be plotscripted on the fly). In addition, although plotscripts can refer to items by name, they cannot read any other data about them directly from the RPG file. If you would like to know, say, the attack ID that a certain item uses outside of battle in the middle of a plotscript, you have no choice but to manually construct a scripted 'lookup table'.

How do I prevent items from appearing in the inventory?[edit]

You can't. All items in your inventory must be visible. There is no support for hiding items. If you want to remove an item from your inventory you should use the delete item command. If you want to make a plot item (for example, a key) that does not take up an inventory slot, you should use a tag instead.

Advanced Item Techniques[edit]

Although items cannot pass arguments to scripts, different items can be set to call different text boxes which call different scripts. In this way one can, in theory, have a separate plotscript for every single item, and thus handle any and all item use outside of battle with scripts. This can allow many fancy techniques like items that only work on certain maps, or that have random effects outside of battle (no such functionality inside of battle), and plenty of other things.

One thing that you can use the above scripting idea for is to force "Cannot Be Sold/Dropped" items to be consumed on use. Have the item call a textbox that calls a script that performs the desired function (although this is rarely easy) and then deletes one instance of the item. Once again, this does not work in battle, unless you are willing to get into some very heavy "Instead of Battle" and "After Battle" plotscripts.

The "inventory(Item:name)" command can be used to determine how many of an item is in the player's inventory, although there is no easy way to count equipped copies of the item. There is also no easy way of discovering things like what item the player last used, or was last obtained. Saving the current state of the inventory is a fairly massive task that requires setting aside global variables for every defined item in the game, even if the player does not have them.

See Also[edit]