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

I don't know if this was already asked. I just want to know how to create a next line when the text reaches the width of the window. Here's the script



Code:
def draw_objective(x, y)
	change_color(system_color)
	draw_text(x, y + line_height * 0, contents.width, line_height, "Current objective:")
	change_color(normal_color)
	draw_text(x, y + line_height * 1, contents.width, line_height, $goal)
end
The $goal here is the objective itself.

Thanks for helping!
How does one check if an SE (sound effect) is playing?

I need the script call for it, but perhaps it doesn't exist...

Oh and it's RGSS3, forgot to mention that.
Working on a game that may or may not go commercial, was wondering what a script writer would charge for creating some scripts for my game. My personal email is [email hidden] if you want your answers to be confidential.
What is the corresponding RGSS3 term for RGSS2's active_battler?
What is the corresponding RGSS3 term for RGSS2's active_battler?
subject would be the equivalent.
Thanks!
I want to create a window which display stuff.

In the code below it shows the text but just for 1 frame.

How i can make it persistent?

Thats my code



Code:
class MyWin < Window_Base
  def initialize
    super 0,0,640,480
    self.windowskin = Bitmap.new(1,1)
    update
  end

  def update
    self.contents = Bitmap.new(640,480)
    self.contents.draw_text(0,0,300,400, "text")
    super
  end
end
just put the super as the first thing in the method ^^

It calls the update method of the super class which, I assume, clears the contents again ^^
Putting it in the first line of the method didnt work.

Do i have to do more than just creating an instance of it for displaying it?
Did you set it as an instance variable in a Scene (eg Scene_Map)?
no i really just did MyWin.new in a npc script.

Can you give me an example how to do it within in a scene till scene creation?
I usually just add it to Scene_Map just put a line that looks like this:



Code:
@my_window = MyWin.new
below everything else in Scene_Maps initialize method, or use this in your script:



Code:
class Scene_Map < Scene_Base
  alias map_init initialize unless $@
  def initialize
    map_init
    @my_window = MyWin.new
  end
end
It does basically the same but is easier to delete afterwards ^^
But what to do if i want to get it working by creating an instance?

I tried something like this, but as expected didnt work. Again just one frame.



Code:
class Test < Scene_Map
    def start
	  super
	  @myWin = MyWin.new
    end

    def terminate
	  super
    end
end
Did you call that scene?

try this:



Code:
class MyWin < Window_Base
  def initialize
    super(0,0,640,480)
    self.windowskin = Bitmap.new(1,1)
  end

  def update
    super
    self.contents.clear
    self.contents.draw_text(0,0,300,400, "text")
  end
end

class My_Scene < Scene_Base
  def initialize
    super
    @myWin = MyWin.new
  end
end
Then make an event and call this in a Script:



Code:
SceneManager.call(My_Scene)
Thank you, that works pretty well!

I might bug you with all my questions, but what if i want to display it on the current scene?
Then you should put the



Code:
@myWin = MyWin.new
line inside that Scenes initialize method like I showed earlier.

You always need to tell a Scene what windows it should have, what could work (didn't test it yet, but it should) to "add" the window later is this:



Code:
class Sceen_Map < Scene_Base
  def create_my_window
	@myWin = MyWin.new
  end
  def remove_my_window
	@myWin.dispose
	@myWin = nil
  end
end
now you can call this in a Script call in an event to show your window:



Code:
SceneManager.scene.create_my_window if SceneManager.scene_is?(Scene_Map)
And don't worry about asking so much ^^

if you want we can continue this via PM and in German 😉

EDIT:

forgot this:

removing the window should work like this:



Code:
SceneManager.scene.remove_my_window if SceneManager.scene_is?(Scene_Map)
hi, I don't want to open up a topic for this so I'm just going to ask here qq

with VX, I'm using KGC's Overdrive w/ custom gauges and I'm also using Star's BattleStatus HUD. the Overdrive bars show and all, but they do not appear to be active and are hung at 0%.

after doing a bunch of compatibility checks and moving x amount of scripts around, I discovered that Star's BattleStatus is causing the Overdrive script to not work during battles. if I remove Star's HUD, the OD gauges work exactly as they are supposed to.

is there perhaps a patch or some other method that may solve the problem? I don't want to remove the BattleStatus HUD but I kinda want an OD-esque system too D:
Where do I go to change the default system font?

I know I can change an individual window's font by doing:



Code:
contents.font.name = "Arial"
How do I do that for the whole game at once?
In main before rgss_main, use:



Code:
Font.default_name = ["imafontname", "optionalsecondfont"]
RGSS3 user here. Can I ask some questions?

1. How do I add a pause or a wait before a battle ends? Or to be more precise, to add a wait function in BattleManager?

2. How do I code an Instant Death state? (I'm using Yanfly Lunatic states to help me with this..)

Applying the Death state instantly seems to break the game often, so I had this idea to call a state that reduces the target's HP instantly to 0 instead once applied.

Though I'm not sure what to put in there since <apply effect: self.hp = 0> doesn't work.

EDIT: Never mind, got it to work after messing with the script files while writing this, so...

2. Can I make a state stack through help of a certain script (or Yanfly Lunatic States)?

Help would be appreciated.

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