Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Need help with transport player in common events

In my game I was sick of the game over where you can't continue, so I found a script (Gameover to heaven). It works besides the fact that when I try to change in the common event one to transport player to a location, IT SKIPS IT. i've even added different commands to see if the script wasn't referring to the common event but every other command worked, help please???
 
First of all, can you link us to the script you're using? It'll give us a better idea of whether it's a script problem or not.

Also, can you post the event commands you're trying to use?

:thumb:
 
Here is the script page:
viewtopic.php?f=11&t=60500&hilit=GameOver+to+heaven

here is the script on my game:
Code:
#==============================================================================

# ** Scene_Gameover

#------------------------------------------------------------------------------

#  

#   GameOver to Heaven, v2.0

#   Made by Mr_Smith, Â ©Mr_Smith, all rights reserved

#   

#   What this does? Very easy. It just calls a common event when you die,

#   resulting that you lose items or whatever the gamemaker want to. 

#   Everything you want to happen, is evented in the common event nr. 1.

#   Some features, like loss percentage, cant be evented. That is scripted. 

#   Look further down for the instructions how to change the percentage.

#   And, you really HAVE to set a new starting place in the common event.

#   Otherwise, this script doenst really have affect as you keep at the same place.

#==============================================================================

 

class Scene_Gameover

  #--------------------------------------------------------------------------

  # * Main Processing

  #--------------------------------------------------------------------------

  def main

     $game_temp.gameover = false

    # 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

    # If battle test

    if $BTEST

      $scene = nil

    end

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    # If C button was pressed

    if Input.trigger?(Input::C)

     $game_temp.common_event_id = 001

     $scene = Scene_Map.new

     # Loses the 50% (or any value put in $game_system.loss_percentage)

     amount = $game_party.gold * $game_system.loss_percentage = 0.5

     $game_party.lose_gold(amount.to_i) # To force it to be converted into an integer

     $game_map.autoplay

    end

  end

end  

 

class Interpreter

  #--------------------------------------------------------------------------

  # * Game Over

  #--------------------------------------------------------------------------

  def command_353

    # Set game over flag

    $game_temp.gameover = true

    # End

    # Increases the index

    @index += 1

    return false

  end

end

  #-----------------------------------------------------------------------------

  # * Money loose percentage.

  #   In line 101, you see a number. 0.5, in this case. This means you lose 

  #   50% of the money you have. So, if you have 10.000, you have only 5.000 

  #   left, in this case. You can change it in whatever you want, even

  #   0.3485782978479312 if you really want to.

  #-----------------------------------------------------------------------------

class Game_System

  attr_accessor :loss_percentage

  alias old_game_system_init initialize

  def initialize

    old_game_system_init

    @loss_percentage = 0.5

  end

end

and here is the common event:
Common event 001: Death
@>Transfer Player:[003: Upstairs], (012,007), Down
@>Recover All: Entire Party
 
Hm... I'm not experienced enough with scripting to know if there's a problem there, but you could try moving the "Recover All: command so that it's before the transfer command. If that doesn't work, you could try using Eduardo's version that's in that thread instead:

Code:
class Scene_GameOver

AMOUNTTOKEEP = 0.5

def update

    # If C button was pressed

    if Input.trigger?(Input::C)

     $game_temp.common_event_id = 1

     $scene = Scene_Map.new

     # Loses the 50% (or any value put in $game_system.loss_percentage)

     amount = $game_party.gold * AMOUNTTOKEEP

     $game_party.lose_gold(amount.to_i) # To force it to be converted into an integer

     $game_map.autoplay

   end

end

end

I'm not sure if that'll fix your problem or not, but it's worth a try. :wink:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top