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,800
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

Okay... I'm injured and stuck in bed with a bad knee. And I'm only 24! I shouldn't be limping this badly, but my leg refuses to fully straighten and it hurts if I try to push it.
At least I have my games to work on.
RianQuenlin wrote on Iron_Brew's profile.
To elaborate on "safety" since bgillisp locked the thread, some lunatics will take reports personally and decide to harass people who file reports or otherwise complain about them. Me, I don't care but others seeing that might nope right out of discussion. Being a former mod back in the mid-2000s for some gaming forums in by BYOND days I can tell you some people go crazy.
Excitement: I've spent the last week making a little update package for VE Fog & Overlay, and finally got it working in my test environment!

Dread: Sigma fullscreen and Zeus's map effects are screaming at me when I add them into the mix.
ScreenShot_8_7_2022_0_23_50.png
Unleash the hype beam...
hjyI4gQ.png


Made an attachment for the HUD that I can control the visibility of with switches. This tracks the current amount of items needed to finish a quest. Once you meet the requisite, it turns into "complete" because I figured it would be a good way to tell the player they're done. Also it stops numbers from going off of the UI.

Forum statistics

Threads
124,330
Messages
1,162,814
Members
163,123
Latest member
Introvertebrate
Top