Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Print Page - changing Gameover into a common event

The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: zzzdude on August 12, 2007, 10:52:38 PM

Title: changing Gameover into a common event
Post by: zzzdude on August 12, 2007, 10:52:38 PM
I need a script that when you get a gameover in battle, or in a way OTHER THAN an event, that it does not actually get a gameover, but instead calls a common event.

HOWEVER
I still want the event command gameover to be the actual gameover, so when that event occurs, it calls the gameover screen, like how it's supposed to.
Title: Re: changing Gameover into a common event
Post by: modern algebra on August 15, 2007, 08:15:10 PM
For the second part, actually making it gameover at the end of the common event, you can just use the event command, so the scripting portion is just making it call a common event. That's not hard. If I have the time I'll look at it.
Title: Re: changing Gameover into a common event
Post by: zzzdude on August 15, 2007, 08:56:00 PM
Exactly.
Title: Re: changing Gameover into a common event
Post by: modern algebra on August 16, 2007, 04:21:26 AM
Alright, all you need to do is paste this scriptlet into it's own script above Main.


class Scene_Battle
 
  # Aliases update to run before everything else in the method
  alias gameover_to_common_event update
  def update
    if $game_temp.gameover
      # Editable region. This number below is the ID of the common event you
      # wish to run. It is 1 by default, change it to suit your game.
      $game_temp.common_event_id = 1
      $scene = Scene_Map.new
      $game_temp.gameover = false
      return
    end
    gameover_to_common_event
  end
end


I left all the work for you to do inside the common event itself. I did not change bgm or tint screen or teleport or anything, so you need to arrange the common event. Specifically, you need to place at thee bottom of the common event the Game Over command. This also only corrects for battle, as that is the only situation I can think of that needs to be corrected for. To Game Over in an event, just call the Game Over common event as you would call any other common event.
Title: Re: changing Gameover into a common event
Post by: zzzdude on August 16, 2007, 01:28:17 PM
:D
Thank you so much!
Exactly what I wanted!

That is the second script you made for me ^_^

Tell me how to give rep....
Title: Re: changing Gameover into a common event
Post by: modern algebra on August 16, 2007, 03:02:30 PM
You can only edit rep once you have 75 posts. Don't worry about it; it's not necessary