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 Profile Posts

so... I decided since a park was an area in my game... here's an enemy that's slide with a hand behind it. cause why not.
Hot chocolate and music make studying and note-taking much easier :kaoluv:
Until my hand cramps up from writing too much!
Doing RPG Maker News for 21st September 2021


Malak is still waiting for Dark Deception Chapter 4... This was him yesterday after another sugar crash.
Again, he's fine. He's just bored at this point, considering he's exhausted his entire vacation bucket list.
Am I the only one who files custom resources under specific folders to remember who to credit? :kaoswt2:
1632263519730.png

Forum statistics

Threads
115,270
Messages
1,088,481
Members
149,874
Latest member
AlolanNinetales
Top