How to change grass to something else to catch pokemon?

Xyphien

Rookie
Member
Joined
Dec 7, 2020
Posts
9
Age
27
Is there anyway to turn walking in grass to something else in the game? I'm assuming there is but I haven't been able to find anything on it. I'd like to instead have it so you walk through flowers and not grass to find them.
 

ThatWelshOne_

Umbreon User
Moderator
Joined
Sep 29, 2020
Posts
194
You will need to create a new terrain tag. Go to the PBTerrain script. Underneath Puddle = 16, add Flowers = 17. Before the final "end" in the PBTerrain script, add this:
Ruby:
def self.isFlowers?(tag)
  return tag==PBTerrain::Flowers
end
Next, go to the PField_Encounters script. Underneath BugContest = 12, add Flowers = 13.
In the "Names" array, put a comma after "BugContest", press enter and write "Flowers" as the last element of this array.
In the "EnctypeChances" array, put a comma after the last element, press enter and add your encounter chances (you can copy/paste from the existing ones for now).
In the "EnctypeDensities" array, put a comma after the last "25" and add your encounter density (you can use 25 for now).
In the "EnctypeCompileDens" array, put a comma after the last "1" and add another 1.

Scroll down a bit and where it says:
Ruby:
def isCave?
  return false if @density==nil
  return @enctypes[EncounterTypes::Cave] ? true : false
end
Put this after it:
Ruby:
def isFlowers?
  return false if @density==nil
  return @enctypes[EncounterTypes::Flowers] ? true : false
end

Scroll down a bit more to where you can see def isEncounterPossibleHere?. Change these lines:
Ruby:
elsif self.isGrass?
  return PBTerrain.isGrass?($game_map.terrain_tag($game_player.x,$game_player.y))
To this:
Ruby:
elsif self.isGrass? || self.isFlowers?
  return PBTerrain.isGrass?($game_map.terrain_tag($game_player.x,$game_player.y)) || PBTerrain.isFlowers?($game_map.terrain_tag($game_player.x,$game_player.y))

Scroll down a little bit more to where you can see def pbEncounterType. Underneath these lines:
Ruby:
elsif self.isCave?
  return EncounterTypes::Cave
Add these lines:
Ruby:
elsif self.isFlowers? && PBTerrain.isFlowers?($game_map.terrain_tag($game_player.x,$game_player.y))
  return EncounterTypes::Flowers

That should be it for the scripts. Now you need to go to the debug menu, Information editors... Edit Terrain Tags.
Select the tileset that has the flower tile(s) on which you want encounters to take place. Change the terrain tag of the flower tile(s) to 17.
Back out of debug by pressing ESC. Save your game, then close RMXP (very important!).

Just one more thing to do: set up encounters on your new flowers terrain, which you can do from debug as normal. You can test if it worked by placing your flower tile(s) on the map where you set up the flowers encounters.

Sorry for the absolute wall of text. I hope this makes sense. Let me know if it doesn't work for you. I tested it in a fresh download of v18.1 and it seems to be fine. To anyone else reading this, let me know if there are any mistakes/redundant code.
 

bo4p5687

Cooltrainer
Member
Joined
Oct 19, 2020
Posts
158
You will need to create a new terrain tag. Go to the PBTerrain script. Underneath Puddle = 16, add Flowers = 17. Before the final "end" in the PBTerrain script, add this:
Ruby:
def self.isFlowers?(tag)
  return tag==PBTerrain::Flowers
end
Next, go to the PField_Encounters script. Underneath BugContest = 12, add Flowers = 13.
In the "Names" array, put a comma after "BugContest", press enter and write "Flowers" as the last element of this array.
In the "EnctypeChances" array, put a comma after the last element, press enter and add your encounter chances (you can copy/paste from the existing ones for now).
In the "EnctypeDensities" array, put a comma after the last "25" and add your encounter density (you can use 25 for now).
In the "EnctypeCompileDens" array, put a comma after the last "1" and add another 1.

Scroll down a bit and where it says:
Ruby:
def isCave?
  return false if @density==nil
  return @enctypes[EncounterTypes::Cave] ? true : false
end
Put this after it:
Ruby:
def isFlowers?
  return false if @density==nil
  return @enctypes[EncounterTypes::Flowers] ? true : false
end

Scroll down a bit more to where you can see def isEncounterPossibleHere?. Change these lines:
Ruby:
elsif self.isGrass?
  return PBTerrain.isGrass?($game_map.terrain_tag($game_player.x,$game_player.y))
To this:
Ruby:
elsif self.isGrass? || self.isFlowers?
  return PBTerrain.isGrass?($game_map.terrain_tag($game_player.x,$game_player.y)) || PBTerrain.isFlowers?($game_map.terrain_tag($game_player.x,$game_player.y))

Scroll down a little bit more to where you can see def pbEncounterType. Underneath these lines:
Ruby:
elsif self.isCave?
  return EncounterTypes::Cave
Add these lines:
Ruby:
elsif self.isFlowers? && PBTerrain.isFlowers?($game_map.terrain_tag($game_player.x,$game_player.y))
  return EncounterTypes::Flowers

That should be it for the scripts. Now you need to go to the debug menu, Information editors... Edit Terrain Tags.
Select the tileset that has the flower tile(s) on which you want encounters to take place. Change the terrain tag of the flower tile(s) to 17.
Back out of debug by pressing ESC. Save your game, then close RMXP (very important!).

Just one more thing to do: set up encounters on your new flowers terrain, which you can do from debug as normal. You can test if it worked by placing your flower tile(s) on the map where you set up the flowers encounters.

Sorry for the absolute wall of text. I hope this makes sense. Let me know if it doesn't work for you. I tested it in a fresh download of v18.1 and it seems to be fine. To anyone else reading this, let me know if there are any mistakes/redundant code.
I think if you want to set a different terrain, so, in def isEncounterPossibleHere?, instead of changing like this
Ruby:
elsif self.isGrass? || self.isFlowers?
  return PBTerrain.isGrass?($game_map.terrain_tag($game_player.x,$game_player.y)) || PBTerrain.isFlowers?($game_map.terrain_tag($game_player.x,$game_player.y))
You need to set like this
Ruby:
elsif self.isGrass?
  return PBTerrain.isGrass?($game_map.terrain_tag($game_player.x,$game_player.y))
elsif self.isFlowers?
  return PBTerrain.isFlowers?($game_map.terrain_tag($game_player.x,$game_player.y))
And in def pbEncounterType, just set
Ruby:
elsif self.isFlowers?
  return EncounterTypes::Flowers
instead of this
Ruby:
elsif self.isFlowers? && PBTerrain.isFlowers?($game_map.terrain_tag($game_player.x,$game_player.y))
  return EncounterTypes::Flowers
 

ThatWelshOne_

Umbreon User
Moderator
Joined
Sep 29, 2020
Posts
194
I think if you want to set a different terrain, so, in def isEncounterPossibleHere?, instead of changing like this
Ruby:
elsif self.isGrass? || self.isFlowers?
  return PBTerrain.isGrass?($game_map.terrain_tag($game_player.x,$game_player.y)) || PBTerrain.isFlowers?($game_map.terrain_tag($game_player.x,$game_player.y))
You need to set like this
Ruby:
elsif self.isGrass?
  return PBTerrain.isGrass?($game_map.terrain_tag($game_player.x,$game_player.y))
elsif self.isFlowers?
  return PBTerrain.isFlowers?($game_map.terrain_tag($game_player.x,$game_player.y))
And in def pbEncounterType, just set
Ruby:
elsif self.isFlowers?
  return EncounterTypes::Flowers
instead of this
Ruby:
elsif self.isFlowers? && PBTerrain.isFlowers?($game_map.terrain_tag($game_player.x,$game_player.y))
  return EncounterTypes::Flowers
[/COD
[/QUOTE]
I tried it like you said originally, but there were issues with Land encounters if these were set on the map as well. OP is welcome to try both ways, of course, and let us know if your simpler solution works.
 

ThatWelshOne_

Umbreon User
Moderator
Joined
Sep 29, 2020
Posts
194
I think you set wrong word in PBS file, this would be "Flowers" and the number of terrain tag.
That's not the issue here.

Anyway, like I said, the way I said to do it works in v18.1. I haven't tested your changes, but OP is welcome to try your changes to see if it works for their purpose.
 

Xyphien

Rookie
Member
Joined
Dec 7, 2020
Posts
9
Age
27
hat should be it for the scripts. Now you need to go to the debug menu, Information editors... Edit Terrain Tags.
Select the tileset that has the flower tile(s) on which you want encounters to take place. Change the terrain tag of the flower tile(s) to 17.
Back out of debug by pressing ESC. Save your game, then close RMXP (very important!).

I get this error whenever I select a pokemon now.
Ruby:
Pokemon Essentials
---------------------------
[Pokémon Essentials version 18.1]

Exception: NoMethodError

Message: undefined method `pbEncounterType' for #<PokemonEncounters:0xcf33b78>



Backtrace:

PField_Field:381:in `pbBattleOnStepTaken'

PField_Field:376

PField_Field:374:in `call'

Event_Handlers:51:in `trigger'

Event_Handlers:46:in `each'

Event_Handlers:46:in `trigger'

Game_Player:135:in `turnGeneric'

Game_Character:708:in `turn_down'

Game_Player:400:in `update_command_new'

Game_Character:795:in `update_command'
 
Last edited:

Xyphien

Rookie
Member
Joined
Dec 7, 2020
Posts
9
Age
27
What does your def pbEncounterType look like?

Edit: Looks like some people in the Discord server helped you fix this?
They did not, I think I'll just decided to scrap everything. This was suppose to be a fun little thing, but it's turning into something a lot more complicated than I originally thought. I have no idea where or what def pbencountertype is. I don't see it in the scripts section, changing the pokemon out with other non pokemon gives me an error sometimes as well, I'm unsure how to change trainers without making entirely new ones which I also don't know how to do as the current trainers there's no pbTrainerBattle anywhere in the scripts or the saved files in the games folder. It's just a mess lol. Thanks for the help though, and sorry for the waste of time on your end but I'll just go back to only doing a board game I think lol.
 

ThatWelshOne_

Umbreon User
Moderator
Joined
Sep 29, 2020
Posts
194
They did not, I think I'll just decided to scrap everything. This was suppose to be a fun little thing, but it's turning into something a lot more complicated than I originally thought. I have no idea where or what def pbencountertype is. I don't see it in the scripts section, changing the pokemon out with other non pokemon gives me an error sometimes as well, I'm unsure how to change trainers without making entirely new ones which I also don't know how to do as the current trainers there's no pbTrainerBattle anywhere in the scripts or the saved files in the games folder. It's just a mess lol. Thanks for the help though, and sorry for the waste of time on your end but I'll just go back to only doing a board game I think lol.
That's a shame, but I understand. My DMs are always open in case you change your mind and would like some help with this and any other issues you're having. Either way, I wish you all the best for you and your project(s).
 
Top