EZ Text Replacer API
Helps modders with text replacement.
模組介紹 作者原文
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.
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。