I'd like to use a conditional branch to test that, but what code to put? Any clue?
MZ Script line to check if the player is in a battle?
Javascript/Plugin SupportThe Game_party has a method inBattle that returns true if the player is in battle.
to call it in the game you would do
to call it in the game you would do
JavaScript:
$gameParty.inBattle()
JavaScript:
$gameParty.inBattle()
Edit:
Dang ninja'd by @rexie09
Do be cognizant of the plugins you're using and how they affect things. For example, if you were leveraging JABS, then
$gameParty.inBattle() would always return true so long as the JABS engine is enabled.Original thread: https://forums.rpgmakerweb.com/threads/script-line-to-check-if-the-player-is-in-a-battle.136896/