Game over events

LuciferSynd

Veteran
Veteran
Joined
Oct 22, 2013
Messages
34
Reaction score
0
First Language
Italian
Primarily Uses
Hello there.

I am trying to set up a particular game over event for a specific enemy.

The problem is... I found just one script online, that can be found at this link: http://rpgmaker.net/scripts/334/

My problem is... After I install it, I get an error of the sort "NilClass" < or something like that.

As well, when I tried to correct it by changing the sign from < to =, it didn't show any errors, but the method that the author is suggesting (create a comment under the troop section) still doesn't work. I tried both using the numbers and the names of the common events to call the gameover.

Can anyone help me or suggest an alternate way?

This is happening because I want to set a particular gameover screen to certain troops.

Thank you very much for the future replies!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Is your battle called from an event? If so, just check the "continue even when loser" box, and in the "when lose" condition, do what you need to do, then call the game over screen.
 

LuciferSynd

Veteran
Veteran
Joined
Oct 22, 2013
Messages
34
Reaction score
0
First Language
Italian
Primarily Uses
Is your battle called from an event? If so, just check the "continue even when loser" box, and in the "when lose" condition, do what you need to do, then call the game over screen.
Well, no...

Of course for bosses I do that already to create a nice "bad ending" instead of a simple gameover screen.

This particular thing is for random encounters of a very specific kind of monster.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Maybe this will help you?


I'm not sure if this is the script I was thinking of, but I remember SOMEONE writing a script that gave you more control over troop events at the end of battle (they wouldn't run properly, or something, if the battle was over).
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
After I install it, I get an error of the sort "NilClass" < or something like that
Would be more useful if you just took a screenshot of the error.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
lol - I didn't realize the link I gave you was the same one you originally posted. Sorry.
 

LuciferSynd

Veteran
Veteran
Joined
Oct 22, 2013
Messages
34
Reaction score
0
First Language
Italian
Primarily Uses
Shaz, it's ok, don't worry.

But I tried it again (perhaps I forgot to copy something) and it still doesn't work. The error I get is the following:

 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Did you paste it into the correct area? It should be below Materials and above Main.
 

LuciferSynd

Veteran
Veteran
Joined
Oct 22, 2013
Messages
34
Reaction score
0
First Language
Italian
Primarily Uses
Did you paste it into the correct area? It should be below Materials and above Main.
Yeppers, it is indeed under Materials and above main, just under other scripts I already have installed.
 

LuciferSynd

Veteran
Veteran
Joined
Oct 22, 2013
Messages
34
Reaction score
0
First Language
Italian
Primarily Uses
My script has less than 581 lines
All I did was going into your page, click on the gameover events download and copy everything into a new page under Materials and above Main.

I can assure you that I did not by any chance copied something else except the content of the whole script downloading page.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Maybe you can post what you copied so we can see what might have caused the problem. If your script has more lines than what I have then I can't tell you what's wrong by looking at my own script.
 

LuciferSynd

Veteran
Veteran
Joined
Oct 22, 2013
Messages
34
Reaction score
0
First Language
Italian
Primarily Uses
Ok. This is the whole script that I copied inside my RPG Maker Vx Ace:

Code:
 =begin#=============================================================================== Title: Gameover Events Author: Tsukihime Date: Oct 1, 2013-------------------------------------------------------------------------------- ** Change log Oct 1, 2013   - Initial release--------------------------------------------------------------------------------    ** Terms of Use * Free to use in non-commercial projects * Contact me for commercial use * No real support. The script is provided as-is * Will do bug fixes, but no compatibility patches * Features may be requested but no guarantees, especially if it is non-trivial * Credits to Tsukihime in your project * Preserve this header-------------------------------------------------------------------------------- ** Description  This script allows you to replace the default gameover scene with an event. This gives you more control over how the gameover scene should process.  A gameover event is a common event and is assigned to different objects. There are several different scopes of gameover events.  1. Troop gameover events. These occur when you gameover during battle.  2. Map gameover events. These occur when you gameover on the map.  3. System gameover events. If this is set, then it will run instead of the    above -------------------------------------------------------------------------------- ** Installation  Place this below Materials and above Main.-------------------------------------------------------------------------------- ** Usage  To create a troop gameover event, create a comment of the form    <gameover event: event_id>    To create a map gameover event, in the map's notebox, tag it with    <gameover event: event_id>    To set a system gameover event, make the script call    set_gameover_event(event_id)    Where the `event_id` is the ID of the common event that will run as the gameover event. If the system event is 0, then either the troop or map events will run. If you want to force the default gameover screen, set the ID to -1  Note that you need to press the C button again after the event finishes to go back to the title screen (if your event does not handle this) #================================================================================end$imported = {} if $imported.nil?$imported["TH_GameoverEvent"] = true#===============================================================================# ** Configuration#===============================================================================module TH  module Gameover_Event    Regex = /<gameover[-_ ]event:\s*(\d+)\s*>/i  endend#===============================================================================# ** Rest of script#===============================================================================module RPG  class Troop    def gameover_event_id      load_gameover_event_id unless @gameover_event_id      return @gameover_event_id    end        def load_gameover_event_id      @gameover_event_id = 0      @pages.each do |page|        page.list.each do |cmd|          if cmd.code == 108 && cmd.parameters[0] =~ TH::Gameover_Event::Regex            @gameover_event_id = $1.to_i            return          end        end      end    end  end   class Map    def gameover_event_id      load_gameover_event_id unless @gameover_event_id      return @gameover_event_id    end        def load_gameover_event_id      @gameover_event_id = 0      res = self.note.match(TH::Gameover_Event::Regex)      if res        @gameover_event_id = res[1].to_i      end    end  endend#-------------------------------------------------------------------------------# Sprites used during the game over screen#-------------------------------------------------------------------------------class Spriteset_Gameover  def initialize    create_viewports    create_pictures    create_timer    update  end   def create_viewports    @viewport1 = Viewport.new    @viewport2 = Viewport.new    @viewport3 = Viewport.new    @viewport2.z = 50    @viewport3.z = 100  end   def create_pictures    @picture_sprites = []  end   def create_timer    @timer_sprite = Sprite_Timer.new(@viewport2)  end   def dispose    dispose_pictures    dispose_timer    dispose_viewports  end   def dispose_pictures    @picture_sprites.compact.each {|sprite| sprite.dispose }  end   def dispose_timer    @timer_sprite.dispose  end   def dispose_viewports    @viewport1.dispose    @viewport2.dispose    @viewport3.dispose  end   def update        update_pictures    update_timer    update_viewports  end   def update_pictures    SceneManager.scene.screen.pictures.each do |pic|      @picture_sprites[pic.number] ||= Sprite_Picture.new(@viewport2, pic)      @picture_sprites[pic.number].update    end  end   def update_timer    @timer_sprite.update  end   def update_viewports    @viewport1.tone.set(SceneManager.scene.screen.tone)    @viewport1.ox = SceneManager.scene.screen.shake    @viewport2.color.set(SceneManager.scene.screen.flash_color)    @viewport3.color.set(0, 0, 0, 255 - SceneManager.scene.screen.brightness)    @viewport1.update    @viewport2.update    @viewport3.update  endend#-------------------------------------------------------------------------------##-------------------------------------------------------------------------------class Game_System   attr_accessor :gameover_event_id   alias :th_gameover_event_initialize :initialize  def initialize    th_gameover_event_initialize    @gameover_event_id = 0  endend#-------------------------------------------------------------------------------##-------------------------------------------------------------------------------class Game_Troop   def gameover_event_id    troop.gameover_event_id  endend#-------------------------------------------------------------------------------##-------------------------------------------------------------------------------class Game_Map   def gameover_event_id    @map.gameover_event_id  endendclass Game_Interpreter   alias :th_gameover_event_screen :screen  def screen    return SceneManager.scene.screen if SceneManager.scene_is?(Scene_Gameover)    th_gameover_event_screen  end   def set_gameover_event(event_id)    $game_system.gameover_event_id = event_id  endend#-------------------------------------------------------------------------------##-------------------------------------------------------------------------------class Scene_Gameover < Scene_Base   attr_reader :screen   alias :th_gameover_event_start :start  def start    @gameover_event = get_gameover_event    @interpreter = Game_Interpreter.new    @message_window = Window_Message.new    @screen = Game_Screen.new    @spriteset = Spriteset_Gameover.new    if @gameover_event      super      @sprite = Sprite.new      @sprite.bitmap = Bitmap.new(1,1)      play_gameover_event    else      th_gameover_event_start    end  end   alias :th_gameover_event_update :update  def update    th_gameover_event_update    if @gameover_event      @spriteset.update      @screen.update      update_interpreter    end  end   alias :th_gameover_event_terminate :terminate  def terminate    @spriteset.dispose    th_gameover_event_terminate  end   alias :th_gameover_event_goto_title :goto_title  def goto_title    @gameover_event = nil    th_gameover_event_goto_title  end   def play_gameover_event    @interpreter.setup(@gameover_event.list)  end     #-----------------------------------------------------------------------------  # Get gameover event depending on how gameover was triggered  #-----------------------------------------------------------------------------  def get_gameover_event    if $game_system.gameover_event_id != 0      if $game_system.gameover_event_id < 0        return nil      else        return $data_common_events[$game_system.gameover_event_id]      end      elsif $game_party.in_battle && $game_troop.gameover_event_id != 0      if $game_troop.gameover_event_id < 0        return nil      else        return $data_common_events[$game_troop.gameover_event_id]      end    elsif $game_map.gameover_event_id != 0      if $game_map.gameover_event_id < 0        return nil      else        return $data_common_events[$game_map.gameover_event_id]      end    else      return nil    end  end   def update_interpreter    @interpreter.update  endend
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
That's only 316 lines. This script couldn't possibly give you an error on line 581 if that is all you have in the slot named gAME OVER.


Can you copy and paste the ENTIRE CONTENTS of the script you have called gAME OVER? Add spoiler tags and code tags around it to maintain formatting.


Do you have more than one script with the name gAME OVER? Have you combined another script with this one in the same slot?


If you get the error and your game crashes, then you hit F11, it should take you to the script editor, straight to the line that's causing the error. Can you copy that line and paste it here as well?


Aaaand, just for one extra check ... when you added this script, did you start a new game, or did you load a save file? Trying to play a save file that was created BEFORE you added a script, MAY cause problems with new scripts, because sometimes class variables that should have been initialized (with a new game) will not have been, and you'll get errors/crashes when trying to access them.
 
Last edited by a moderator:

LuciferSynd

Veteran
Veteran
Joined
Oct 22, 2013
Messages
34
Reaction score
0
First Language
Italian
Primarily Uses
Ok. Just following your suggestions, I copied again the whole thing and reposted it. I have no idea what happened the first time, why there were 581 lines.

But now that there are 316 and I confirm it, I still get the same error:



The line that it is referring to is the following:

if $game_system.gameover_event_id < 0
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Yes, and my other question? Are you playing a saved game, or did you start a new game?
 

LuciferSynd

Veteran
Veteran
Joined
Oct 22, 2013
Messages
34
Reaction score
0
First Language
Italian
Primarily Uses
I am playing a saved game. The enemies are very far up in the game.

EDIT:

Ok, I tried starting up at that very point by setting the player start location in the place where those enemies spawn.

The error doesn't occur anymore but the event still doesn't trigger.

What I'm doing is create a comment under the troop window, under the group of enemies that need to appear, like this:

<gameover event: gameover1>

I tried as well:

gameover event: gameover1

gameover event: 026

<gameover event: 026>

Is this incorrect?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Can you show a screenshot of your troops tab? Include the whole window, just in case the span or conditions have any effect.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
026 is not the same as 26. You should avoid adding unnecessary 0's


Would I be right to guess that you don't have a common event 22?
 
Last edited by a moderator:

LuciferSynd

Veteran
Veteran
Joined
Oct 22, 2013
Messages
34
Reaction score
0
First Language
Italian
Primarily Uses
In reply to Hime, all of my common events are marked as:

001

002

003

And so forth. So far, I never had a problem calling a common event using this sort of format. And I do have a common event 022.

Most of the attacks inside my game call a common event and then follow up another skill to make the actual damage, to always have a cutscene in 3D graphics instead of the classic rpg maker animation.

In reply to Shaz, I can certainly do that:

 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,070
Members
137,577
Latest member
SadaSoda
Top