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

Is there a script call to show battle transition without entering battle scene in vxace?
follow these steps
https://forums.rpgmakerweb.com/index.php?threads/custom-transitions-screen-wipe.12797/
I'm not a scripter so I dont know how to put word in this.
Let's say I wrote draw_text etc. The text is showing but they dont look nice since I wrote (the content) too long.
I read the help menu and the engine will reduce to 60% when text length exceed the width.
I can't use "enter" to create new line below too 🙁

Is there a way to automatically clean up the wall of text / fit the window (like in word office) ?
If you don't need the alignment option, you can use draw_text_ex instead, that method can process the newline character (it is \n, or \\n in double quote strings), so you can enter \n anywhere in the text, and it will start a new line. The downside of this is the lack of alignment options, so your text will always be left aligned by default.

If you need the alignment option, you can make a new method for it, and address the newline character by yourself.
Something like:
Spoiler
Code:
def draw_text_nl(txt,x,y,w,h,a)
  txt.split("\n").each_with_index do |tx,i|
    yy = y + i * h
    draw_text(x,yy,w,h,tx,a)
  end
end
This is just an example, you can even use a different newline character like the popular | symbol which is also often used for newline processing in codes.
Depending on which class you want to draw the text in, you may need to adjust that code a little. It should work in window classes without any extras though.

There are also some automatic text wrappers around, but they only work with the draw_text_ex method, if I remember right, and they tend to slow down text drawing a bit too.
1. What does this do?
From Yanfly core engine
Spoiler: code
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Forced Action Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# For those who would like to allow the game to remove a forced action
# battler from the queue list, use the switch below. If you don't want to
# use this option, set the switch ID to 0.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
FORCED_ACTION_REMOVE_SWITCH = 0

2. Is there a script to play sound effect when actor's mp is damaged?
[ACE] Just had a quick question - trying to do a method that uses "b.actor.note.include?" but I don't think it seems to work for enemy battlers?

I'm using the method for damage calc. and I wanted to see if I could use note tags to cut down on some states because it's getting too much to manage all the passive abilities on the same page as my status effect/element trait states.

Is there any script that can check if someone is attacking an enemy or actor, and then checking the note tag using the right check for that person?
@AquaDog just need to check first.
b.is_a?(Game_Actor) ? target = b.actor : target = b.enemy

target.note.include?
@Rinoboi That worked perfectly. Thanks!

Much nicer having somebody attack a thing with a note and getting hit with damage/negative state - instead of having two states for it. (Even though I guess the two states did have some pro's to it - in regards to toggling them on/off.)
[VXA] Hi, is there a possible way to change a picture while it's moving? Thanks!
I believe you would have to have both pictures moving and then do a fade out of the first picture to show the second. Can't think of another way.
Is there a script call to change enemy's graphic?
----
nvm found a script that does what I need
I believe you would have to have both pictures moving and then do a fade out of the first picture to show the second. Can't think of another way.
This could work, but assuming that first and second pictures aren't of the same size (second picture larger than the first), or parts of the first picture are transparent, the second picture would be visible before it's supposed to be shown.
I've thought of moving both pictures with the second picture's opacity set to 0, then changing it back to 255 when it's supposed to show, but I don't think there's a way to change only the opacity of a picture. Would that be possible via script call orrrr no?
I don't really see the issue of changing pictures here...

The default engine can only perform linear movement, so there is nothing stopping you from showing the picture, moving it to the place where you want to change it, changing it, and moving it further where you want to after the change.
You know all the positions and the other options of the picture, since you are the one setting them up, so why wouldn't that work?

It would be a different story if the movement could use different easing methods, but there is no such thing by default.
Does anyone know if there's a command I can throw into my script (VX Ace) that will open the console window after deployment (specifically when checking the Encrypted option)? Please @ tag me in your response so I get notified straight away.
@Shaz
Spoiler
Code:
def attach_console 
  # Get game window text 
  console_w = Win32API.new('user32','GetForegroundWindow', 'V', 'L').call 
  buf_len = Win32API.new('user32','GetWindowTextLength', 'L', 'I').call(console_w) 
  str = ' ' * (buf_len + 1) 
  Win32API.new('user32', 'GetWindowText', 'LPI', 'I').call(console_w , str, str.length)   
  # Initiate console 
  Win32API.new('kernel32.dll', 'AllocConsole', '', '').call 
  Win32API.new('kernel32.dll', 'SetConsoleTitle', 'P', '').call('RGSS Console') 
  $stdout.reopen('CONOUT$')   
  # Sometimes pressing F12 will put the editor in focus first, 
  # so we have to remove the program's name 
  game_title = str.strip 
  game_title.sub! ' - RPG Maker VX Ace', ''   
  # Set game window to be foreground. This is purely for user convenience 
  hwnd = Win32API.new('user32.dll', 'FindWindow', 'PP','N').call(0, game_title) 
  Win32API.new('user32.dll', 'SetForegroundWindow', 'P', '').call(hwnd)
end
# Call this at the beginning
attach_console
Taken from:
https://forums.rpgmakerweb.com/index.php?threads/how-to-enable-console-outside-debug-mode.22028/
The code was messed up, as expected, so I fixed it.
Perfect! Thank you 🙂
Hi, so this is something I've been thinking of for awhile - but I kind of needed to have "a thing" happen to every battler on the field during the start/or a turn.

It seems the only way to get what I want so far - is a common event, but then I need a battler to hit everyone with the attack that runs the checking method, and that looks really bad.

But common event's can run scripts - so I was wondering if there's some kind of "translation" guide somewhere to recode a method used by the fake attack into a script?
I'm pretty sure common events can run script calls
You might be doing something wrong
Forgive me. I was writing that right as I was going to work.

-edit because I blather when I'm super nervous-
What I'm trying to do right now is make a simple module right now that displays a message once so I know that the module is working.

I'm trying to use $game_message.add("Text") in the module, but I get a No method error. I'm not sure how to get the mod to understand what that means and how to do it.
@Sixth
Oh no, I'm terribly sorry! I forgot to mention something.
The thing is, the picture (a character portrait) moves along with a message dialogue, I've set it to move to the right by 40 pixels @ 600 frames, 'Wait' box unchecked, so in that way, while the character is speaking, their portraits are moving as well.
Now, there's a part of the dialogue wherein the character changes expression after a message, and that's why I wanted to change the picture while it's still moving. Sadly, I would not be able to tell the coordinates of the picture at that time since the player could've advanced at a message dialogue at any time.
Sorry for the confusion. 😅

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