Party Size as a variable?

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Hi everyone,

I ran into a problem - as I cannot predict how many party members the player will control at any given time, balancing combat is a real pain, as encounters will be too hard or too easy...

Is there a way to monitor some sort of ''party size'' variable at any given time? 

I suppose that I could run a parallel process that checks for every actor if that actor is in the party and then add 1 for everyone that's there, but that is both cumbersome and impractical...

Any hints?
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
534
First Language
English
Primarily Uses
N/A
Here's a hint

 

To check the total hp of the currently alive enemy troop members...

Put something like this as the script call option of a conditional branch check (or whatever)

$game_troop.members.compact.select{|i| i.alive? }.inject(0) { |r,i| r += i.hp }
I know it's not exactly what your looking for, but I think the knowledge of how to do what you want to do (or where to look) can be taken from this script call
 
Last edited by a moderator:

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
This stores the current party size (up to the max number of actors in battle, default is 4) in variable 1

$game_variables[1] = $game_party.battle_members.size
Perfect, thanks ^^ 

I guess that running it as parallel process shouldn't cause any problems.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
Oops, didn't know there was an event for that :D

Does this give you the battle party or general party size? General party is uncapped, but only the first X (usually 4) can be in combat.

If your game doesn't give you more than 4 members, then the difference doesn't matter, of course.

/edit: Just tested it, the command gives you the total party size, regardless of battle or not:

Code:
def game_data_operand(type, param1, param2)    case type   (...)    when 7  # Other      (...)      when 1  # number of party members        return $game_party.members.size
 
Last edited by a moderator:

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
564
Reaction score
275
First Language
German
Primarily Uses
/edit: Just tested it, the command gives you the total party size, regardless of battle or not:
Not quite, $game_party.members should be equivalent to $game_party.battle_members during battle:

Code:
class Game_Party  # [...]  #--------------------------------------------------------------------------  # * Get Members  #--------------------------------------------------------------------------  def members    in_battle ? battle_members : all_members  end
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Why would you want to run it as a parallel process? Does your party randomly get new members and lose members? That is the ONLY reason you would want to run it as a parallel process.


You KNOW when your party size is changing - it is when you call the Change Party Members command in any event. Why not just update the variable immediately afterwards?
 

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Why would you want to run it as a parallel process? Does your party randomly get new members and lose members? That is the ONLY reason you would want to run it as a parallel process.

You KNOW when your party size is changing - it is when you call the Change Party Members command in any event. Why not just update the variable immediately afterwards?
I'm afraid that with permadeath and random things that can kill party members ''out of nowhere'' (aka poison etc.) parallel is probably the safer bet. I just have no clue when and who can die and be removed from the party... ^^'

That said yes, everyone else should not use it as parallel process :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
"Killing" party members does not remove them from the party. The party size includes dead party members.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top