Items

From OHRRPGCE-Wiki
Jump to navigationJump to search
Revise.png
This article does not meet the standard of quality we would like to have. Feel free to revise it and make it better by using the edit link at the top of the page. This tag should be removed when an editor feels it is of high quality.

The reason this article has been marked is: Pictures should be added to clarify a few things; various words should link to relevant pages; NOTE in Basics section needs answered and removed

Introduction[edit]

Items are pretty simple to understand for the most part, although they do have some quirks to them. 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 author's point of view, any item is just a special link to either an attack or a text box, and/or a piece of equipment. The author can define up to 254 32000 different items, all with a unique name and ID number. Each one of these items can be assigned its own unique attributes (such as what text box to link to) through the Item Editor in custom.

Basics[edit]

Defining items is easy. Go into the Item Editor from custom's main menu and use the up and down arrow keys to pick the ID number you want to use, and hit enter. You will bring up a menu for the item. You should first give the item a name. Item names can only be 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 menues (and plotscripts) by ID number or name. Here we can also assign text as "Info". This is the text the player will see when they have their cursor on this item, either in their menu or in a shop.

Items in and of themselves cannot 'do' anything. If you want an item use to trigger an action, that action has to be defined as an attack. So to make items heal or hurt you need a corresponding attack defined in the attack editor. Then you can assign the item to use the attack either in battle, out of battle, or both. 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. Items can also be assigned to call a textbox out of battle. This is done using negative numbers (moving to the left) in the "When Used Out Of Battle" selection.

There is a third use supported for items. They can be assigned to "Teach a spell". The assignment is an attack defined in the attack editor. This will make it so that when the player uses the item out of battle, it brings lets him choose a hero to try to teach the assigned attack to. If the hero is able to learn the attack (has it defined in a spell list in the hero editor), he will do so. Otherwise nothing will happen. NOTE: If an item is assigned an out of battle use AND a spell teaching use, I am not sure which takes priority in game. Someone should update this, or I will when I get the time to try it out.

Value and Consumption[edit]

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). Every item can be assigned a standard "Value" in the Item Editor that will be the default cost of the item in every shop that has it available. Every item's sell-back price will likewise 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. Also, they are not automatically visible to the player outside of a shop where they are being bought or sold. If you want the player to know this "Value", you should list it in the "Info" text.

Items also can be assigned a standard consumption rate. There are three choices, and they can be cycled through on a line about half-way down the list in the Item Editor, which will default to "Unlimited Use". The other two choices are "Consumed By Use" and "Cannot be Sold/Dropped". These are pretty 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-. 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.

Items as Equipment[edit]

Any item can be set to be equippable in one (and only one) of the five equipment slots. If the item is a weapon, then it can also be assigned a graphic and palette, a handle point (to match with the handle point assigned in the weapon graphic editor), and a "When Used as a Weapon" attack. 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 in any of the five slots, it can be assigned "Stat Bonuses". In this way 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 (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.


Item Tags[edit]

Every item can affect tags in four ways. The four designations are pretty self-explanatory, except that ownership of an item is fulfilled whenever the item is either in the inventory OR is equipped (equipped items do not count as being in the inventory). You should not give the same tags to more than one item. Also note that assigning tags here in the Item Editor does NOT name the tags. To do that you should go to the Tag Editor and name the relevant tags.


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'.

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.