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

Working in the IT industry:
- "How long does it take?".
- "It takes 1 month".
- "What if we add more people to the project?".
- "It would take 2 months".
Doing RPG Maker News for 16th September 2021

Stream is live! I am currently doing pixel art and will be practicing shading! Feel free to drop by!
wow, Surface Tension is really one MF of an FPS level huh
So, I got let go from my current job because my skill set didn't align with the department's goals anymore. I have some hope, because I am currently in contact with a manager from a different department, and they are desperate for more employees. We'll see what happens... :kaoswt:

Forum statistics

Threads
115,121
Messages
1,087,375
Members
149,607
Latest member
iamicon
Top