- 1
- Posts
- 1
- Days
- Seen yesterday
Making a Pokemon game in essentials V21.1 the player can choose at the intro to play as a psychic character.
The difference this makes to the game is mostly flavor text but for the Player abilities, these include so far Mind slash (CUT) so the player can cut down trees, Mind Crush (Rocksmash) to smash obstic;e rocks and Psy Teleport a player based (Fly) ability. the first two abilities work perfectly. however i just cant get the teleport ability to outside of debug mode. I'm getting a no method nill error when i run the game from the .exe
the only scripting I've added that works when running the game inside RPGMXP for the teleport ability are these.
MenuHandlers.add(:pause_menu, :psy_teleport, {
"name" => _INTL("Teleport"),
"order" => 100,
"condition" => proc { next true if $game_switches[109] && !$game_switches[87] && $bag.has?(:TOWNMAP)},
"effect" => proc { |menu|
pbPlayDecisionSE
pbFadeOutIn do
scene = PokemonRegionMap_Scene.new(-1, false)
screen = PokemonRegionMapScreen.new(scene)
ret = screen.pbStartFlyScreen
$game_temp.fly_destination = ret if ret
($game_temp.fly_destination) ? menu.pbEndScene : menu.pbRefresh
end
next pbTeleportToNewLocation
}
})
def pbTeleportToNewLocation()
return false if $game_temp.fly_destination.nil?
if !$DEBUG
$game_temp.fly_destination = nil
yield if block_given?
return false
end
if $game_switches[95]
name = $player.name
psy_Teleport = "Teleport"
pbMessage(_INTL("{1} used {2}!", name, psy_Teleport))
end
$stats.fly_count += 1
$teleporting = true
pbSEPlay("Slots coin")
$scene.spriteset.addUserAnimation(Settings::TELEPORT_ANIMATION_ID, $game_player.x, $game_player.y, true, 1)
pbWait(0.35)
pbFadeOutIn do
$game_temp.player_new_map_id = $game_temp.fly_destination[0]
$game_temp.player_new_x = $game_temp.fly_destination[1]
$game_temp.player_new_y = $game_temp.fly_destination[2]
$game_temp.player_new_direction = 2
$game_temp.fly_destination = nil
pbDismountBike
$scene.transfer_player
$game_map.autoplay
$game_map.refresh
yield if block_given?
pbWait(0.25)
end
pbEraseEscapePoint
return true
end
the specific error is as follows:
![[PokeCommunity.com] Pokemon Essentials Script Help [PokeCommunity.com] Pokemon Essentials Script Help](https://data.pokecommunity.com/attachments/89/89180-ae6041a5751595ccacbdc4d05185e09e.jpg)
![[PokeCommunity.com] Pokemon Essentials Script Help [PokeCommunity.com] Pokemon Essentials Script Help](https://data.pokecommunity.com/attachments/89/89181-bd002f27be0c1b9b5d36400409734c4e.jpg)
been stuck on this for a week and cant get my head around whats causing the issue, any help would be appreciated
The difference this makes to the game is mostly flavor text but for the Player abilities, these include so far Mind slash (CUT) so the player can cut down trees, Mind Crush (Rocksmash) to smash obstic;e rocks and Psy Teleport a player based (Fly) ability. the first two abilities work perfectly. however i just cant get the teleport ability to outside of debug mode. I'm getting a no method nill error when i run the game from the .exe
the only scripting I've added that works when running the game inside RPGMXP for the teleport ability are these.
MenuHandlers.add(:pause_menu, :psy_teleport, {
"name" => _INTL("Teleport"),
"order" => 100,
"condition" => proc { next true if $game_switches[109] && !$game_switches[87] && $bag.has?(:TOWNMAP)},
"effect" => proc { |menu|
pbPlayDecisionSE
pbFadeOutIn do
scene = PokemonRegionMap_Scene.new(-1, false)
screen = PokemonRegionMapScreen.new(scene)
ret = screen.pbStartFlyScreen
$game_temp.fly_destination = ret if ret
($game_temp.fly_destination) ? menu.pbEndScene : menu.pbRefresh
end
next pbTeleportToNewLocation
}
})
def pbTeleportToNewLocation()
return false if $game_temp.fly_destination.nil?
if !$DEBUG
$game_temp.fly_destination = nil
yield if block_given?
return false
end
if $game_switches[95]
name = $player.name
psy_Teleport = "Teleport"
pbMessage(_INTL("{1} used {2}!", name, psy_Teleport))
end
$stats.fly_count += 1
$teleporting = true
pbSEPlay("Slots coin")
$scene.spriteset.addUserAnimation(Settings::TELEPORT_ANIMATION_ID, $game_player.x, $game_player.y, true, 1)
pbWait(0.35)
pbFadeOutIn do
$game_temp.player_new_map_id = $game_temp.fly_destination[0]
$game_temp.player_new_x = $game_temp.fly_destination[1]
$game_temp.player_new_y = $game_temp.fly_destination[2]
$game_temp.player_new_direction = 2
$game_temp.fly_destination = nil
pbDismountBike
$scene.transfer_player
$game_map.autoplay
$game_map.refresh
yield if block_given?
pbWait(0.25)
end
pbEraseEscapePoint
return true
end
the specific error is as follows:
![[PokeCommunity.com] Pokemon Essentials Script Help [PokeCommunity.com] Pokemon Essentials Script Help](https://data.pokecommunity.com/attachments/89/89180-ae6041a5751595ccacbdc4d05185e09e.jpg)
![[PokeCommunity.com] Pokemon Essentials Script Help [PokeCommunity.com] Pokemon Essentials Script Help](https://data.pokecommunity.com/attachments/89/89181-bd002f27be0c1b9b5d36400409734c4e.jpg)
been stuck on this for a week and cant get my head around whats causing the issue, any help would be appreciated