Resource icon

Spin Tiles 2020-08-11

Pokémon Essentials Version
v17.2 ➖

This script adds in Spin tiles, a Pokémon staple! Once the player steps on one of these tiles, they'll go spinning in the direction on the tile until they hit an impassable object. Hitting another spin tile redirects the player.

To use it, you must create 4 new tiles with terrain tags specifying the spun direction. Remember to change the presets if you have other terrain tags installed!

There's also one other edit to def character_name in Game_Player_Visuals.
New lines in red.
Code:
  def character_name
    @defaultCharacterName = "" if !@defaultCharacterName
    return @defaultCharacterName if @defaultCharacterName!=""
    if !@move_route_forcing && $PokemonGlobal && $PokemonGlobal.playerID>=0
      meta = pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID)
      if meta && !$PokemonGlobal.bicycle && !$PokemonGlobal.diving && !$PokemonGlobal.surfing
        if pbCanRun? && (moving? || @wasmoving) && Input.dir4!=0 && meta[4] && meta[4]!=""
          # Display running character sprite
          @character_name = pbGetPlayerCharset(meta,4)
        elsif $PokemonGlobal.spinning     # New Line!
          @character_name = pbGetPlayerCharset(meta,7)    # New Line!
        else
          # Display normal character sprite 
          @character_name = pbGetPlayerCharset(meta,1)
        end
        @wasmoving = moving?
      end
    end
    return @character_name
  end
You also have to add a new image to the Player fields in metadata.txt. Here's mine:
Code:
PlayerA=POKEMONTRAINER_Red,trchar000,boy_bike,boy_surf,boy_run,boy_surf,boy_fish_offset,boy_spin,xxx
If you have another script that uses the metadata, you will need to change the 7 in pbGetPlayerCharset(meta,7) to the new position in the metadata.
You also have to edit pbCanRun? in the same section to add in the anti run in spin check.
Code:
  def pbCanRun?
    return false if $game_temp.in_menu || $game_temp.in_battle ||
                    @move_route_forcing || $game_temp.message_window_showing ||
                    pbMapInterpreterRunning?
    terrain = pbGetTerrainTag
    input = ($PokemonSystem.runstyle==1) ? ($PokemonGlobal && $PokemonGlobal.runtoggle) : Input.press?(Input::A)
    return input &&
       $PokemonGlobal && $PokemonGlobal.runningShoes &&
       !$PokemonGlobal.diving && !$PokemonGlobal.surfing &&
       !$PokemonGlobal.bicycle && !PBTerrain.onlyWalk?(terrain) && 
       !$PokemonGlobal.spinning # this and the above && are new
  end
Finally you have to edit update in the same section to prevent carrying an old speed over into the tiles.
Code:
  def update
    if PBTerrain.isIce?(pbGetTerrainTag)
      @move_speed = ($RPGVX) ? 6.5 : 4.8 # Sliding on ice
    elsif $PokemonGlobal.spinning # New Line!
      @move_speed = ($RPGVX) ? 4.5 : 3.8 # Spinning # New Line!
    elsif !moving? && !@move_route_forcing && $PokemonGlobal
      if $PokemonGlobal.bicycle
        @move_speed = ($RPGVX) ? 8 : 5.2 # Cycling
      elsif pbCanRun? || $PokemonGlobal.surfing || $PokemonGlobal.diving
        @move_speed = ($RPGVX) ? 6.5 : 4.8 # Running, surfing or diving
      else
        @move_speed = ($RPGVX) ? 4.5 : 3.8 # Walking
      end
    end
    update_old
  end
boy_spin looks like this:

You can swap the left and right facing columns if it looks better. I tried both, can't tell the difference.
Credits
Vendily, thepsynergist and Barrel's O'Fun
Author
Vendily
Downloads
73
Views
228
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Vendily

Latest updates

  1. Fixes to Move Speed and Funny Frames (Still v17)

    Thanks to thepsynergist and Barrel's O'Fun, a number of bugs were quashed in this update! For...
  2. Stop tiles added!

    This update adds in Stop tiles, which is a thing, apparently? Never really played much of RBY...
Top