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

one question, when I spawn pre made events to another map, how do I achieve that these events be there permanently?

every time I change a map, they disappear...
You would have to add the event data to the actual .rvdata2 file, or store the premade events in a dummy instance of RPG::Map and overwrite Game_Map's setup method so it adds the events from the dummy map to the one being loaded.
oh... hm.. well, I think I solve my problem in another way... or wouldn't it be as difficult as I think it is?
How do you make the blinking cursor invisible? I hate that when I select items on my menu.
How do you make the blinking cursor invisible? I hate that when I select items on my menu.
Hello! Try making the cursor_rect's width and height 0.
Hello! Try making the cursor_rect's width and height 0.
Ahh, thanks. That worked. I also tried another alternative by erasing the function from update cursor and somehow it works just fine. Thanks for your help.
Ahh, thanks. That worked. I also tried another alternative by erasing the function from update cursor and somehow it works just fine. Thanks for your help.
You're welcome! Yes, that would work too. I think that method uses "cursor_rect.empty". You might want to check that part out too. 🙂
One more question, how can I determine if the actor is in the rear or in front? 
One more question, how can I determine if the actor is in the rear or in front? 
What do you mean? In battle? or the party order from the menu?
In battle. For example, the first two are the ones in front, the last two are the ones in back. I need this so I might ask the question how I can limit targeting the enemies. By that I mean, I have to kill 1 and 2 enemies before I can hit enemies 3 and 4.
In battle. For example, the first two are the ones in front, the last two are the ones in back. I need this so I might ask the question how I can limit targeting the enemies. By that I mean, I have to kill 1 and 2 enemies before I can hit enemies 3 and 4.
That is not supported by default in RPG Maker VX Ace. You would have to program it or find an existing script that adds that functionality.
I guess that's what I should do using index lol.
You are better off using the enemies' screen_x value instead of using their index for that.


It will be much easier to add the enemies to the troop list, because once you add the enemies, and close the editor, there is no way to identify which one got which index.
You are better off using the enemies' screen_x value instead of using their index for that.

It will be much easier to add the enemies to the troop list, because once you add the enemies, and close the editor, there is no way to identify which one got which index.
I see what you mean, but are you saying I have to check each alive enemies and where they are at screen to be called front or rear? Because I want rear enemies untargetable at some point not unless the actor attacking is from the rear as well.
You would have to define what "front" and "rear" are and modify the targeting system accordingly. That's for the mods to decide, but that probably deserves its own thread.
For example you could use a horizontal or vertical line ( I go with horizontal since default is frontview ks). You check all enemies in troop for which one has the highest screen_y value. The enemy and all other enemies with the same value would be the front enemies. So they are the only targetable enemies. Everytime an enemy dies or spawns you would recalculate the highest screen_y value. You could save the result in an instance variable in Game_Troop. End then you give your enemies a method like this:

def front?

  self.screen_y >= $game_troop.front_limit

end

This method would be used to check if the enemy is targetable.

You could also make $game_troop.front_limit a fix value and just modify the targeting system into something like this(pseudo):

targetable = alive_enemies.select {|e| e.front?} # get all front enemies

targetable = alive_enemies if targetable.empty? # set to alive enemies if front enemies are gone

There are other (better) ways to do it, and this is only to give you some idea on how you could solve it.
Thanks, I'm partly able to do it. I have another question about parameters that rather quick, if I may say so. How do you actually get the exact evasion of the actor? Here's the catch, I want to modify the evasion, but since its in the BattlerBase and it just gives me a one line method, how do you exactly get the evasion and place the method on the Game_Actor class?

class Game_Actor < Game_Battler def eva # methods here endendwould this be correct?
You can use super to get the eva value of the Game_BattlerBase superclass and use it to modify it. If there already is an eva method in Game_Actor you can alias it.

eg:

Code:
def eva  super * 0.5end#or better:alias_method(:old_eva, :eva)def eva  old_eva * 0.5end
Aliasing an inherited method can become problematic though:

http://forums.rpgmakerweb.com/index.php?/topic/32850-incorrectly-using-alias-as-super/

So unless you know that Game_Actor itself already defines eva as an instance method, I'm not sure which of these solutions would be better.

@Milena:

The one line method you found is actually the entire definition of the battlers evasion rate. The actual calculation process is done by the method invoked in that line.
Awesome, I can add param things by condition in no time. I have another problem. I have a small sprite where it changes location basing on were the slot window or the index of the slot window is. It's a small line sprite where it indicates which slot I am in and changes the location or where it is basing on what index I am in in the slot window.

Here's a snip of my problem:

case @slot_window.index when 0 if @listselect.y != 180 @listselect.y -= inc_y end when 1 if @listselect.y != 200 && @listselect.y < 200 @listselect.y += inc_y elsif @listselect.y != 180 && @listselect.y < 180 @listselect.y -= inc_y end when 2 if @listselect.y != 226 && @listselect.y < 226 @listselect.y += inc_y elsif @listselect.y != 200 && @listselect.y < 200 @listselect.y -= inc_y end when 3 if @listselect.y != 250 && @listselect.y < 250 @listselect.y += inc_y elsif @listselect.y != 226 && @listselect.y < 226 @listselect.y -= inc_y end when 4 if @listselect.y != 276 && @listselect.y < 276 @listselect.y += inc_y elsif @listselect.y != 250 && @listselect.y < 250 @listselect.y -= inc_y end when 5 if @listselect.y != 298 && @listselect.y < 298 @listselect.y += inc_y elsif @listselect.y != 276 && @listselect.y < 276 @listselect.y -= inc_y end when 6 if @listselect.y != 332 && @listselect.y < 332 @listselect.y += inc_y elsif @listselect.y != 298 && @listselect.y < 298 @listselect.y -= inc_y end when 7 if @listselect.y != 348 && @listselect.y < 348 @listselect.y += inc_y elsif @listselect.y != 332 && @listselect.y < 332 @listselect.y -= inc_y end when 8 if @listselect.y != 370 && @listselect.y < 370 @listselect.y += inc_y elsif @listselect.y != 348 && @listselect.y < 348 @listselect.y -= inc_y end when 9 if @listselect.y != 395 && @listselect.y < 395 @listselect.y += inc_y elsif @listselect.y != 370 && @listselect.y < 370 @listselect.y -= inc_y end endThe sprite moves or scrolls just fine when you press the down button, that means the DOWN arrow on my keyboard, but when I go back or press UP, the sprite just stays there and not go back or change the y location. Any idea why it is so?

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