• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Starting Over Point

8
Posts
4
Years
    • Seen Nov 6, 2022
    I have been making a game, and I didn't want the player to spawn back into their house. It used to say it couldn't detect the map data of the house, but when I changed it to what I wanted it to is shows up the black screen talking about blacking out, and then it keeps me at the same spot with healed Pokemon.

    The PBField_Visiuals Script
    Code:
    #===============================================================================
    # Blacking out animation
    #===============================================================================
    def Kernel.pbRxdataExists?(file)
      if $RPGVX
        return pbRgssExists?(file+".rvdata")
      else
        return pbRgssExists?(file+".rxdata")
      end
    end
    
    def Kernel.pbStartOver(gameover=false)
      if pbInBugContest?
        Kernel.pbBugContestStartOver
        return
      end
      pbHealAll
      if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0
        if gameover
          Kernel.pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, you scurry back to a Pokémon Center."))
        else
          Kernel.pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]You scurry back to a Pokémon Center, protecting your exhausted Pokémon from any further harm..."))
        end
        Kernel.pbCancelVehicles
        pbRemoveDependencies
        $game_switches[STARTING_OVER_SWITCH] = true
        $game_temp.player_new_map_id    = $PokemonGlobal.pokecenterMapId
        $game_temp.player_new_x         = $PokemonGlobal.pokecenterX
        $game_temp.player_new_y         = $PokemonGlobal.pokecenterY
        $game_temp.player_new_direction = $PokemonGlobal.pokecenterDirection
        $scene.transfer_player if $scene.is_a?(Scene_Map)
        $game_map.refresh
      else
        homedata = pbGetMetadata(004,MetadataHome)
        if homedata && !pbRxdataExists?(sprintf("Data/Map%004d",homedata[0]))
          if $DEBUG
            Kernel.pbMessage(_ISPRINTF("Can't find the map 'Map{1:04d}' in the Data folder. The game will resume at the player's position.",homedata[0]))
          end
          pbHealAll
          return
        end
        if gameover
          Kernel.pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, you scurry back home."))
        else
          Kernel.pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]You scurry back home, protecting your exhausted Pokémon from any further harm..."))
        end
        if homedata
          Kernel.pbCancelVehicles
          pbRemoveDependencies
          $game_switches[STARTING_OVER_SWITCH] = true
          $game_temp.player_new_map_id    = homedata[0]
          $game_temp.player_new_x         = homedata[1]
          $game_temp.player_new_y         = homedata[2]
          $game_temp.player_new_direction = homedata[3]
          $scene.transfer_player if $scene.is_a?(Scene_Map)
          $game_map.refresh
        else
          pbHealAll
        end
      end
      pbEraseEscapePoint
    end

    And then in the pbs metadata text file I also have it set to Home=4,6,4,8
     
    15
    Posts
    5
    Years
    • Seen Sep 24, 2020
    You normally dont change anything in the script section for the thing you try to aproach, at least from what I think. Changing the pbs is normally enough. Did you include a autorun event that relies on the starting over switch and then turns that switch off again? (note that this event has to be in the map you want to be in when you respawn) You can look into your player house in lappet town (mom) for an example of how its supposed to be placed.

    Alternatively, you could force an updated location by running an automatic "Kernel.pbSetPokemonCenter" , altough this would require that you were at least once in the same map/spot as you require in your game, before you can black out
     
    8
    Posts
    4
    Years
    • Seen Nov 6, 2022
    You normally dont change anything in the script section for the thing you try to aproach, at least from what I think. Changing the pbs is normally enough. Did you include a autorun event that relies on the starting over switch and then turns that switch off again? (note that this event has to be in the map you want to be in when you respawn) You can look into your player house in lappet town (mom) for an example of how its supposed to be placed.

    Alternatively, you could force an updated location by running an automatic "Kernel.pbSetPokemonCenter" , altough this would require that you were at least once in the same map/spot as you require in your game, before you can black out

    I went back and fixed the script to the normal way it was, and then put the metadata PBS in as the map, and it worked. Thank you and sorry for my stupidity lmao
     
    Back
    Top