Accessing Instance Variables from other Classes [VX Ace] (SOLVED)

Hey all!

Edit - Sorry to bother you!
Turns out it was just a simple writing error and of the 8 or 9 different ways I tried to write it, it was actually the 10th way after all.

Have wonderful lives everyone!
Aaaaaaaaaand solved it!

Lol, turns out I was just getting the wording wrong when calling it after all.

I had to do this:
$game_actors[1].s_a_turn

I tried so many variants, turns out I missed the s on the actor with array version lol.

Oh deary. Sorry to bother you all.
I think it's $game_actors[1].s_a_turn so the script line would be if $game_actors[1].s_a_turn == 1

$game_actors is an array that holds a bunch of actor objects which are created during the (beginning of the) game. Since it's global (as marked by the $), you can access it from anywhere. 1 is the SECOND index within the array (which starts at 0). $game_actors[1] will return an actor, if the array has an entry at Index 1. s_a_turn is a property for the Actor object, so you write out the actor object, then a dot (.), then the property you want to get the value of.

Also, I recommend looking into modulo methods (I think the Ruby syntax would be if $game_actors[1].s_a_turn % 2 == 0 to check whether the remainder when dividing by 2 is 0; i.e. the number is even) in order to streamline that big jumble of code you have going from 1 to 10.
Glad you got it on your own. I'll go ahead and close this.

Thread closed a

Original thread: https://forums.rpgmakerweb.com/threads/accessing-instance-variables-from-other-classes-vx-ace-solved.124564/