I cant Get a Gameover text script working

I need some assistance from good scripter(s) im trying to script a game over screen with text, i did find a script but i dont know where to put it, i tried putting it in the gameover script its self nothing, i tried putting it in the materials script list, and it works, but i want to make it so the text box is invisible and it appears at the bottom middle of the screen and make it transition to another text box, this is what the script is that i found:


class Scene_Gameover < Scene_Base
  alias galv_chigoo_gotext_start start
  def start
    galv_chigoo_gotext_start
    create_txt_window
  end
  
  def create_txt_window
    @txt_window = GoText_Window.new
  end
end
class GoText_Window < Window_Base
  def initialize
    super(0, 0, Graphics.width, fitting_height(1))
    draw_message
  end
  def draw_message
    txt = "Your score is " + $game_variables[1].to_s
    draw_text(0,0, Graphics.width, line_height, txt,1)
  end
end


Gameover 1.png


I Just tried this:


class Scene_Gameover < Scene_Base
  alias galv_chigoo_gotext_start start
  def start
    galv_chigoo_gotext_start
    create_txt_window
  end
  
  def create_txt_window
    @txt_window = GoText_Window.new
  end
end
class GoText_Window < Window_Base
  def initialize
    super(0, 0, Graphics.width, fitting_height(1))
    draw_message
  end
  def draw_message
    txt = "Dont Give Up Just Yet" + "Michael Stay Determined"   draw_text(0,0, Graphics.width, line_height, txt,1)
  end
end




But its in one text box still on the top of the screen:


Gameover 2.png:


Please Send a Script to fix this, i cant find anywhere on the internet of how to fix this


P.S (Also Help Make The Menu's and The Battle Buttons look like they do in UNDERTALE, and possibly a bullet hell battle syst. Thanks 😀 )
.........please put that in code tag...this almost unreadable.
.........please put that in code tag...this almost unreadable.

Fixed😛ut Script Text into Code Tag
super(0, 0, Graphics.width, fitting_height(1))

super(x,y,width,height)


this should explain why the stuff is on the top.
super(0, 0, Graphics.width, fitting_height(1))

super(x,y,width,height)


this should explain why the stuff is on the top.

I will mess with the X and Y but the Rest, idk about, im kinda young so its hard to script
Gameover 3.png


I got it in the spot i want it (Still debaiting on 250 or 300 y) how do i change the font, font size, and make the textbox invisible, and make changing text
Code:
class GoText_Window < Window_Base
  def initialize
    super(0, 0, Graphics.width, fitting_height(1))
    draw_message
    set_opacity
  end
  
  def draw_message
    txt = "Dont Give Up Just Yet" + "Michael Stay Determined"   
    draw_text(0,0, Graphics.width, line_height, txt,1)
  end
  
  def set_opacity
  self.opacity = 0
  end
  
end
def initialize
super(0, 0, Graphics.width, fitting_height(1))
if(Font.exist?("Font name")
contents.font = Font.new("Font name", size)
end
back_opacity = 0
opacity = 0
draw_message
end




That should fix your issues, but I recommend if you want to continue working with scripting, you also check out the manual for a little explanation on how the internals of RM work. Getting good at scripting is going to take time, for sure, but if you're serious about it just keep trying and you'll learn with time. Learning to program is no easy job, and it will take you a long time to do, but it can really pay off in the long-run.


Also, more of a personal thing, don't capitalize every word in your sentence. It looks really stupid. You don't do it in any of your posts, so don't do it in you window.


And finally grammar critique: Try, "Don't give up just yet, Michael, stay determined!" Having it as two separate sentences like that is odd and most likely not grammatically correct.
Code:
class GoText_Window < Window_Base
  def initialize
    super(0, 0, Graphics.width, fitting_height(1))
    draw_message
    set_opacity
  end
  
  def draw_message
    txt = "Dont Give Up Just Yet" + "Michael Stay Determined"   
    draw_text(0,0, Graphics.width, line_height, txt,1)
  end
  
  def set_opacity
  self.opacity = 0
  end
  
end

Gameover 4.png


Its getting there 😛  btw thanks for helping me out
def initialize
super(0, 0, Graphics.width, fitting_height(1))
if(Font.exist?("Font name")
contents.font = Font.new("Font name", size)
end
back_opacity = 0
opacity = 0
draw_message
end




That should fix your issues, but I recommend if you want to continue working with scripting, you also check out the manual for a little explanation on how the internals of RM work. Getting good at scripting is going to take time, for sure, but if you're serious about it just keep trying and you'll learn with time. Learning to program is no easy job, and it will take you a long time to do, but it can really pay off in the long-run.


Also, more of a personal thing, don't capitalize every word in your sentence. It looks really stupid. You don't do it in any of your posts, so don't do it in you window.


And finally grammar critique: Try, "Don't give up just yet, Michael, stay determined!" Having it as two separate sentences like that is odd and most likely not grammatically correct.



Error.png


Now im getting an error msg


what did i do wrong

Code:
class Scene_Gameover < Scene_Base
  alias galv_chigoo_gotext_start start
  def start
    galv_chigoo_gotext_start
    create_txt_window
  end
  
  def create_txt_window
    @txt_window = GoText_Window.new
  end
end
class GoText_Window < Window_Base
 def initialize
    super(0, 0, Graphics.width, fitting_height(1))
    if(Font.exist?("8bitoperator JVE")
        contents.font = Font.new("8bitoperator JVE", size)
    end
  end
    back_opacity = 0
    opacity = 0
    draw_message
  end
  
  def draw_message
    txt = "You cannot give up just yet..." + "Michael Stay determined..."   
    draw_text(0,0, Graphics.width, line_height, txt,1)
  end
  
  def set_opacity
  self.opacity = 0
 end
end
I forgot a close parenthesis on the end of the Font.exist? if statement. Just add one on the end of the line, it was my mistake.
Ok now im confused??


Error.png


Please see if you can fix this, idk what that even means

Code:
class Scene_Gameover < Scene_Base
  alias galv_chigoo_gotext_start start
  def start
    galv_chigoo_gotext_start
    create_txt_window
  end
  
  def create_txt_window
    @txt_window = GoText_Window.new
  end
end

class GoText_Window < Window_Base
 def initialize
    super(0, 0, Graphics.width, fitting_height(1))
    if(Font.exist?("8-bit Operator+"))
        contents.font = Font.new("8-bit Operator+", size)
    end
  end
    back_opacity = 0
    opacity = 0
    draw_message
  end
  
  def draw_message
    txt = "You cannot give up just yet..." + "Michael Stay determined..."   
    draw_text(0,0, Graphics.width, line_height, txt,1)
  end
  
  def set_opacity
  self.opacity = 0
 end
I got the game to run again, i ALMOST got it, i have some tweaking to do and it should work, when its done ill send the pic and the script, and possibly get help on more scripting
This is the best i can do so far, i dont know how to have alternating/changing text (help with that would be nice please 🙂 ) so here it is


class Scene_Gameover < Scene_Base
alias galv_chigoo_gotext_start start
def start
galv_chigoo_gotext_start
create_txt_window
end

def create_txt_window
@txt_window = GoText_Window.new
end
end

class GoText_Window < Window_Base
def initialize
super(0, 300, Graphics.width, fitting_height(1))
if(Font.exist?("8-bit Operator+"))
contents.font = Font.new("8-bit Operator+", 25)
draw_message
set_opacity
end
end

def draw_message
txt = "You cannot give up just yet... "+"Michael, Stay Determined..."
draw_text(0,0, Graphics.width, line_height, txt,1)
end

def set_opacity
self.opacity = 0
end
end


Gameover 5.png
Does anyone else know what else i can do to the script to make alternating/transition/changing text

Original thread: https://forums.rpgmakerweb.com/threads/i-cant-get-a-gameover-text-script-working.59144/