Chapter 5: Appendix
This section contains anything that wasn’t present at the inception of this topic but should be covered by it.
Combat Arts
Combat Arts can be enabled by uncommenting #define COMBAT_ARTS
in Config.event
. Doing so will move all command skills to a Combat Arts submenu, as well as turn a number of proc skills into command-activation skills. Whether any of these are able to double can be controlled by the ARTS_HIT_ONCE
true/false definition just below the above one.
Combat Arts have their own IDs separate from skill IDs. These are written to 0x0203F101
in memory and referenced for purposes of stat changes and durability costs when using specific arts. These art IDs are built off of the preexisting attack type system used by Lunge, Mercy, and Gamble, which is in turn built off of a system designed for Pair Up. As such, IDs 0-2 are reserved for normal attack, rescue, and pair up respectively.
Combat Arts come with framework usability & effect functions for menu commands for new arts, utilized by the 9 proc skills already converted to combat arts. To add a new combat art, in Skills/UnitMenuSkills/CombatArts/CombatArts/event
you add an entry to the combat arts menu for your skill, then make a version of the following two sections with your relevant values:
ALIGN 4
CombatArtUsability:
#incbin "CombatArtUsability.dmp"
POIN SkillTester
WORD SkillID
WORD 0 // art ID
POIN CombatArtCostTable
ALIGN 4
CombatArtEffect:
#incbin "CombatArtEffect.dmp"
WORD 0 // art ID
These will then handle the unit menu entry for you, making it so that Combat Arts can only be used when you have the proper skill and when you have enough durability left to use them.
Speaking of, you can also set the durability cost of a Combat Art modularly. The macro SetCombatArtCost(attackTypeID,durabilityCost)
sets the additional durability cost of the given combat art ID. There is one function that references this data and properly decrements weapon uses as a result, so you don’t have to do it manually.
The proc skills converted to combat arts have functions in the same loop as they normally do, replacing their % chance requirements with a 100% activation rate if the attack type ID matches the one dedicated to that skill. As such, skill activation animations and the like are all still used and all work as if the skill were to proc by chance.
Skill Scrolls
Skill Scrolls are items that can be used to teach a skill to a unit. More specifically, they are a single item that teaches the skill with an ID equal to their durability. This means you can have 255 unique skill scrolls while only using 1 entry in the item table.
Though initially it was locked to just skill scrolls, various pieces have been rewritten to allow you to modularly define durability-based items. The data for doing so is located in Necessary/DurabilityBasedItems/DurabilityBasedItems.event
. There are 4 lists here, each contributing to a different aspect of durability-based items. DurabilityBasedItemNameList
maps item name values to tables indexed by the item’s durability to get the text ID to use for the item’s name. Entries on this list use the macro DurabilityTextEntry(textID,useColonTerminator,tablePointer)
. textID
is the value that denotes using the given table, tablePointer
is the pointer to said table, and useColonTerminator
is a boolean value for whether or not to terminate the text at the first colon, rather than the end of the text entry. This option exists due to how getting skill name strings from skill descriptions works, but could be useful otherwise if you so desire. Skill Scrolls, by default, use the item name 0xFFFF
to denote using a durability-based skill name instead.
DurabilityBasedItemDescList
is the same concept as above, but for item descriptions. Note this does not apply to use descriptions, only R text descriptions. Entries use the same macro as above with the same options available. Skill Scrolls once again use 0xFFFF
to denote using a skill description.
DurabilityItemList
is a list of item IDs that are durability-based. This is used when displaying the remaining durability of the item in order to make it always display as 1. Entries can be done using the macro DurabilityItem(itemID)
.
DurabilityBasedItemIconList
maps item IDs to icon sheet IDs indexed by durability. This list is only used when the icon ID of an item is set to 0xFF
; items need both their ID set to 0xFF
and an entry on this list to properly use durability-based icons. The icon sheet used by skill scrolls is ID 5. By default, this is mapped to the same graphics as the skill icon sheet, but you can change it to a unique icon sheet by changing the pointer in Necessary/IconRework/IconRework.event
underneath prGetSkillBookIconGfx
.
Giving a unit an item with specific durability isn’t normally possible, so this also adds ways in which to do this:
-
GiveItemWithDurability(Item,Durability,Character)
will give the given unit the given item with the given durability. This allows you to give a scroll for a specific skill via events. -
DurabilityChest(item,durability,chestX,chestY)
will define a chest map object that, when opened, will give you the given item with the given durability.
Additionally, shops are reworked to allow for selling of items with specific durability. Each entry in a standard shop list is 2 bytes, but 1 of these is always 0. Now, by making each 2-byte entry in a shop list the full item + durability halfword the shop will stock the item with that specific amount of durability. Additionally, as not to cause crazy price swings based on the durability of the item, there is a list in DurabilityBasedItems/DurabilityShop/ShopDurability.event
, FixedPriceItemList
, that acts as a list of items whose price is always equal to their cost per use value regardless of their current durability.
The Skill Scroll item itself is set up through Item Effect Revamp, to allow it to be used at the prep screen. During a map, you can use a skill scroll at any time and it will bring up the forget skill menu if necessary, but at the prep screen, you can only use a skill scroll if you don’t already have four learned skills. If you don’t want to use Item Effect Revamp, making skill scrolls unusable at the prep screen is the only step necessary to remove IER as a dependency.
Gaiden Magic
Brought to us by @HyperGammaSpaces and @Snakey1, Gaiden Magic gives units the ability to learn spells that can be cast at any time at the cost of HP.
Setting learnable spells is done per character from Engine Hacks/ExternalHacks/GaidenMagic/GaidenSpellLists.event
. Here, you define a spell list for each unit that has one. These lists have 2-byte entries: the first is the level at which the spell is learned, and the second is the item ID of the spell learned. The end of the list is denoted with both values of an entry being 0
. You then set the spell list to a character using the GaidenList(charID,spellListPointer)
macro. Learned spells can be seen by default on page 4 of the stat screen, complete with R text, and can be relocated wherever is necessary.
Once a unit knows a spell, the Black Magic
and White Magic
unit menu options will become available. Here known spells are found and can be cast, separated by weapon type into the two menus: anima and dark in black magic, and light and staves in white magic. Note that even if a spell is known, you still require the weapon rank specified by the item in order to cast it. Spells cost HP to cast, and the amount they cost can be set from Tables/FE8 nightmare modules/Item editors/Gaiden Spell Cost Table.csv
. The HP cost of a spell is shown in place of the durability of an item. If you do not have enough HP, you cannot cast a spell. If the HP cost of an attack during a battle would kill you, your attack will be skipped. Missed attacks do not appear to cost HP during battle, but do cost HP and will show up as such after battle. When defending, if you cannot counter with the first equippable item in your inventory, you will use your first learned spell instead. Note that this system does not change the functionality of standard spells in inventory as they would work in vanilla, so you can intermingle spell items and learned spells without issue.
Promote on Level Up
Enabling @Vesly’s Promote on Level Up hack will allow you to configure a level at which player units of a given class will automatically promote upon completing an action. The level for each class is set in Tables/NightmareModules/Misc/PromotionLevelList.csv
; by default, every class’s promotion level is set to 255. Note that because of the restriction to the promoting unit completing an action, you can only promote on player phase. This means if you level up on enemy phase, you will level up after completing an action on the next player phase. On player phase, you will promote at the end of the battle where you level up.
AoE Attacks
This will allow you to give Area of Effect behavior to weapons and staves. Using the list in EngineHacks/ExternalHacks/AoE/Installer.event
, you can set the parameters of AoE attacks and the requirements to obtain the ability to use them. The format of each list entry is as follows:
+0x0 Byte UnitID // ID of character allowed to use; 0 for everyone
+0x1 Byte ClassID // ID of class allowed to use; 0 for everyone
+0x2 Byte Level // Level requirement to use; 0 for any level
+0x3 Byte ItemID // ID of item required to use; 0 for no restriction
+0x4 Short FlagID // ID of flag controlling usability; 0 for none
+0x6 Byte SkillID // ID of skill required to use; 0 for none
+0x7 Byte None
+0x8 Byte HPCost // HP cost for using attack
+0x9 Byte Config // Bitfield for various config options; see below
+0xA Byte PowLowBound // low bound for base damage dealt/healed
+0xB Byte PowHighBound // high bound for base damage dealt/healed
+0xC Byte MinRange
+0xD Byte MaxRange
+0xE Byte RangeMaskID // ID of range mask to use; see below
+0xF Byte AnimationID // ID of AoE animation to use; see below
Most of these are self-explanatory, but 3 of them warrant further explanation.
The Config byte is a bitfield whose available settings are as follows:
- HealBool - 1 for healing, 0 for damage
- FriendlyFireBool - 1 for hitting allies, 0 for not
- FixedDamageBool - 1 for using only base damage range, 0 for also using unit’s str/mag
- MagBasedBool - 1 for using mag, 0 for using str; no effect without Str/Mag Split
- HitResBool - 1 for hitting target’s resistance, 0 for hitting target’s defense
- DepleteItemBool - 1 for decreasing item of set ID’s uses, 0 for not
- UsableOnlyIfStationaryBool - 1 for only allowing use when you haven’t moved, 0 for allowing use whether or not you have moved
These are all definitions, and setting some combination of them for the Config byte will control their respective behavior toggles.
The Range Mask byte indexes a table RangeTemplateIndexList
in a separate file in the same directory, AoE_RangeTemplates.event
. Each entry on this table is 4 pointers to differently rotated versions of the range mask at that ID; these are what control the shape of the Area of Effect. The format of range mask data begins as follows:
+0x0 Byte SizeX // size of the AoE, 1-indexed
+0x1 Byte SizeY
+0x2 Byte OriginX // location the cursor is placed at, 0-indexed
+0x3 Byte OriginY
After this comes SizeX * SizeY
bytes, each representing whether or not the tile at that position is within the affected area with 1 as included and 0 as not included. Each 90-degree rotation of the base AoE mask gets its own instance of this data pointed to from the initial table. There are a number of preexisting range masks, indexed as follows:
- 0 - Triangle - 3x5 triangular area of effect centered on its point.
- 1 - Small Curve - 3x2 slight curve.
- 2 - Line 1 - 3-tile line from the cursor.
- 3 - Double Line - 5x2 line centered on the cursor.
- 4 - Small Triangle - 3x2 triangle centered on its point.
- 5 - Giant Cross - 2 perpendicular 9-tile lines intersecting the cursor.
- 6 - Square - 3x3 square.
- 7 - Cross - 2 perpendicular 5-tile lines intersecting the cursor.
- 8 - Line 2 - 5-tile line centered on the cursor.
- 9 - Small Cross - 2 perpendicular 3-tile lines intersecting the cursor.
- 10 - Cross - Same as 7.
- 11 - Small X - 3x3 ‘X’ shape.
- 12 - X - 5x5 ‘X’ shape.
- 13 - Diamond - 5x5 diamond shape.
- 14 - Small Line - 3-tile line centered on the cursor.
- 15 - Smile - 5x4 smiley face.
- 16 - Expressionless Face - 5x5 serious face.
- 17 - Medium Cone - 3x5 cone centered on its point.
- 18 - Large Cone - 6x5 cone centered on its point.