Status
Not open for further replies.

AeroFunk80

Veteran
Veteran
Joined
Aug 25, 2016
Messages
263
Reaction score
143
First Language
English
Primarily Uses
RMMV
*EDIT* I figured it out. Found a script online that you can force a battle to end via an event page. Wanted to share in case anyone else searches for something similar:

This will force the loss and display the battle loss message:
BattleManager.processDefeat();

This will display no battle loss message:
BattleManager.playDefeatMe();
if (BattleManager._canLose) {
BattleManager.replayBgmAndBgs();
} else {
' AudioManager.stopBgm();
}

BattleManager.endBattle(2);

This is for RPG Maker MV.

I'm trying to figure out how to do this. So, in my game you get an auto-battle companion. You can't control them, and they're in a back row using Yanfly's Row Formation. I have it so they help in battle (apply states, heal, etc). However; they can't be attacked by the enemy, damaged, or die. What I want to happen in battle is when the player dies... the encounter ends. This doesn't happen because the system still sees your companion alive.

I fixed this by setting an event page within the battle that checks every turn if the player has the death state applied. If they do, it "aborts" battle. That part works great. Problem is aborting the battle doesn't actually count as the player losing, and the encounter event chases the player right away and triggers another battle to start.

Is there a script or way to force the battle to end when the player dies, but also have it count as a loss so the "If Lose" battle branch kicks in?
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,675
Reaction score
2,760
First Language
EN
Primarily Uses
RMMZ

I've moved this thread to MV Support. Thank you.

You originally posted this in Game Mechanics Design, which is for discussing design ("what to make") rather than implementation ("how to make"). :kaohi:

Thanks for sharing your solution!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

I think that this forum's member posts should include their Phone Number and Social Insurance Number.
My PC just broke with everything I've been working on, on it. I can't afford to replace it. Life is just wonderful....
More musics! Praise be to the winter towns!
i've had the ace attorney investigation theme stuck in my head ever since i woke up TT__TT
more opening cinematic work but i took out the text so you have no context AHAHAHAHAHA >:]]
image.png

Forum statistics

Threads
123,177
Messages
1,154,636
Members
161,544
Latest member
daydreamslug
Top