The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Scripts & Tutorials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Reply
 
Thread Tools
  #1    
Old May 26th, 2013, 11:16 AM
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Code:
#===============================================================================
# * Game Over - by FL (Credits will be apreciated)
#===============================================================================
#
# This script is for Pokémon Essentials. When a switch is on, its activates a
# game over when the player lose a battle instead of going to last healing spot.
#
#===============================================================================
# For this script to work, put it above main script section. After that,
# in PokemonField script section before line 
# 'if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0' add
# line 'pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]'.
#
# If you wish to don't display the money lost message, in PokeBattle_Battle
# script section, after line 'moneylost=pbMaxLevel(@party1)' add line
# 'moneylost=0 if (!canlose && $game_switches[GAMEOVERSWITCH])'.
#
# This script is the RPG Maker XP Scene_Gameover with a single line
# commented and two line added as you can see below, so you can define the
# game Over ME and graphic in the RPG Maker XP system database (F9).
# Please note that Essentials uses a different screen size (the default is
# 512x384), so the game over graphic must match.
# 
#===============================================================================

# The switch number that need to be ON in order to allows a game over
GAMEOVERSWITCH = 60 

# Using the equivalent of the commented line ($scene = Scene_Map.new)
# throws some strange behaviors, so I prefer to raise a reset at scene end

#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
#  This class performs game over screen processing.
#==============================================================================

class Scene_Gameover
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make game over graphic
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
    # Stop BGM and BGS
    $game_system.bgm_play(nil)
    $game_system.bgs_play(nil)
    # Play game over ME
    $game_system.me_play($data_system.gameover_me)
    # Execute transition
    Graphics.transition(120)
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of game over graphic
    @sprite.bitmap.dispose
    @sprite.dispose
    # Execute transition
    Graphics.transition(40)
    # Prepare for transition
    Graphics.freeze
    raise Reset.new # added line
    # If battle test
    if $BTEST
      $scene = nil
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Switch to title screen
#     $scene = Scene_Title.new # commented line
      $scene = nil; # added line
    end
  end
end
Attached Thumbnails
001-Gameover01-Essentials.jpg‎   001-Gameover01-Essentials2.jpg‎  
__________________

Last edited by FL; June 2nd, 2013 at 09:16 AM.
Reply With Quote
  #2    
Old May 26th, 2013, 11:40 AM
Tayuya of the Sound Four's Avatar
Tayuya of the Sound Four
 
Join Date: Jan 2013
Gender: Female
This is pretty cool, I can't think of anything I could use it for personally, but others will find it pretty useful, Kudos c:
Reply With Quote
  #3    
Old May 29th, 2013, 10:08 AM
Dylanrockin's Avatar
Dylanrockin
Mysterious Trainer
 
Join Date: May 2011
Gender: Male
Nature: Timid
Where would I put: pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]

Would I put it after line 1736, or on line 1736? Also I want to play a song when the game over screen is displayed, how would I go about putting that in?
__________________
Visit my YouTube Channel: http://www.youtube.com/user/Pokemonmaster212
My Pokemon Symphonic Horizon RPG Maker XP Game: http://www.pokecommunity.com/showthr...66#post8016366

Last edited by Dylanrockin; May 29th, 2013 at 10:14 AM.
Reply With Quote
  #4    
Old May 29th, 2013, 10:46 AM
Nickalooose
--------------------
 
Join Date: Mar 2008
Gender: Female
The English is not the best but.

# To this script works, put it above main and, in PokemonField script
# section before line
# 'if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0' add
# line 'pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]'

Translated

# For this script to work, put it above main script section... After that, in PokemonField script
# section before line
# 'if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0' add
# line 'pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]'
Reply With Quote
  #5    
Old June 2nd, 2013, 09:17 AM
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Quote:
Originally Posted by Nickalooose View Post
The English is not the best but.

# To this script works, put it above main and, in PokemonField script
# section before line
# 'if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0' add
# line 'pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]'

Translated

# For this script to work, put it above main script section... After that, in PokemonField script
# section before line
# 'if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0' add
# line 'pbLoadRpgxpScene(Scene_Gameover.new) if $game_switches[GAMEOVERSWITCH]'
I updated the topic with your description. Thanks for your help!
__________________
Reply With Quote
  #6    
Old June 3rd, 2013, 02:30 PM
Nickalooose
--------------------
 
Join Date: Mar 2008
Gender: Female
No problem at all glad to give you help since you've gave me help in the past
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 12:56 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.