MAKING PARTY MEMBERS SPEAK DEPENDING ON THEIR "STATE"
Posts
Pages:
1
Using the conditional branch tool, is there a way to search an entire party for anyone who might have a particular state and make them speak, without repeating the conditional branch for each possible actor in the party?
Example - If ANY actor in current the party has STATE #1, say "Blah".
I do NOT want to do this:
if actor 1 has STATE 1, say "blah"
if actor 2 has STATE 1, say "blah"
if actor 3 has STATE 1, say "blah"
if actor 4 has STATE 1, say "blah"
if actor 5 has STATE 1, say "blah"
etc... I'm trying to avoid repetitive/tedious branching.
Example - If ANY actor in current the party has STATE #1, say "Blah".
I do NOT want to do this:
if actor 1 has STATE 1, say "blah"
if actor 2 has STATE 1, say "blah"
if actor 3 has STATE 1, say "blah"
if actor 4 has STATE 1, say "blah"
if actor 5 has STATE 1, say "blah"
etc... I'm trying to avoid repetitive/tedious branching.
Well, searching the party to see if any member in the party has the state in question would probably be more doable if you have access to scripts. Like, I'm using Ace, and I'm coming up with something that looks like...
...this. In theory, this would store the name of the first actor that meets the conditions (ie: has the state), and the text to display, into game-variables. While this might be able to have a Message Box with "\v[1]" to display the text, and "\v[2]" to display the name of the character who's talking (and has the state), I'm not sure how to set up a portrait within the Message Box without a Conditional Branch for each character that could be in the party. Maybe that's not a concern here. However, it could be done with more scripting. However, at this point, I'm not necessarily sure how viable a scripting solution is for you.
def party_state?(state_id, text) i = 0 while i < $game_party.members.size actor = $game_party.members[i] if actor.state?(state_id) == true $game_variables[1] = text $game_variables[2] = actor.name return true end i += 1 end return false end
...this. In theory, this would store the name of the first actor that meets the conditions (ie: has the state), and the text to display, into game-variables. While this might be able to have a Message Box with "\v[1]" to display the text, and "\v[2]" to display the name of the character who's talking (and has the state), I'm not sure how to set up a portrait within the Message Box without a Conditional Branch for each character that could be in the party. Maybe that's not a concern here. However, it could be done with more scripting. However, at this point, I'm not necessarily sure how viable a scripting solution is for you.
Pages:
1














