Do Action Helper
A library mod that helps mod developers create and manage Do Action conditions
| Last updated | 7 months ago |
| Total downloads | 2063 |
| Total rating | 7 |
| Categories | Libraries |
| Dependency string | tomtee-Do_Action_Helper-1.0.1 |
| Dependants | 4 other packages depend on this package |
This mod requires the following mods to function
README
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_helperas a dependency inmod.toml. - Add
#include "DAH_header.h"to your mod's source file. - Create your condition. Have
CONDITION_PARAMETERSbe the parameters and set the Do Action with*doAction = DO_ACTION_XXXX;. Have the function returntrueif don't want other conditions to be checked, returnfalseif 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_INITto register your Do Action conditions usingDoActionHelper_RegisterAction. Make sure yournameargument 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.