Status
Not open for further replies.

AeroFunk80

Veteran
Veteran
Joined
Aug 25, 2016
Messages
268
Reaction score
148
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,802
Reaction score
2,864
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 Profile Posts

If you are a fan of TRPGs like Fire Emblem, take a moment to help me by filling out this:

Camping inside a hidden cave.
LzSHByh.jpg
I don’t believe in astrology. I’m a Sagittarius and we’re skeptical.
senary_concept_art.png
The concept art for the sprite of Senary, a major character in my upcoming (as-of-yet-unnamed) project. She is known as the Timelord because she can "stop time" by making eye contact with a person; Paralyzing them for a short period of time through a type of hypnosis. Tell me what you think about her. I'm thinking of changing the color of her coat.

Forum statistics

Threads
124,375
Messages
1,163,182
Members
163,167
Latest member
ADude
Top