Ruby/RGSSx questions that don't deserve their own thread

Hi! (First post)

I have been trying to learn Ruby scripting by dissecting available scripts out there, and I was trying to figure out how to get the index of an actor in the party.  (My google-fu check failed, so if there is an easy/better way to do this--or if this has been asked before--simply point me in the right direction.)

What I have looks something like this:
$game_variables[11]=@battle_members_array.index(self.id)

where we know self to be an actor.

What I get is a run-time error stating "undefined method 'index' for nil:NilClass"

I modeled this line of code after a line found in one of Yanfly's scripts:
"index = @battle_members_array.index(actor_id)"
in a method where he is aliasing the Game_Party's remove_actor method.

My guess is that it is a matter of scope, as my code is within a new method called from a Game_Battler class, but I do not know how to resolve the issue, as my usual approach of mimic=>tinker is not working.

Any help is very appreciated!
you might be looking to using $game_party.battle_members.index(self.id)
Thank you for the reply!  This does fix the error message, but now all party members appear to be returning the same value of 1... which is confusing.
then possibly, self.id is returning the same values, causing the index method to also return the same values
then possibly, self.id is returning the same values, causing the index method to also return the same values
How would one go about checking this?  I don't see why it would return the same values as my (two) party members are different actors.
you can add this line before the $game_party blabhblah call


p self.id


then make sure you run playtest with console enabled... this will print out what the value of the ids are when you call that method
Ah!  A very handy tool I was missing!

Ok, so before I alter the game variable, I print the id to the console and I get 1 and 2 for the two party members (to be expected).

After I supposedly alter the game variable ($game_variables[11]=$game_party.battle_members.index(self.id)) I print the variable (p $game_variables[11]) and it is always 0.
that means they don't exist on the array.. try using self instead of self.id
that means they don't exist on the array.. try using self instead of self.id
It works!  I don't understand why, but it works!  Maybe when I am better rested I can work out the details.

Thank you very much--you've been very helpful!
because the battlers are the ones saved in the array, not their id
So I think I'm ed, but I can't figure out how to get Battle Symphony to mirror an enemy sprite set.  It appears that Yami's Symphoria page is down (and has been for at least two days), and at least on the google cache I can't find any reference to mirroring said sprites.

Ctrl + F'ing through the script looking for "mirror" and "note" didn't illuminate anything for myself either.

I thought a note of <mirror> would, you know, mirror the enemy, but it doesn't.  I know the script has mirror support, but there's a chance it isn't really accessible for the battler-side stuff.  It's not the end of the world as I can just make a new image file with manually flipped versions, but it'd be nice if I could avoid that, you know?  

TL;DR "Battle Symphony + Enemy Characters add on.  How do I mirror a battler?"
I'm trying to reuse the graphic from an event.

In the event I call my script: add_quest which is defined in my script:

class Game_Interpreter  def add_quest( )    event = $game_map.events[@event_id]    p(event.character_name)    p(event.character_index)   //reuse the graphicend
The aim is that I display the same graphic in a window. 

I don't know how to create a sprite or bitmap or whatever based upon the event information. 
@TSED - I do believe I've seen a mirror option somewhere...
I'm trying to reuse the graphic from an event.


I don't know how to create a sprite or bitmap or whatever based upon the event information.
Take a look at the Sprite_Character script (I don't have Ace in front of me, but I think it's only a few lines below Game Interpreter in the list).


There's a method there that updates the sprite based on the character name and index that you're looking at in your method. You pretty much need to just copy the logic (I can't recall the method name - change_sprite or set_sprite or set_character or something like that, but if you do a search in Sprite_Character for character_name you'll find it).


However, what do you intend to do with it? Game_Interpreter doesn't have a sprite, so you can't just blt it. And I don't think it'd be a great idea to CREATE a sprite within that method, because you will either lose it as soon as the method ends or the interpreter ends, or you'll lose the handle and won't be able to dispose it correctly.
Thanks. I found it.

It's just sprite = Sprite_Character.new(@viewport, event)

In the Game_Interpreter I just store a variable which I'm using later. I'm building a quest log and I want the picture of the original quest giver to be displayed. 

In the event I call a method from the Game_Interpreter which stores the quests in an array. When I open the quest log window, it displays the quests. 

So I am not actually displaying the sprite from the game interpreter. I just need to store it for later use. 

It works now. Thanks. 
Is there any snippet of code to change the graphic of a follower that is dead? Because default from engine just gets battle_members and displays them all in the caterpillar.
Nvm, found it, it was a typo pushing the images to x-coord 1044 instead of 104

Anyone know where/how the images for status effects is coded?

I'm using Yanfly+party system, Victor Engine+ATB.
Adjusted the window width of the party battle window.

And now status effects do not appear/are not drawn in the typical location.

Not sure if its a compatability issue or an issue from the statusEffect draw location being pushed off, so locating where its coded would help me greatly.
Please ask questions about script customization in a new thread, and provide a link to the forum thread or blog post where you downloaded each script. Non-RTP scripts can usually be pretty involved and require more investigation and questions than "questions that don't deserve their own thread".
Can anyone think of anything that would hide a Window_Selectable's menu cursor? I'm implementing my own window class which extends it, but for some reason I can't quite figure out, my cursor is gone.

I've already checked that the window is actually open, active and updating. I can click on it (I'm using mouse input) and it registers just fine, and I can still hear the cursor movement sound. The index seems to be correct too, so....I'm out of ideas. Is there something I could have accidentally turned off that tells Window to hide the cursor?

Edit: It looks like the menu background I'm drawing with draw_picture is drawing above the cursor. I don't think there's anyway to specify the cursor z value, so...I guess I have to use a different window to draw the background? :/
why are you drawing a background, above the cursor anyways???

Original thread: https://forums.rpgmakerweb.com/threads/ruby-rgssx-questions-that-dont-deserve-their-own-thread.150/