hai i be making a fangame and im lookin for a simple plugin that plays a Sound when an actor is low on HP in battle.
probably just like in Paper Mario or Pokemon
probably just like in Paper Mario or Pokemon
const _myEdit1_BattleManager_update = BattleManager.update;BattleManager.update = function(timeActive) {_myEdit1_BattleManager_update.call(this, timeActive);if ($gameActors.actor(1).hpRate() < 0.25)$gameTemp._lowHealthBeepTimer = ($gameTemp._lowHealthBeepTimer ?? 0) + 1;if ($gameTemp._lowHealthBeepTimer > 15) {AudioManager.playSe({ name: 'Attack1', volume: 100, pitch: 100});$gameTemp._lowHealthBeepTimer = 0;}};const _myEdit2_SceneBattle_terminate = Scene_Battle.prototype.terminate;Scene_Battle.prototype.terminate = function() {_myEdit2_SceneBattle_terminate.call(this);delete $gameTemp._lowHealthBeepTimer;};
forums.rpgmakerweb.com
There's 3 actors but only uses 2 party members in battle. Going for a more paper mario-esc game
if ($gameActors.actor(1).hpRate() < 0.25 || $gameActors.actor(2).hpRate() < 0.25)oki got home and did tried this out, and it DOES work!!
_myEdit1_BattleManager_update.call(this, timeActive);const actor1 = $gameParty.members()[0];const actor2 = $gameParty.members()[1];if ((actor1?.isAlive() && actor1?.hpRate() < 0.25) || (actor2?.isAlive() && actor2?.hpRate() < 0.25))Original thread: https://forums.rpgmakerweb.com/threads/low-health-plugin.182583/