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

*enters defensive mode* - It was only a quick mock up method after all....

I didnt even think of 'what if the actor has already joined' lol

That being said you method is very nice. much more efficient in terms of making the actor 'as it should be' in terms of hp and stats.

I especially like how you yield the actor data for a block - that is very handy. I think I will be throwing that into some of my own code 😛

Overall... I like. Pity it wasnt me that needed the method but I am sure soul will be thrilled with that one 😀
z=$game_variablesz[81]= "acr"x=z[81]z[82]=$game_actors[1].xstat.xHow can I get it so that it reads the x at the end of the call (xstat.x) as the value that x contains. I am trying to make it so I can specify a type of parameter "acr", "str", etc. that I created with crystals extra stats script. So above I want it to function as if i was asking z[82]=$game_actors[1].xstat.acr. as of righ tnow I get an error because it isnt recognizing x as a local variable. Same goes if I try to replace x with the variable z[81]
Use send to dynamically call a method such as this.

Code:
# Example, same as calling `'hello'.reverse`.'hello'.send(:reverse) # => "olleh"# Based on your posted snippet.z = $game_variablesz[81] = 'acr'z[82] = $game_actors[1].xstat.send(z[81])
@Bee - your method was actually calling a .x or .z[81] method on $game_actors which is clearly non-existent

Do this one instead

z=$game_variablesz[81]= "acr"x=z[81]z[82]=eval("$game_actors[1].xstat.".concat(x))though I don't see the use of X so

z=$game_variablesz[81]= "acr"z[82]=eval("$game_actors[1].xstat.".concat(z[81]))that way it first gets the value of z[81], concats it into the $game_actors[1].xstat before evaluating it...
z=$game_variablesz[81]= "acr"z[82]=eval("$game_actors[1].xstat.".concat(z[81]))
No.

Do not do this. This performs the exact same action that I posted, but does it in a significantly slower -- and more error-prone -- way using eval. Usage of eval is extremely ill-advised, particularly when a suitable alternative (like send) exists and can provide the same functionality without the performance hit and peculiarities.

Also, anyone learning Ruby and RGSSx programming, please take the time to learn how to perform tasks without the crutch that is eval. You will thank me for it.
Is there a way to show a battler for the actors, that takes hits and all, like on XP, without using a whole new battle system? The comments on the script file in portuguese gives the impression it'd be just a few lines to make it work, but I can't make it...
@Solistra - Oh I see, never knew that... XD

@Waterguy - Well, there is Yanfly's Visual Battlers though it uses the character sprite as the battler
ah, ok, I'll take a look.
oh, and... is there a way to see an actor's position in the party?
$game_actors[id].index should do it.


0 means leader, 1 means first follower. So your battle members will be 0, 1, 2 and 3.
Thanks, it worked.

Sorry for asking so much, but does anyone know how to see if what was used was a skill or an item?
depends on where you'd want it... normally, the item/skill used is denoted by "item" on the methods that they're handled... from there you could just do something like

item.is_a?(RPG::Skill) to determine if it's a skill or not (meaning it's an item)
Hi.  I'm trying to remove the Party Menu (the one that lets you Fight or Escape).  I've searched for a way and found a snippet of code that Tsukihime had given someone else.  But I couldn't find an original post where the code was given out.  I've been trying to put the snippet into my default scripts, but no matter where I put it or how...I just wind of crashing the whole thing when a battle starts (some times I don't even make it to the battle screen).

Can anybody tell me where this snippet goes, or some other way to get rid of the screen?  There aren't any battles in my game that you can Escape from, so it's pointless to have the screen come up.

Attached the screenshot of the code snippet.

Thanks!

View attachment 14414
thanks! I used item.is_a?(RPG::Item) though, but it worked!
Hey Guys,

I hope this is the right thread for my question.

The default font size of the VX Ace is very big, that is the reason why i set them

to 18 instead of 24. Next step the line_height is set to 18. Now the cursor or

selectable_window is fit to the font, but my SkillMenu used the default fontsize.

My problem now is that the cursor does not fit to the buttons.

How can i resize the cursor only in this Menu.

Here is a picture of the menu:

http://www.directupload.net/file/d/3666/y68h8vno_png.htm

If the code is wanted i will post the script.

Thanks
In Window_Selectable you have this method:

  #--------------------------------------------------------------------------  # * Get Rectangle for Drawing Items  #--------------------------------------------------------------------------  def item_rect(index)    rect = Rect.new    rect.width = item_width    rect.height = item_height    rect.x = index % col_max * (item_width + spacing)    rect.y = index / col_max * item_height    rect  endso you need to make the two methods item_width and item_height. This methods are responsable for the size of the cursor.

If your window inherits from window_selectable just add this two methods to your window and optimize the values. If you already have these methods, just change the values.
How would I go about setting up NPC routines within a game time. For example, Mary can be found in her shop between the times 8am-5pm, but from 6pm till late you can find her in the inn. 

Similary, the best way to set up time restrictions for entering houses (a lot of houses). You cannot enter NPC's homes when its night.

(RMVXAce) 
I think the best would be through game variables...
How would I go about setting up NPC routines within a game time. For example, Mary can be found in her shop between the times 8am-5pm, but from 6pm till late you can find her in the inn. 

Similary, the best way to set up time restrictions for entering houses (a lot of houses). You cannot enter NPC's homes when its night.

(RMVXAce) 
If you want your computer time to set the NPC routes you can use the script below;

http://dekitarpg.wordpress.com/2012/12/24/realtime-effects/

That will allow you to turn on / off switches and whatever using realtime 🙂
Hi.  I'm trying to remove the Party Menu (the one that lets you Fight or Escape).  I've searched for a way and found a snippet of code that Tsukihime had given someone else.  But I couldn't find an original post where the code was given out.  I've been trying to put the snippet into my default scripts, but no matter where I put it or how...I just wind of crashing the whole thing when a battle starts (some times I don't even make it to the battle screen).


Can anybody tell me where this snippet goes, or some other way to get rid of the screen?  There aren't any battles in my game that you can Escape from, so it's pointless to have the screen come up.


Attached the screenshot of the code snippet.


Thanks!
That just goes into a new script slot below Materials. Put it underneath any other custom scripts you have.
Really?  Good god, I'm miserable with scripts.  I thought, this whole time, that it had to replace something in the battle scripts.

All right, Shaz; thank you! 🙂

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