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

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,057
Reaction score
855
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
565
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
221
Reaction score
172
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've decided to try and be more social and less nervous about engaging. I'm always over thinking things - from now on when I'm worried or don't get something I'll just ask.
Sometimes a mechanic that is meant to add challenge is just annoying. Even the Final Fantasy games did not completely escape this pitfall of design. (FF8 draw system I'm looking at you - grrrr)
starting working on the sprites for one of my games major antagonists finally. here's the first frame of his chanting motion in battle.
Have spent too much time hammering out with a friend just how to make a reoccurring enemy that permanently learns skills you use against her.
I know what I want in a loose sense. Maybe I should just make a post asking for opinions and suggestions.

Forum statistics

Threads
113,737
Messages
1,077,081
Members
147,764
Latest member
ZeroForceX
Top