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

Ohh, I see, that makes sense.

Here is a script I threw together during my coffee break:
Spoiler

You can use it to change the properties of the pictures separately, including the used image for them.
Is there any script commands that can be used to force an actor to use a skill?

I have an ability right now where a character uses an item - and it restores the party's hp and plays a little animation, but it doesn't have a game message for the battle log, and the animation seems to get cancelled when enemies attack right after, so I'd like to have the character take an action instead since that should pause everybody until its done.
Have you tried giving the item a common event which does a forced action?
That seems to be an option, though I would have to make a variable for "item index" that's set when using an item - then and just make scripts in the event for every item in the game.

But I'm guess there might just not be a simple way to have a script call force an action then?
@Sixth
Thank you! It works perfectly, I greatly appreciate it!
I want to be able to make player or event jump a variable's value as distance. So, put variable instead of X or Y in the jump.
Or jump to a location on the map specified by two variables for x and y.
Either one will suffice.
You may have to do conditional branches.
If variable == 1 ; move route x, y
If variable == 2 ; move route x, y
etc
Nope, not doing 40+ branches
That's easy.
Code:
#(jump by distance, x, y)
#Script Call:
$game_player.jump($game_variables[1], $game_variables[2])

#(jump by distance, one direction)
#Script Call:
case $game_player.direction
  when 2
    $game_player.jump(0, $game_variables[1])
  when 4
    $game_player.jump(-$game_variables[1], 0)
  when 6
    $game_player.jump($game_variables[1], 0)
  when 8
    $game_player.jump(0, -$game_variables[1])
end

#(jump to point)
#Script Call:
dx = $game_variables[1] - $game_player.x
dy = $game_variables[2] - $game_player.y
$game_player.jump(dx, dy)
Jump to point, I used it as my own personal snippet
Code:
class Game_Character
  # --------------------------------------------------------------------------
  # Jump to point/coordinate. Coz, I hate to calculate
  # --------------------------------------------------------------------------
  def jump_to_point(xpos, ypos)
    x_dist = xpos - x
    y_dist = ypos - y
    jump(x_dist, y_dist)
  end
 
end
Use it on more route script call
jump_to_point(x,y)

Not much difference from Harosata's
Harosata, gives this error. Incompatible with something I guess
upload_2018-5-8_6-52-15.png

Theo, does that work using a variable as coordinate?
As I understand it, Harasota's code if for putting in a script line (page 3) in an event, not for putting into your scripts.
It will jump your player based on what the variable is set to.
Theoallen's code is a script to put in your script list. Then you use the script call to make the jump. But I think you could combine the two and have the variables in Theoallen's code. Maybe something like this...
Code:
  def jump_to_point(x, y)
   x_dist = $game_variables[1] - x
   y_dist = $game_variables[2] - y
   jump(x_dist, y_dist)
  end
But @TheoAllen will have to confirm.
Yeah I'm slow. That worked, thank you.
Sorry if this is a dumb question - but is there a way to add text to the battle log via scripting from a method?

I have an ability where a character gets hurt - and their attack rises, and I'd like to have a message inserted into the battle log letting players know about the increase.

I've tried using several pop up scripts - but they all seem to have some issues, so I'd like to see how much I could get out of the default battle log for showing information.

If that's not really possible - I have a backup plan (just making animations for stat increases), so this isn't too big of a deal if its not possible.
Adding text to log window is both simple and not.
Simple because you only need to simply call add_text that is located in log window (Window_BattleLog)

It's not simple because maybe you might gonna break stuff of doing something that was not intended (like event script call during battle using event?)

If you really want to know how, first you need a function to access a log window
Code:
class Scene_Battle
  attr_reader :log_window
end
Then you can use script call
Code:
SceneManager.scene.log_window.add_text("..............")

Will this works in evented script call? I won't guaranteed it
Looks like it's working just fine now. Thanks!

I just added Scene_Battle; to the attack method.
And then the scene.log stuff to the contact effect check in the attack method and it hooked up fine.

edit:
I do have one more question about this though if that's okay. Is it possible to maybe reference the names of "a" and "b" in the battle log?
I was wondering if anyone could make some snippets for me? I have 5 skills listed under 'terms' but only want Combat Skills and Spell Casting to show up during battle. I've added a pic to show you what I mean.
@Tanarex : Best you post that under script requests. This thread is for little inquiries like what is the command to do X and stuff like that.
Is there a way to store map size (or just height) into a variable via a command?
I'm currently using an autorun event that saves its Y position into a variable and then erases itself, but putting that into every map is tedious
You can use $game_map.height.

In fact, this snippet will automatically change the variable each time you go to a new map:
Code:
class Game_Map
  alias amn_map_height_gamemap_setup setup
  def setup(map_id)
    amn_map_height_gamemap_setup(map_id)
    $game_variables[1] = height
  end
end
Just change the variable to the number you want to use.

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