Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> 


———
Before you ask! Read! ;)

You must have 30+ Posts to create a topic here!

Thanks for reading!
———

 
Reply to this topicStart new topic
> [RGSS] Go to map instead of game over
Redd
post Jul 1 2012, 12:31 PM
Post #1


:<
Group Icon

Group: Revolutionary
Posts: 2,314
Type: Developer
RM Skill: Advanced




So is there a script that makes it so that depending on the value of a variable, it changes what map you go to after you get game over?
Instead of getting game over, it would transfer you to a map, and depending on the value of variable 3, it would change what map you would go to.
That would be awesome if anyone could make this for me smile.gif thank you!


__________________________
Go to the top of the page
 
+Quote Post
   
The Law G14
post Jul 1 2012, 04:59 PM
Post #2


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Try this out smile.gif


CODE
#==============================================================================
# Title: Map After Gameover
# Version: 1.0
# Author: The Law G14
#==============================================================================

#==============================================================================
# ** Module: Customization
#------------------------------------------------------------------------------
#  Customization begins here. Do NOT modify anywhere else besides this module.
#==============================================================================

module Customization
  #--------------------------------------------------------------------------
  # * Basic Customization
  #--------------------------------------------------------------------------
  # Game Variables Value (This determines what game variable will be used for
  # finding out which map to transfer to after game over.)
  VARIABLE = 3
  
  # Player direction (This determines what direction the character will face.
  # Up = 8, Down = 2, Left = 4, and Right = 6)
  DIRECTION = 8
  
  #--------------------------------------------------------------------------
  # * Setting Player Coordinates
  #--------------------------------------------------------------------------
  # This sets up what position (x and y) the character will teleport to based
  # on the map ID that was established in the game variable. So the basic
  # setup would be MAP_ID => [PLAYER_X, PLAYER_Y
  PLAYER_COORDS_SETUP = {
  1 => [0, 4],
  2 => [4, 6]
  }
  
end


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

class Scene_Gameover
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias law_mapafgameover_update update
  #--------------------------------------------------------------------------
  # * Module Mix-ins
  #--------------------------------------------------------------------------
  include Customization
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If C button was pressed (Go to Map)
    if Input.trigger?(Input::C)
      # Setup map based on game variable value
      $game_map.setup($game_variables[VARIABLE])
      # Move character to cuztomized x and y coordinates
      $game_player.moveto(PLAYER_COORDS_SETUP[$game_variables[VARIABLE]][0],
          PLAYER_COORDS_SETUP[$game_variables[VARIABLE]][1])
      # Turn player in direction
      case DIRECTION
      when 8 then $game_player.turn_up
      when 2 then $game_player.turn_down
      when 4 then $game_player.turn_left
      when 6 then $game_player.turn_right
      end
      # Set gameover to nil
      $game_temp.gameover = false
      # Switch scene to map scene
      $scene = Scene_Map.new
      # Refresh the game map after all adjustments are finished
      $game_map.refresh
    else
      law_mapafgameover_update
    end
  end
end


#==============================================================================
#
# *** END OF SCRIPT ***
#
#==============================================================================



__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 02:50 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker