• 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] Trying to make seasons change tilesets in v17.2 and need help

Rinkoou

Awful-Pun Master
54
Posts
7
Years
  • Hi, I'm working on seasons in Essentials v17.2, and I can't get it to work. When starting the game, this error message would immediatly appear:
    Code:
    Script 'TilesetSeasons' line 12: NoMethodError occurred.
    undefined method 'tileset' for nil:NilClass

    Here is my code:

    Code:
    seasoncheck=Time.now.mon
    
    if seasoncheck=3 || seasonscheck=4 || seasoncheck=5
       season=9
      elsif seasoncheck=6 || seasoncheck=7 || seasoncheck=8
       season=10
      elsif seasoncheck=9 || seasoncheck=10 || seasoncheck=11
       season=11
      elsif seasoncheck=12 || seasoncheck=1 || seasoncheck=2
       season=12
      end
    
      if (@map.tileset_id==1)
       return season
      else
       return @map.tileset_id
     end

    The purpose of the script is to change the maps using the tileset using ID 1into the tileset corresponding to the month the player is playing during. If anybody could help, that'd be great!
     
    1,682
    Posts
    8
    Years
    • Seen today
    Where exactly did you put this code? Because @map is a local variable and needs a class to work with. Also your error is different from your code, since it complains that the method tileset does not exist for the object your calling it on but your code doesn't have a tileset, just a tileset_id

    Fortunately, I still have a copy of BW Essentials, and that comes with a tileset season switcher and that surprisingly works in v17.2! (At least the tileset switching does, I didn't really check if the splash screen of the season worked.)
    Here is a slightly modified version of said script that puts all of the constants in one script section. Don't bother crediting me for that, it's a very tiny thing, but you should credit KleinStudio. I also attached the pictures that come with BW Essentials that this script requires. They go in your Pictures folder, named "blackscreen", "season_autumn", "season_spring", "season_summer", and "season_winter".
     

    Attachments

    • blackscreen.png
      blackscreen.png
      1.7 KB · Views: 64
    • season_autumn.png
      season_autumn.png
      2.4 KB · Views: 62
    • season_spring.png
      season_spring.png
      2.5 KB · Views: 49
    • season_summer.png
      season_summer.png
      2.5 KB · Views: 43
    • season_winter.png
      season_winter.png
      2.6 KB · Views: 47
    6
    Posts
    5
    Years
    • Seen Nov 30, 2018
    I fixed the splash screens.
    In PField_Field on line 476
    Code:
    # Show location signpost
      if mapChanged
        if pbGetMetadata($game_map.map_id,MetadataShowArea)
          nosignpost = false
          if $PokemonGlobal.mapTrail[1]
            for i in 0...NOSIGNPOSTS.length/2
              nosignpost = true if NOSIGNPOSTS[2*i]==$PokemonGlobal.mapTrail[1] && NOSIGNPOSTS[2*i+1]==$game_map.map_id
              nosignpost = true if NOSIGNPOSTS[2*i+1]==$PokemonGlobal.mapTrail[1] && NOSIGNPOSTS[2*i]==$game_map.map_id
              break if nosignpost
            end
            mapinfos = $RPGVX ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata")
            oldmapname = mapinfos[$PokemonGlobal.mapTrail[1]].name
            nosignpost = true if $game_map.name==oldmapname
          end
          scene.spriteset.addUserSprite(LocationWindow.new($game_map.name)) if !nosignpost
        end
      end
    After 2nd end writes
    Code:
    #Season
          pbShowSeasonSplash
          $PokemonGlobal.lastindoor=false
          # Season
    It will be like this
    Spoiler:
    PD: Sorry for my bad english
     
    Last edited:
    6
    Posts
    3
    Years
    • Seen Jun 10, 2022
    Hi ! I'm working on Essentials V17.2 and it's not working I dont know why. I don't get any error message the Tileset just don't change.
     
    Back
    Top