General Question: Where do you find script calls?

**TO CLARIFY** I am aware of this thread of course. But I'm talking about the more obscure stuff that isn't on there. For example, in a previous thread I asked how to get the enemy ID of specific enemies in battle and I got these:

$game_troop.members[0].enemy_id
$game_troop.members.select { |enemy| enemy.enemy_id == 1 }

This is exactly what I needed! But where in the world do you find these things??? How did anyone know this is what you needed to type? Is it hidden in the script editor? The manual? Do I just not understand enough Ruby to figure it out? I don't want to come to the forum and ask for a specific function every single time when, if I knew where to look, I could dig it up myself.

So that's my question. Where do you go to look for these functions to know how to use them yourself?
It has to with both understanding RUBY and RGSS.
When you know both then it's fairly easy to test code and see if you get the results you want.
$game_troop. members. select { |enemy| enemy. enemy_id == 1 }
---- RGSS ------ RGSS ---- RUBY { |RUBY|-- RUBY -- RGSS == 1 }
The RGSS is from the code you find in the help section and the script list.
The RUBY is for knowing how to manipulate the values and pull data required.
Also: Google. With how long VX Ace has been out, chances are almost anything you want to do has been done or asked about before, so you can find the answers in old forum threads, blog posts, Reddit, etc. which all show up if you search for the right terms.
It has to with both understanding RUBY and RGSS.
When you know both then it's fairly easy to test code and see if you get the results you want.
$game_troop. members. select { |enemy| enemy. enemy_id == 1 }
---- RGSS ------ RGSS ---- RUBY { |RUBY|-- RUBY -- RGSS == 1 }
The RGSS is from the code you find in the help section and the script list.
The RUBY is for knowing how to manipulate the values and pull data required.

I get that! I can understand knowing Ruby to figure out the structure of this. But how did we learn, very specifically, that "$game_troop" was the variable to call? That literal exact wording vs, say, "$enemy_troop" "$bad_guys"? Where did we figure that out?

I'm only being so specific because I know this question is difficult to ask since I feel like I don't know enough coding terms. How did we know the names of the variables that RPG maker uses? I don't imagine someone sat and guessed them all.
Also: Google. With how long VX Ace has been out, chances are almost anything you want to do has been done or asked about before, so you can find the answers in old forum threads, blog posts, Reddit, etc. which all show up if you search for the right terms.
This is usually what I've been doing but google is frustratingly difficult. More often than not it wants to bring MV answers to the surface even if you ask it to exclude "MV" and/or old images are no longer hosted and/or what I need to find is actually nowhere to be found...

I have, most times, EVENTUALLY found what I'm looking for and the forums have been helpful. But if there's just a specific place in the program I can look for what I need instead of digging through the internet for an hour I'd much prefer to do that lol
But how did we learn, very specifically, that "$game_troop" was the variable to call?
DataManager
1616021696312.png

aaaaah okay I see it there now! Yeah I really don't understand Ruby/coding enough to totally parse this, that's what I was afraid of. But this is a starting point enough for me and at least answers my question!

Original thread: https://forums.rpgmakerweb.com/threads/general-question-where-do-you-find-script-calls.134520/