Okay, taking this process you gave me into other uses, let's say I want to have it so that an actor (4) senses the presence of a powerful dragon from up above.
Normally he would say "blahdiblah do you guys sense that", but what if I want to make sure that he isn't talking to himself?
And if he's the only one who's able to speak, he just won't say anything.
Let's say state 30 is Story-Active, meaning that they didn't die/ etc during the story.
I would want to check if any of actors 1 through 35 (let's just say 8 here) excluding actor 4 have State 30 "Story-Active" applied.
So if I wanted to have the condition
$game_actors[1,2,3,5,6,7,8].state?(30)
um... crap... I don't know if the method you gave me would work for this instance.
How about something like
[1,2,3,5,6,7,8].each {|id| if $game_actors[id].state?(30);return true;else;next;end;return false;}? Where it checks each of the given ids specified an if that actor has state 30 then it will return true and otherwise it will check the next id then lastly return false
Trying it out, the only person I gave the Story-Active state to is Actor 4 (the speaker) and yet it returned true, so Actor 4 said
"Do any of you feel that? \.\.
There's a strong presence around the
area..."
so he ended up basically talking to himself.
Then when I gave any of those following actors State 30, it returned both true and false, meaning he said
"Do any of you feel that? \.\.
There's a strong presence around the
area..."
and then said
"There's a strong presence around the
area..."
To make sure that it wasn't the fact that I was using a Conditional Branch, I had it so that Switch 1 "Condition Met" is false and Actors 1 and 4 had State 30 "Story-Active" on, then made the script call
[1,2,3,5,6,7,8].each {|id| if $game_actors[id].state?(30) then $game_switches[1] = true;else;next;end}then had the conditional branch
if Switch 1 "Condition Met" == true then
"Do any of you feel that? \.\.
There's a strong presence around the
area..."
else
"There's a strong presence around the
area..."
end
and then it worked! He referred to everyone when he spoke.
And then made it so that only actor 4 was story active and then he only spoke to himself! Yay!
So there's something wrong with the way I originally did things with
Code:
[1,2,3,5,6,7,8].each {|id| if $game_actors[id].state?(30);return true;else;next;end;return false;}