Do Action Helper

版本 v1.0.1·更新於 2025-05-24

A library mod that helps mod developers create and manage Do Action conditions

模組介紹 作者原文

Majora's Mask: Recompiled Do Action Helper

A library mod that aims to provide mod developers a centralised interface for adding, changing, or removing Do Action conditions.

Usage:

  • Download the header and place it in your mods include folder.
  • Add mm_recomp_do_action_helper as a dependency in mod.toml.
  • Add #include "DAH_header.h" to your mod's source file.
  • Create your condition. Have CONDITION_PARAMETERS be the parameters and set the Do Action with *doAction = DO_ACTION_XXXX;. Have the function return true if don't want other conditions to be checked, return false if you do. Here's an example:

bool Attack_Drop(CONDITION_PARAMETERS) {

Actor* heldActor = this->heldActor;

if ((this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->getItemId == GI_NONE) &&

(heldActor!= NULL)) {

if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (heldActor->id == ACTOR_EN_NIW)) {

*doAction = DO_ACTION_DROP;

return true;

}

}

return false;

}

  • Use DAH_ON_INIT to register your Do Action conditions using DoActionHelper_RegisterAction. Make sure your name argument is 32 characters or less (including NULL terminator). Here's an example:

DAH_ON_INIT void DAH_on_init() {

DoActionHelper_RegisterAction(ACTION, Action_Drop_Replace, 146, "Modern Throwing");

DoActionHelper_RegisterAction(ATTACK_GORON, Attack_Drop, 32, "Modern Throwing");

DoActionHelper_RegisterAction(ATTACK_ZORA, Attack_Drop, 32, "Modern Throwing");

DoActionHelper_RegisterAction(ATTACK_DEKU, Attack_Drop, 32, "Modern Throwing");

DoActionHelper_RegisterAction(ATTACK_HUMAN, Attack_Drop, 32, "Modern Throwing");

}

Notes:

  • The priorities of vanilla conditions can be seen in the source code.
  • You should check which priorities other mods use when they register conditions to prevent conflicts and make sure your condition is checked before or after other mods.

Requires Notifications.

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

ProxyMM-Notifications

檔案與校驗

檔案名稱
Do_Action_Helper-1.0.1.zip
檔案大小
385.2 KiB