RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Resolved] How do you load an alternative to GameOver Scene?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 82
We learn by living...
ok, so instead of starting the game over with this:

Code: [Select]
  $scene = Scene_Load.new

What can I do in script editor to essentially send the character to a new map, instead of reloading the existing stuff?

Edit: Subject changed for clarification.

Scenario: Your party dies but your characters have accomplished some kind of quest requirement like in Yuyuhakushu
http://www.youtube.com/watch?v=tUXA0jG3I8Y&feature=fvst

the computer checks to see if that quest requirement exists, and if so, sends them to a different map. Problem I'm encountering is as soon as they arrive at the new location, the computer pauses and then goes to game over.
« Last Edit: October 14, 2011, 07:23:33 PM by shintashi »

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Look for the Transfer Player function that events provide in Game_Interpreter and figure it out from there.

***
Rep:
Level 82
We learn by living...
the previous scene doesn't go away when I do that. That's why I asked:

Code: [Select]
def command_continue
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
      $game_temp.player_new_map_id = 1
    $game_temp.player_new_x = 8
    $game_temp.player_new_y = 8
    $game_temp.player_new_direction = 0
  end

the above code doesn't send me to a map location.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Oh, just send your character to Scene_Map.

Code: [Select]
$scene = Scene_Map.new

Of course, you need to initialize everything first ($game_temp, $game_map, etc).

***
Rep:
Level 82
We learn by living...
well that sort of works, now I just need to get around the "game over" auto triggering. Since I'm trying to create new scenes after "game over", it would be really useful to have it not constantly checking if the game party is dead.. I'm aware the game party is dead. I'd like to set them to either immortal=true or hp = 1 or something (at least for testing purposes) before it checks to see if they are all dead.

***
Rep:
Level 82
We learn by living...
I think I've resolved the issue:

Code: [Select]
  #--------------------------------------------------------------------------
  # * Command: Continue
  #--------------------------------------------------------------------------
  def command_continue
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Switch to load screen
    @command_window.dispose
    # Cancel Gameover
    $game_temp.gameover = false
    # Stop BGM and BGS
    $game_system.bgm_play(nil)
    $game_system.bgs_play(nil)
    # go to Astral Plane
    $scene = Scene_Map.new
    $game_temp.player_new_map_id = 1
    $game_temp.player_new_x = 8
    $game_temp.player_new_y = 8
    $game_temp.player_new_direction = 0
  end

It wasn't that I had to be immortal, it was that I had to add "$game_temp.gameover = false"
The immortal thing though might be a good precaution for when they accidentally end up in battle, for now at least, because it sends them right back to my "are you dead?" menu. I'm going to test that next.

***
Rep:
Level 82
We learn by living...
well I discovered if you have immortal = true set, it means your character can't die during battle, but it also means if all the characters hit points are at zero, you still "die". So if all your characters are immortal and have 0 hit points, it's the same as dying. If at least one party member has at least 1 hit point, the other immortal characters can continue fighting at 0 hit points. This could be used to have necromancers controlling armies of zombies.

***
Rep:
Level 82
We learn by living...
I have this code in a Class activated at death, and it doesn't move my characters at all.

Code: [Select]
    $scene = Scene_Map.new
    $game_temp.player_new_map_id = 4
    $game_temp.player_new_x = 7
    $game_temp.player_new_y = 5
    $game_temp.player_new_direction = 0

After they are essentially brought back through this

Code: [Select]
#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
#  This class performs game over screen processing.
#==============================================================================

class Scene_Ghostworld
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make game over graphic
    @sprite = Sprite.new
#    @sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
 @sprite.bitmap = RPG::Cache.gameover ("ghostworld")     

  #===================================================================   
  #         ***  Command Window    *** 
  #------------------------------------------------------------------- 
    s1 = "Continue"
    @command_window = Window_Command.new(192, [s1])
    @command_window.back_opacity = 160
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 288
  #-------------------------------------------------------------------
      # 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)
 Audio.bgm_play("Audio/BGM/cdreams.mid", 100, 100) #Play custom BGM
 
  # 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
  #--------------------------------------------------------------------------
  # * Command: Continue
  #--------------------------------------------------------------------------
  def command_continue
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Switch to load screen
    @command_window.dispose
    # Cancel Gameover
    $game_temp.gameover = false
    $game_actors[2].immortal = true
        $game_actors[2].hp += 1
    $game_actors[3].immortal = true
    # Stop BGM and BGS
    $game_system.bgm_play(nil)
    $game_system.bgs_play(nil)
    # go to Astral Plane
    $scene = Scene_Map.new
    $game_temp.player_new_map_id = 4
    $game_temp.player_new_x = 7
    $game_temp.player_new_y = 5
    $game_temp.player_new_direction = 0
  end

end


They don't go to the new map id, the scene just changes, then changes back outside of battle.

***
Rep:
Level 82
We learn by living...
I recently tried this inside an event.

Code: [Select]
$game_temp.player_transferring = true
$game_temp.player_new_map_id = 1
$game_temp.player_new_y = 8
$game_temp.player_new_x = 3
$game_temp.player_new_direction = 0

and it works, but when I add similar code to my ghostworld class, it makes this horrible noise and doesn't transport me.

***
Rep:
Level 82
We learn by living...
I think I'm going to try and see if the code works inside a different class file. if it does, that means I've done something in my class file that makes it not work. I bet this is kid stuff for the admins.. ;9

***
Rep:
Level 82
We learn by living...
ok I've tested the event sending me to the ghost world and it occurred to me the opening sound effect (thunderstorm) is the file that is playing on loop.

So I know this much:

With my current code, I die in battle, (check)
then I see a command screen with options, (check)
then I select "continue" (check)
then it starts to play the opening sound FX of the new map (check)
then the sound file loops (FAIL)
the character is still on the same map and doesn't transfer (FAIL)
the character is paralyzed in place and is non responsive to commands (FAIL)

That summarizes what happens. Which means I've failed to properly load the new scene or something.

***
Rep:
Level 82
We learn by living...
Code: [Select]
      $game_temp.player_transferring = true
      $game_temp.player_new_map_id = 4
      $game_temp.player_new_y = 6
      $game_temp.player_new_x = 6
      $game_temp.player_new_direction = 0

So I tested this code inside a Class triggered by an event, rather than with an event. It worked like a charm. That tells me the problem isn't these lines of code, rather something that happens between "death" and "life".

*
Rep:
Level 82
What is it you're trying to achieve exactly? From reading the posts, I get the picture you want to be able to continue from a previous location without having to load the game. Essentially, a 'when you die/lose you don't game over but simply respawn somewhere else and return to your business'?

If that's true, won't this script do that for you?

http://rmrk.net/index.php/topic,42095.0.html

It might offer some solutions to your problem if you don't want to actually use it. Looking at it, when a checkpoint is created it saves the game state (via Marshalling) and loads that bit up. You could probably modify the script to not do that and just return to the saved location.

Your problem, though, sounds to be like there's some code that triggers that you aren't resetting making the game still believe you're dead but you've disabled/prevented the game from registering it as a Game Over situation. Maybe.

Anyway, see if that script of Zylos' helps you out or look at ways to modify it to fit your purpose better.

(Why do I always feel like it's the end of the world and I'm the last man standing?)

***
Rep:
Level 82
We learn by living...
long term goal: based on certain stats like karma, when you die, you go to one of many other planes of existence
short term goal: when you die, you go to a different map.

The command menu just gives you the option of normal Game Over or Shutdown. That part works fine... but,

I don't know VX well enough to see where my mistakes can be corrected by comparing Zylos'  working version.




I think my real problem lies in the differences between my GhostWorld Class and Scene_Title Class

here's the relevant section that's different in Scene Title:
Code: [Select]
def command_new_game
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Stop BGM
    Audio.bgm_stop
    # Reset frame count for measuring play time
    Graphics.frame_count = 0
    # Make each type of game object
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_actors        = Game_Actors.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    # Set up initial party
    $game_party.setup_starting_members
    # Set up initial map position
    $game_map.setup($data_system.start_map_id)
    # Move player to initial position
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    # Refresh player
    $game_player.refresh
    # Run automatic change for BGM and BGS set with map
    $game_map.autoplay
    # Update map (run parallel process event)
    $game_map.update
    # Switch to map screen
    $scene = Scene_Map.new
  end


and here's my version for Ghostworld:

Code: [Select]
def command_continue
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Switch to load screen
    @command_window.dispose
    # Cancel Gameover
    $game_temp.gameover = false
    $game_actors[2].immortal = true
        $game_actors[2].hp += 1
    $game_actors[3].immortal = true
    # Stop BGM and BGS
    $game_system.bgm_play(nil)
    $game_system.bgs_play(nil)
    # go to Astral Plane
    $scene = Scene_Map.new
 #tried these, but didn't work:
    #$game_map.setup($game_map.map_id)
    #$game_map.update
    #$game_party.refresh
   
    $game_temp.player_transferring = true #glitchy noise maker
    $game_temp.player_new_map_id = 4
    $game_temp.player_new_x = 6
    $game_temp.player_new_y = 6
    $game_temp.player_new_direction = 0

  end

I'm guessing the part I'm missing is one or more of these:

Code: [Select]
    $game_map.setup($data_system.start_map_id)
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    $game_player.refresh
    $game_map.autoplay
    $game_map.update

but I'm not sure. Basically I'm trying to "load game" from the Command menu screen, which is really just a fancy form of these

Code: [Select]
    $game_temp.player_transferring = true #glitchy noise maker
    $game_temp.player_new_map_id = 4
    $game_temp.player_new_x = 6
    $game_temp.player_new_y = 6
    $game_temp.player_new_direction = 0

plus the following effects:
1. deactivate "game over" ($game_temp.gameover = false)
2. change stats to reflect being dead (for now that's just resetting to 1 hp)

it's getting them to travel to the new map after all the Scene Swapping that's messing up.

***
Rep:
Level 82
We learn by living...
update:

so I took out the transport for now, and tested it again. When I die and go to the continue screen, it allows me to continue walking around like I had earlier, but there's a significant change. The standard "transport" effect I put on the event no longer works, where as it worked before I was killed. Instead the transport effect triggered by the event does identically the same noisy glitch that I experienced when the transport code was part of my class.

This tells me the error is related to the death code, and it is somehow permanently disabling/screwing up the transport code.

***
Rep:
Level 82
We learn by living...
ok, so I got a crude version working with this:

Code: [Select]
  #--------------------------------------------------------------------------
  # * Command: Continue
  #--------------------------------------------------------------------------
  def command_continue
 # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Stop BGM
    Audio.bgm_stop
    # Reset frame count for measuring play time
    Graphics.frame_count = 0
    # Make each type of game object
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    # Set up initial party
    $game_party.setup_starting_members
    # Set up initial map position
    $game_map.setup($data_system.start_map_id)
    # Move player to initial position
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    # Refresh player
    $game_player.refresh
    # Run automatic change for BGM and BGS set with map
    $game_map.autoplay
    # Update map (run parallel process event)
    $game_map.update
    # Switch to map screen
    $scene = Scene_Map.new   
    ghost_world
  end

  def ghost_world
    $game_temp.player_transferring = true #glitchy noise maker
    $game_temp.player_new_map_id = 4
    $game_temp.player_new_x = 6
    $game_temp.player_new_y = 6
    $game_temp.player_new_direction = 0
    $game_actors[2].hp += 1
  end


the only problem is it temporarily flashes "start" map before transporting you to the ghost world. If I could get it to avoid that, I think the whole thing would work out nicely.

***
Rep:
Level 82
We learn by living...
Ok, I got rid of the annoying double teleport at death, and now it sends you straight to the afterlife. That reminds me of 'meet your maker". If you die and your character is steampunk, is your god a Watchmaker?

Code: [Select]
  #--------------------------------------------------------------------------
  # * Command: Continue
  #--------------------------------------------------------------------------
  def command_continue
 # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Stop BGM
    Audio.bgm_stop
    # Reset frame count for measuring play time
    Graphics.frame_count = 0                    #optional
    # Make each type of game object
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new     #optional
    $game_variables     = Game_Variables.new    #optional
    $game_self_switches = Game_SelfSwitches.new #optional
    $game_screen        = Game_Screen.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    # Set up initial party
    $game_party.setup_starting_members
    # Set up initial map position: reprocessed later in "ghost_world"
    $game_map.setup(4)   
    # Move player to initial position: reprocessed later in "ghost_world"
    $game_player.moveto(6, 6)
    # Refresh player
    $game_player.refresh
    # Run automatic change for BGM and BGS set with map
    $game_map.autoplay
    # Update map (run parallel process event)
    $game_map.update
    # Switch to map screen
    $scene = Scene_Map.new   
      $game_actors[2].hp += 1
#   ghost_world
  end

  #--------------------------------------------------------------------------
  # * Ghost World: determines which plane of existence (dormant for now)
  #--------------------------------------------------------------------------
  def ghost_world 
    # check for Karma positive or negative
    #check for axioms and process
    $game_temp.player_transferring = true
    $game_temp.player_new_map_id = 3
    $game_temp.player_new_x = 6
    $game_temp.player_new_y = 6
    $game_temp.player_new_direction = 0
  end