RMMZ Script line to check if the player is in a battle?

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,071
Reaction score
863
First Language
French
I'd like to use a conditional branch to test that, but what code to put? Any clue?
 

rexie09

Villager
Member
Joined
Apr 4, 2021
Messages
26
Reaction score
10
First Language
English
Primarily Uses
RMMZ
The Game_party has a method inBattle that returns true if the player is in battle.

to call it in the game you would do
JavaScript:
$gameParty.inBattle()
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
975
Reaction score
567
First Language
Javascript
Primarily Uses
RMMZ
I'd like to use a conditional branch to test that, but what code to put? Any clue?
JavaScript:
$gameParty.inBattle()
that will return true if the party is in battle :)

Edit:
Dang ninja'd by @rexie09
 

Jragyn

JABS codemonkey
Veteran
Joined
Aug 14, 2012
Messages
223
Reaction score
173
First Language
English
Primarily Uses
RMMZ
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

 …I think I might need to switch from standard ATK/DEF up/down buffs to parameter altering states. I just had an actor whose usual attack against an enemy does ~25 do a buffed attack against a debuffed enemy for ~600…
just saw that titan quest is free on steam until the 23rd
Zombie status is now complete. I didn't have to do much in the way of changing how healing is applied to undead targets, was just a simple 3 line code. I thought I had to overhaul Game_Action lol. Everything else was doable by events. So.. Zombie: You turn undead. Your element changes to darkness. You're weak to light, you're strong to physical attacks and healing hurts you and revival items will kill you.
My Overworld might be a mix of inspiration from 2D Final Fantasy games, Breath of Fire, Battlechasers: Nightwar, Super Mario World, and Pillars of Eternity. If I can make it more in-depth than just walking from point A to point B, that might do a lot for the gameplay experience. Hmm...

Forum statistics

Threads
115,225
Messages
1,088,214
Members
149,815
Latest member
MaeBski
Top