Party Death/Reserve-Related Condition codes help?

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
I'm using http://www.himeworks.com/2013/05/04/battle-rules/

What is the condition for 

all party members including reserves have state 1?,

all active members have state 1?

(I think that's $game_party.members.all? {|mem| mem.state?(1)} but then I wouldn't know what's the difference between members and battle_members)

and the condition for

is in reserves

(and maybe "is active" as well, I guess I could ask. Since there's a difference between being in reserves, active, and not being included at all)

____________________________

The original defeat condition is

$game_party.all_dead?

and I want something like

$game_party.members.all?{|mem| mem.state(1)}

where all members, including those in the reserved, have state 1

then I'll use either hime's custom page conditions or victor's event conditions

http://www.himeworks.com/2013/03/23/event-page-conditions/

http://victorscripts.wordpress.com/rpg-maker-vx-ace/utility-scripts/events-conditions/

to try and and have it so that when

all active members have state 1?

you are forced to switch out at least one member.

and I'll use http://www.rpgmakervxace.net/topic/8842-choice-options/ and http://www.himeworks.com/2012/12/06/large-choices-built-in-multiple-choices/ to have it so that so long as each actor is in the reserves, their respective choice will be visible. (like if Actor 1 isn't active or included, Choice 1 will not be visible)

and then whoever you select will swap positions with the given dead member
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
What, where the hell did Hime have this script hiding, I may have you check this script out.
 

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
Would you know the condition to make it so that all members, including reserves, need to be dead to have a loss? (or at least the condition of if so)?

I thought it was stupid, like, you have 8 members, your active 4 die, then it's like "Game Overrr" and it's like "Um... wait... we're back here! Four strong! We can help!" "No, Game Overrr"

And yeah, it's like that. You manage to not find certain scripts somehow.
 
Last edited by a moderator:

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
For all members:

$game_party.all_members.all? {|a| a.dead? }For battle members:

$game_party.battle_members.all? {|a| a.dead? }For reserve members:

Code:
($game_party.all_members-$game_party.battle_members).all? {|a| a.dead? }
 
Last edited by a moderator:

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
Wow, thanks! 

How do I condition if a member is reserved or active?

I also don't know how to script-wise condition if someone exists in the party to begin with. I was trying to find that in the script editor
 

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
In the default script, there is no real distinction for reserved and active members. You can check an actor's availability in the party using array include, If an element exists in said array, it will return true, otherwise false.

This will check whether actor no.2 is in the party.

Code:
$game_party.all_members.include?($game_actors[2])
This will check whether actor no.3 is a battle member.
Code:
$game_party.battle_members.include?($game_actors[3])
 

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
Thanks. You're a big help.

I also wanted to know,

How do you return an actor's index, (like $game_actors[1].index or whatever) and is there a way to return the actor id of an actor of a given slot?

Like say I want to know the actor id of actor in Slot 2 via script.

(if not I'll call a comment event each time setting 8 variables to the 8 slots but there are some non-evented situations where I can't do that)
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Thanks. You're a big help.

I also wanted to know,

How do you return an actor's index, (like $game_actors[1].index or whatever) and is there a way to return the actor id of an actor of a given slot?

Like say I want to know the actor id of actor in Slot 2 via script.

(if not I'll call a comment event each time setting 8 variables to the 8 slots but there are some non-evented situations where I can't do that)
Actors in party slots are identified with negative numbers.

-1 is the party leader, -2 is the actor in your second slot, ect.

Say if you had a guest char in slot 3, and you want to make it to where if hr/she dies, you lose, you would use -3 in the Actor id spot of the condition/code.
 
Last edited by a moderator:

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
I don't understand.

I tried $game_actors[-1].hp < 1 and $game_characters[-1].hp < 1 to test and it didn't work

I want to know the index of a given actor,

and the actor of a given index, using script calls, but I'm a bit confused.

like 

$game_actors[1].index

and 

Okay, got that (I think?), just made some mistakes. thanks.

I had to do $game_actors[-1].hp > 1 to test and it returned true... but I don't know if that is correct.

But I don't know how to do

index[-1].actor_id.
 
Last edited by a moderator:

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
$game_actors[-1].hp > 1
This will instead check the HP of the last actor in your game. It is how Ruby handle array.

RGSS3 Help said:
self[nth]


Retrieves the nth item from an array. The index starts from zero. If the nth value is negative, counts backward from the end of the array (the index of the last element is -1). If the nth element does not exist in the array, returns nil.


self[start, length]


Returns an array containing length items from start. If the start value is negative, counts backward from the end of the array (the index of the last element is -1).If length is longer than the length of the array from start, the length of the overlong portion is ignored. Returns nil if length is negative.
You can return the specific actor's index using the array's index method.

Code:
$game_party.battle_members.index($game_actors[n])
 

shiori4me

Veteran
Veteran
Joined
Nov 26, 2013
Messages
196
Reaction score
6
First Language
English
Primarily Uses
I would also think that

$game_party.battle_members.index($game_actors[n])

and

$game_party.members[index].actor.id 

$game_actors[n].index

are the same.
 
Last edited by a moderator:

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,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top