Globals
Star Rod uses globals for project-wide names and data which are not owned by one map or battle overlay.
Enums and Flags
Section titled “Enums and Flags”Project enum files live under $mod/globals/enum/ and use .enum or .flags. They extend or override Star Rod’s built-in type database.
An enum begins with its patch namespace, library name, and reversed-lookup setting. The remaining lines map hexadecimal values to names:
Npc % patch namespacenpcID % library namefalse % reversed
FFFFFFFF = SelfFFFFFFFE = PlayerFFFFFFFC = PartnerThe patch form is .Namespace:Name, such as .Npc:Self. Script-library argument metadata uses the library name to decide when a numeric argument should be decoded through this enum.
A .flags file has the same header, but each entry names an independent bit:
DamageTypedamageTypefalse
00000002 = Fire00000008 = Ice08000000 = IgnoreDefenseComments begin with %. Keep all three header lines in a project override.
Named Saved Variables
Section titled “Named Saved Variables”| File | Storage |
|---|---|
$mod/globals/GameBytes.txt | 512 original saved bytes. |
$mod/globals/GameFlags.txt | 2,048 original saved flags. |
$mod/globals/ModBytes.txt | Additional saved bytes installed by Star Rod. |
$mod/globals/ModFlags.txt | Additional saved flags installed by Star Rod. |
Each line begins with a hexadecimal index and a name. The original game-variable files may also retain a default name before the descriptive name:
% GameBytes.txt01C = Byte_DojoRank = DojoRank % current dojo promotion
% ModBytes.txt000 = MB_ExampleCounter
% ModFlags.txt000 = MF_OpenedExampleChestStar Rod adds the leading * when these names are used as script variables. These examples become *DojoRank, *MB_ExampleCounter, and *MF_OpenedExampleChest.
Do not assign one name to two indices, and keep each index within the capacity listed in Script Variables.
Project-Wide Sources
Section titled “Project-Wide Sources”| Data | Source |
|---|---|
| Items | $mod/globals/Items.xml |
| Moves | $mod/globals/Moves.xml |
| Image definitions | $mod/image/ImageAssets.xml |
| Item-entity definitions | $mod/image/ItemEntities.xml |
| HUD-element definitions | $mod/image/HudElements.xml |
| Global patches | $mod/globals/patch/ |
$mod/globals/system/ contains project-system data and overrides for built-in system patches. See Editing Project Globals for the normal editor workflow.