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

$game_troop.member[0].xparam(0)

$game_troop.member[0].hit

should both work. xparam does not return an array but takes the parameter index as an argument, so you have to use curved brackets.
oohh... no array? I thought so... well, as I said, like an idiot! m(

thank you!!
$game_troop.members[index].hit  ??

Oh, seems I was wayy late on that one 😛
yeah, it seems I was blind on this, especially I do it right for the actor! ^^"

now I have another problem... I calculate the values for the monster at battle start, everything works fine but one thing: if I lose the battle, the values for the monster are calculated and would be calculated new at next battle, so the values grow higher and higher. I think I have to reload the enemies section of the database at game over screen, but how do I do that... and is this even possible??

/E: well... this question is obsolet, it would ruin my other mechanics, I think I found a much easier way...
I don't want my characters to get an experience in battle. Instead, I want the experience gained from all the battles stored in a variable. How can I go into doing that?
haha, as I am in the same section at the moment... I think you can go to line 346 in BattleManager and change the gain_exp method to store the $game_troop.exp_total value into a variable.

and then when time has come for the actor to gain exp you can call actor.gain_exp(variable) to give him the stored exp... 

I don't tested this, but I think this should work..
module BattleManager def self.display_exp end def self.gain_exp $game_variables[id] = $game_troop.exp_total endendin a new slot in Materials. This will overwrite the methods, so might clash if you've made other changes to them.
I have the vast majority of sudo code for replacing a lesser/worse state for a lesser/worse similar state... I don't feel this needs it's own forum as it's VERY minor  I just don't know what I need to finish it off... also this is a version for all actors affected in status change, as I'm not sure how to get a hold of the creature an enemy hit unless there's only one member in the party...

1. $game_variables[X]=numberActorsInGame

2. for

3.    if $game_variables[X]=0

4.        break loop

5.    end ##end if on line 3

6.     if $game_actor[X-1] inflicted (statusIdStart)

7.          $game_actor[X-1] remove (statusIDStart)

8.          $game_actor[X-1] add (statusIDEnd - probably put in another var)

9.     end ##end if on line 6

10.     X-=1

11 .end ##end for on line 2

While I'm asking for help: How do I get a hold of actor's class in script for use in conditional branch that you don't have to use the event 'check one person at a time for class' stupidity ... you can't even have it check actor (var) for that class... (Has a feeling that $game_actor[id] is going to be VERY powerful once I know everything that can fill in the * in $game_actor[id].*)

Would something akin to 

... $game_actor[$game_variable[X]].class get me the class of the actor with id $game.variable[X] 

I am so sorry guys... every time I re-open the rpgmaker I feel a LITTLE bit closer to what I want to do and a question away from what I actually need to have done...
I don't believe this needs it's own thread so quick question, does RPG Maker/Ruby is it 1.8 its using have Base64 support? or another means to quickly encode and decode a bit of text? its not really to hide anything important anyone really wanting to hack it could but I just want to save a few things encoded in a ini file to stop the noobies ones messing about.
Ruby 1.8 has a Base64 Module: http://ruby-doc.org/stdlib-1.8.7/libdoc/base64/rdoc/Base64.html, but I dont know if RGSS has removed it. You could alternatively use the Marshal Module if you want to store data in an external file which also is in human unreadable format.
Ruby 1.8 has a Base64 Module: http://ruby-doc.org/stdlib-1.8.7/libdoc/base64/rdoc/Base64.html, but I dont know if RGSS has removed it. You could alternatively use the Marshal Module if you want to store data in an external file which also is in human unreadable format.
Looks like its taken out of them engine.
I dont know if it works, but I think you can just install Ruby 1.8 on your PC and use the require keyword to load the Module into your Script. But this would have the effect that everybody who wants to play your game also needs to install ruby.

But like I said if you only want to save something into a file and make it unreadable for humans just use Marshal Module, cause this should be available in RGSS.
Pacattack, if I'm reading your question correctly you want some states which replace themselves with less severe versions, yes? At what point will they be doing this?
@LueLusten

Download a Ruby 1.8 version with the standard library (stdlib) and check out the base64 code. If no .so file is required down the line you will likely be able to copy the code, from however many files that may be, into the script editor and use it.

The primary usefulness of Base64 is that the encoded string does not have weird special characters that might be messed up during transport between systems.

It does not sound like you are using it for that purpose. Instead I would suggest compressed your string using the included Zlib library.

compressed_string = Zlib:😀eflate.deflate(string)# ...string = Zlib::Inflate.inflate(compressed_string)
*hugs*

 - Zeriab
I want to know the current index of the choice I am in, how will I get that? For example, I have 4 choices, and I want to know the current index of my cursor on that particular choice. For instance,

Hello

Hi

Nope

Yeah

and my cursor is on Hi... I would like to get 1 since that is the index of my choice indicated by the cursor. Is this possible?
If you are using a command window, and by 'choices' you mean 'commands' then you use the index variable as so..

Code:
@command_window.index
No, I am using the normal choices, like the Show Choices command 🙂
Then you want

$game_message.choicesSame thing for that window 🙂

Edit:

actually, that will give you the array of the choices, so maybe use something like

Code:
$game_message.choices.index('Choice B')
Try adding this script:

class Window_Message < Window_Base    attr_reader :choice_windowendAfterwards, you should be able to do:

$game_message.choice_window.indexAlthough, you will need to be careful, to only call this while the choice window actually exists.
@LueLusten

Download a Ruby 1.8 version with the standard library (stdlib) and check out the base64 code. If no .so file is required down the line you will likely be able to copy the code, from however many files that may be, into the script editor and use it.

The primary usefulness of Base64 is that the encoded string does not have weird special characters that might be messed up during transport between systems.

It does not sound like you are using it for that purpose. Instead I would suggest compressed your string using the included Zlib library.

compressed_string = Zlib:😀eflate.deflate(string)# ...string = Zlib::Inflate.inflate(compressed_string)*hugs*

 - Zeriab
Base64 is used in many usages but I don't need to hide what it's saying and I not sure what I want to use it all for right now, I want to be able to control most of my game by my launcher from letting the user select settings and it will build the file on the fly.

Online Databasing of the game items and settings but at the moment I having a problem conviting the scripts back to rb only able to do it with the scripts.rvdata2

I am playing with loads of ideas at the moment really.

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