• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

Spin Tiles

[PokeCommunity.com] Spin Tiles

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)
[COLOR="Red"]        elsif $PokemonGlobal.spinning
          @character_name = pbGetPlayerCharset(meta,7)[/COLOR]
        else
          # Display normal character sprite 
          @character_name = pbGetPlayerCharset(meta,1)
        end
        @wasmoving = moving?
      end
    end
    return @character_name
  end
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)[COLOR="Red"] && 
       !$PokemonGlobal.spinning # this and the above && are new[/COLOR]
  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
[COLOR="Red"]    elsif $PokemonGlobal.spinning
      @move_speed = ($RPGVX) ? 4.5 : 3.8 # Spinning[/COLOR]
    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
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[COLOR="Red"],boy_spin[/COLOR],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.
my boy_spin looks like this:
[PokeCommunity.com] Spin Tiles

You can swap the left and right facing columns if it looks better. I tried both, can't tell the difference.

Make sure to credit Vendily, thepsynergist and Barrel's O'Fun!
Get it here!
 
Last edited:
New Update, Stop tiles added!

This update adds in Stop tiles, which is a thing, apparently? Never really played much of RBY, FRLG, or HGSS, so I never saw them.

Stop tiles do exactly what you think they do, stop the player dead in their tracks if they're spinning.

If you don't plan on using them, just set the terrain tag to -1!
 
and where do i make the event?

You need to make or modify events in the spin tiles, set the character spin directions and most important is, the spin chracter Protoganist is must needed for this, so don't delete that you need to edit your protoganist chracter after you finish the work.
 
I am using this with v18 and getting an error with line 70 of the script when play testing. This is the line it doesn't like:

Events.onStepTakenFieldMovement+=proc {|sender,e|

I'm assuming it's because this was written for v17.

Any ideas on how to fix this please?

Edit: I was being stupid and didn't put the script in a new script page. I was trying to put it in pbTerrain. Now I've fixed this, the game not longer crashes or has error messages. But, my character isn't spinning, just running along the tiles. I know my image for spinning character works because i used it for the run character and when i ran i also spun. It's just not changing the character set when stepping on the spin tiles. Is this because $PokemonGlobal.spinning isn't active or because the player visuals formatting is wrong in character name

def character_name
@defaultCharacterName = "" if !@defaultCharacterName
return @defaultCharacterName if @defaultCharacterName!=""
if !@move_route_forcing && $PokemonGlobal.playerID>=0
meta = pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID)
if meta && !$PokemonGlobal.bicycle && !$PokemonGlobal.diving && !$PokemonGlobal.surfing
charset = 1 # Display normal character sprite
if pbCanRun? && (moving? || @wasmoving) && Input.dir4!=0 && meta[4] && meta[4]!=""
charset = 4 # Display running character sprite
elsif $PokemonGlobal.spinning
@character_name = pbGetPlayerCharset(meta,8)
end
newCharName = pbGetPlayerCharset(meta,charset)
@character_name = newCharName if newCharName
@wasmoving = moving?
end
end
return @character_name
end
 
Last edited:
Anyone willing to help a newbie, not sure if I got the terrain tags incomplete somehow or placing it on the wrong layer, is there an event that needs to be made on each tile(is this specified anywhere I might've missed?) or maybe I am adding the code to the wrong area(not its own page, in PBTerrain, etc.) Please let me know I'll be checking in every now and then here to check for responses, thank you.
 
(Version 17.2) Not that it isn't obvious but I had left it out in my OG post. I am referring to the spin tiles not working when I step on them. No spinning, no errors. Nothin'.
Wanted to add that I might've found something for an event but none that I was able to use to make it work. What I mean is the following:
Kernel.pbSpinTile
(PBTerrain::SpinTileUp)
Does nothing, not sure if Im doin it right but again please let me know.
 
Last edited:
Hi, anyone has a version working with 20.1 or another script making spin tiles work ?
 
Back
Top