EZ Text Replacer API
Helps modders with text replacement.
About this mod Author’s original text
EZ Text Replacer API
This is an API for modders that enables easily replacing in-game text and dialog.
To use this API in your own projects, include MM_EZ_Text_Replacer_API:2.0.0 as a dependency in your mod.toml,
and download the API header from GitHub here.
The main header contains a large amound of EZTR's documentation, but more information can be found in the online documentation here.
In addition to simple text replacements, v2.0.0 offers:
- Dynamically generates messages using a callback system.
- Support for adding new message entries. Use EZTR to quickly implement additional dialog for your mods.
- Tools and functions for and generating manipulating message strings, including a specialized version of the printf family of functions.
EZ Text Replacer is simple to use. For example, the following code is used to replace the all dialog related the Razor Sword's breaking after 100 uses.
include "eztr_api.h"
EZTR_ON_INIT void replace_msgs() {
EZTR_Basic_ReplaceText(
0x0038,
EZTR_STANDARD_TEXT_BOX_I,
1,
EZTR_ICON_RAZOR_SWORD,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
true,
"|17Your Kokiri Sword has been|11strengthened and forged into a|11|01Razor Sword|00!|18|11|12This new, sharper blade is a cut|11above the rest!|BF",
NULL
);
EZTR_Basic_ReplaceText(
0x0C3B,
EZTR_STANDARD_TEXT_BOX_I,
49,
EZTR_ICON_NO_ICON,
EZTR_NO_VALUE,
100,
EZTR_NO_VALUE,
true,
"All right...To |01reforge |00your sword,|11it will cost you |06100 Rupees|00. It'll|11be ready at |01sunrise.|11|00|12|17You'll have to let us hold onto|11your sword until then.|10So, would you like your sword|11reforged for |06100 Rupees|00?|11|02|C2I'll do it|11No thanks|BF|00|00",
NULL
);
EZTR_Basic_ReplaceText(
0x0C51,
EZTR_STANDARD_TEXT_BOX_I,
48,
EZTR_ICON_NO_ICON,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
true,
"Now here's a secret...If you bring|11me |01gold dust|00, I'll be able to make|11it the |01strongest sword |00around.|10You got that? |01Gold dust|00!|19|BF|00",
NULL
);
EZTR_Basic_ReplaceText(
0x1785,
EZTR_STANDARD_TEXT_BOX_II,
1,
EZTR_ICON_RAZOR_SWORD,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
true,
"|04Razor Sword|11|00The Kokiri Sword reforged at the|11smithy. A cut above the rest.|BF",
NULL
);
}
Credits
Special thanks to:
- for their printf implementation.
- for various libc headers needed to compile this mod.
- for linking against to provide additional math operations.
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.