Is there a way to check if anybody in the party is inflicted with a certain state, not just a specific actor?

MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
380
Reaction score
53
First Language
English
Primarily Uses
RMVXA
I have a few status effects called "sickness". While most of these can be cleared with just using the "pill" item, there are other more severe types of sickness status effects where I want the player to visit a nurse to have removed for a fee. However, I do not want the player to pay if none of the party members have any type of these sicknesses that cannot be removed with an item. Also, I do not want the nurse to remove all states, just the ones I want.

(This is why I do not like "recover all" because it removes all states including XP buffs and other buffs)

I looked in conditional branches and found that I only can choose specific actors for the conditional branches. Not if anybody in the party has a certain state.

Sure, I could nest a couple dozen conditional branches to check all avenues but that would get tedious and confusing very quickly.

Is there an easier way I can check to see if anybody has one of these few states and have the nurse remove them from the entire party (its a pay per visit rather than pay per character)
 
Joined
Jul 12, 2020
Messages
618
Reaction score
342
First Language
English
Primarily Uses
RMMV
As far as I'm aware, you can only check individual states per actor by default, so you will have to use that conditional branch multiple times to just check each possible actor.

However, I want to point out...why not just have your Nurse Check become a Common Event?
So that you are not copying/pasting it over and over again for all your nurse stops? You can find the Common Event tab in your Settings if you're unfamiliar with them.

Just go through the process of making one very thorough check inside a Common Event, and then just use that Common Event call command in your actual game to save yourself the time.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,775
Reaction score
893
First Language
English
Primarily Uses
RMXP
New Method to let you check several states with a single call:

Ruby:
# * Has States? RG * #
#   2023-06-01

# * Script Call * #

# - For XP
#  $game_party.actors[ActorIndex].has_states?(state1, etc.)

# - For VX and VX ACE
#  $game_party.members[ActorIndex].has_states?(state1, etc.)

class Game_Actor
  def has_states?(*new_states)
    states_found = @states & new_states
    states_found.any?
  end
end
 

Latest Threads

Latest Profile Posts

The site is being slow and funky again. IS SOMEONE CRAFTING POEMS?!
So yeah, @TRIDIUM @TESTOSTERONE, I wuz like, "What do they mean by borderline and boundaries?"

And then, y'all know this girl?

actress1.png

alice_bikini.png

The clothes? They're just a, um, quick edit. :kaoswt:
I've uploaded the opening cutscene from my game to my channel. It basically introduces us to the first three characters, and what their relationships are:
Cosmic Inferno: Opening dialogue
I don't want to start a panic...but everyone, check the color of your milk!
IMG_20231002_082329.jpg
My One Map Challenge is nearing completion. I am in the multiple run testing phase atm. This is the map. Beware the minotaurs in the maze area. The female ones are more aggressive. Can you prove to the land of Winchell that a dragon and a human can love each other?

Forum statistics

Threads
135,021
Messages
1,253,015
Members
177,949
Latest member
fefemaker
Top