FANDOM


Adding a new terrain tag for wild encounters
This tutorial was written by Dragonau. Please give credit.
Click here for more tutorials!


This tutorial is for creating a new terrain tag to be used as an encounter. This is useful desert areas where you only want a certain tile from a tile set e.g. sand, to act as the encounter. For this tutorial I will be using MetalFloor as my encounter terrain type, but you can use anything you like.

Go to PokémonField and find:

Bridge          = 15

Add this after it:

MetalFloor = 16

Now find:

def pbIsJustWaterTag?(tag)
  return tag==PBTerrain::DeepWater ||
         tag==PBTerrain::Water ||
         tag==PBTerrain::StillWater
end

Add this after it:

def pbisMetalFloorTag?(tag)
  return tag==PBTerrain::MetalFloor
end

Go to PokémonEncounters and find:

BugContest   = 12

Add after it:

MetalFloor   = 13

Now find:

"BugContest"

Add after it:

,
"MetalFloor"

Now we need to add encounter type chance to our new encounter type. I will be using the same as Caves. Which is [20,20,10,10,10,10,5,5,4,4,1,1], but you can have anything you want as long as it equals 100. Also remember how you divided it by as for example I will need to add 12 pokemon to my encounters PBS when I define MetalFloor.

Find:

EnctypeChances=[
   [20,20,10,10,10,10,5,5,4,4,1,1],
   [20,20,10,10,10,10,5,5,4,4,1,1],
   [60,30,5,4,1],
   [60,30,5,4,1],
   [70,30],
   [60,20,20],
   [40,40,15,4,1],
   [30,25,20,10,5,5,4,1],
   [30,25,20,10,5,5,4,1],
   [20,20,10,10,10,10,5,5,4,4,1,1],
   [20,20,10,10,10,10,5,5,4,4,1,1],
   [20,20,10,10,10,10,5,5,4,4,1,1],
   [20,20,10,10,10,10,5,5,4,4,1,1]

And add at the end:

,
[20,20,10,10,10,10,5,5,4,4,1,1]

so it looks like this:

EnctypeChances=[
   [20,20,10,10,10,10,5,5,4,4,1,1],
   [20,20,10,10,10,10,5,5,4,4,1,1],
   [60,30,5,4,1],
   [60,30,5,4,1],
   [70,30],
   [60,20,20],
   [40,40,15,4,1],
   [30,25,20,10,5,5,4,1],
   [30,25,20,10,5,5,4,1],
   [20,20,10,10,10,10,5,5,4,4,1,1],
   [20,20,10,10,10,10,5,5,4,4,1,1],
   [20,20,10,10,10,10,5,5,4,4,1,1],
   [20,20,10,10,10,10,5,5,4,4,1,1],
   [20,20,10,10,10,10,5,5,4,4,1,1]
]

Now we have to edit the density, which is the likelihood of the encounter of occurring.

Find:

EnctypeDensities=[25,10,10,0,0,0,0,0,0,25,25,25,25,10]
EnctypeCompileDens=[1,2,3,0,0,0,0,0,0,1,1,1,1,2]

and change to:

EnctypeDensities=[25,10,10,0,0,0,0,0,0,25,25,25,25,10,10]
EnctypeCompileDens=[1,2,3,0,0,0,0,0,0,1,1,1,1,2,2]

Now find:

def isCave?
  return false if @density==nil
  return @enctypes[EncounterTypes::Cave] ? true : false
end

Add after it:

def isMetalFloor?
  return false if @density==nil
  return @enctypes[EncounterTypes::MetalFloor] ? true : false
end

Now find:

elsif self.isCave?
  return EncounterTypes::Cave

Add after it:

elsif self.isMetalFloor?
  return EncounterTypes::MetalFloor

Now find

elsif self.isCave?
  return true

Add after it:

elsif self.isMetalFloor?
  return pbGetTerrainTag($game_player)==PBTerrain::MetalFloor

Now once the coding has been done open up the debug menu and find "set terrain tag". Then set the tile which you will be using for encounters to 16 which was set in PokémonField. Once done save, then edit the encounters PBS and use MetalFloor as a heading and set up normally as for a cave.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.