- 8
- Posts
- 5
- 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
And then in the pbs metadata text file I also have it set to Home=4,6,4,8
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