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

I'm using the Ace Menu Engine and the XS - Journal script together. I'm trying to add an option to open the journal through the menu.

XS Journal has these instructions:

"# Scene_Journal is the name to add for any custom menu script."

the syntax to add a custom command to the Ace Menu Engine is this:
    # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],

so I tried: (0 enable switch and showswitch make it default to enabled and show, respectively)

 :journal => [ "Journal",            0,        0, :Scene_Journal],

However, it crashes when I try to access the menu with the error:

"Script 'Yanfly Ace Menu System' line 633: NameError occurred.

undefined method 'Scene_Journal' for class 'Scene_Menu'

thanks in advance guys~
Did you try re-arranging the scripts.
I have, above or below the menu script doesn't seem to change anything.

Also, the call script command for the journal is this:
SceneManager.call(Scene_Journal)
I'm using the Ace Menu Engine and the XS - Journal script together. I'm trying to add an option to open the journal through the menu.

XS Journal has these instructions:

"# Scene_Journal is the name to add for any custom menu script."

the syntax to add a custom command to the Ace Menu Engine is this:

    # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],

so I tried: (0 enable switch and showswitch make it default to enabled and show, respectively)

 :journal => [ "Journal",            0,        0, :Scene_Journal],

However, it crashes when I try to access the menu with the error:

"Script 'Yanfly Ace Menu System' line 633: NameError occurred.

undefined method 'Scene_Journal' for class 'Scene_Menu'

thanks in advance guys~
Ace Menu Engine requires a handler method in Scene_Menu, not the name of the scene class.

Install this piece of code in the materials section of your script editor:

class Scene_Menu < Scene_MenuBase  def command_xs_journal    return unless $imported["XAIL-JOURNAL-SYSTEM"]    SceneManager.call(Scene_Journal)  endend

Change the custom command definition in YF's menu script to this:

:journal => [ "Journal",            0,        0, :command_xs_journal],I didn't test it at all so let me know if it doesn't work.
works perfectly, calls the script just like an event would. Thanks so much~
I want an event that represents any enemy basing on its id on the database. Like for example, Event 040 is Enemy 01 on the database...

its like the ones used on making the enemies fight you on the map.

What are the basics on how to actually touch this?
Hello, how can i show an animation on map position over a specific event, using code?
@soulpour, the snippet i previously sent you can do what your asking by nametagging events.

@Tridel

There is no need to use code to display an animation for an event.

Simply look through the event pages and you should see 'Display animation' or something similar. then you just set which event has the animation and your done.
Presumably Tridel has a script that is supposed to show an animation.
For the animation question, isn't it inside the Game Interpreter?

The help file also helps...
$game_map.events[event_id].animation_id = anim_id


where event_id is your event's id, and anim_id is the animation id in the database. Don't use leading zeros for either.


But yes, if you're doing this in events, you don't need to use the script. Show Animation will let you target any event.
Is there a script call to change the players movement speed, and graphic?

I'm asking because I have an event that changes his speed when he steps on a region. However I have a jumping script on, and if the player jumps over a region, the set move route messes up the player and he continues to walk forward until colliding with a wall or another region.
Presumably Tridel has a script that is supposed to show an animation.
lol didnt even think of that 😛

Is there a script call to change the players movement speed, and graphic?
pretty sure thats a no. sorry. 

edit, actually there probably will be, but whether you should change it or not is a different question, i once made a progressive movement script (speed got slower as stamina went down) and it completely messed with the jump feature of ace, all my tiles and such ended up out of place because i was jumping like "half a square"
Is there a script call to change the players movement speed, and graphic?

I'm asking because I have an event that changes his speed when he steps on a region. However I have a jumping script on, and if the player jumps over a region, the set move route messes up the player and he continues to walk forward until colliding with a wall or another region.
Code:
$game_player.instance_variable_set(:@move_speed, INT)
Replace INT with an actual number to change the speed of the player.
Code:
$game_player.set_graphic(STR, INT)
Replace STR with the name of the file (without the extension and with quotes) and INT with the index of the character in the file (that would be the row/column location of the character).
Thanks Kread-Ex. works perfectly.
 

@Dekita
What I did was I made sure the event/script doesn't work if the player is currently jumping.

The move routes, when applied without asking if the player is jumping would make the character continue to walk until it hit the wall.
When it asks if the player is not jumping, it works fine about 80% of the time.
Now with the script call, it seems to work 100% of the time. Something in the move route was conflicting with the jumping mechanic.

sandz.jpg
$game_map.events[event_id].animation_id = anim_id

where event_id is your event's id, and anim_id is the animation id in the database. Don't use leading zeros for either.

But yes, if you're doing this in events, you don't need to use the script. Show Animation will let you target any event.
Thanks Shaz, but it didnt work fine, because it shows me the animation various times, how can i do something like a autorun event where it stop all the game, run the animation in the position specified, wait for completion and continue the game? 
Why are you doing it via script instead of in an event? Doing it in an event will let you do the animation once, make the player wait until the animation is finished, then continue the game - whether that means giving control back to the player or doing something else first.


Perhaps if you explain WHAT you're trying to accomplish, rather than asking how to do an animation via script, might let us help you better. It's possible using a script is not the best way to go about it.
Thanks. Well im doing a turn based game so i have a paralell event that checks constanstly which is the player turn, and when a player is next to an enemy it attacks it and then i need that the animation runs, but also i need that my paralell event stop of check turns. This is my problem.

EDIT: I think that the solution is using the method animation?

#-------------------------------------------------------------------------- # * Determine if animation is being displayed #-------------------------------------------------------------------------- def animation? @animation != nil endBut i cant understand which is the class that controls it or how can i evaluate it. =( 
If your parallel event is what makes the player attack the enemy, just add the animation in there, to the parallel event, and check the Wait button. It will stop checking turns until the animation is done.
Something in the move route was conflicting with the jumping mechanic.
Yep, if you look into the method that makes an actor jump , you will see that is uses the @move_speed variable while calculating the jump distance, thats what caused it to mess me around 🙂

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