• 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.

[Essentials Tutorial] How to make a new type of encounter, a step by step guide

Radical Raptr

#BAMFPokemonNerd
1,121
Posts
13
Years
In this Tutorial I will be walking you through how to add in a new encounter type, in this case "Desert" will be the type we're adding. Furthermore, I will be using a stock Esentials V15.1 (with Lukas Battle system) as the example of what to edit and where, there shouldn't be much difference between this and others that I'm aware of but this is for sake of convenience. 

First Bit

First, you're going to want to ctrl+shift+F in the script section for:
Code:
module EncounterTypes

Looking down, add the new encounter at the list of Encounter types, you should find 12 total, if you're using Stock essentials. The last one should be:
Code:
BugContest   = 12
So add in the new one which will be:
Code:
Desert       = 13
Note: if you already have one for #13, then you would be adding in the number after the last one.


And make the following changes afterwards:
Spoiler:

The different numbers correlate to the different kinds of varying degrees of rarity of the encounter type, standard land would be the added addition, but you can play around with it as you wish, but it is important to not that the last  bit in each section should not have a comma at the end when you're finished, but you need to add one whenever you add in a new bit (I know it's basic knowledge but just incase you missed it, its worth pointing out.)


Scrolling down a bit further around line 73 you'll come across:
Code:
def isCave?
    return false if @density==nil
    return @enctypes[EncounterTypes::Cave] ? true : false
  end

The next step is to paste under, at the end of line 76, something along the lines of:
Code:
def isDesert?
    return false if @density==nil
    return @enctypes[EncounterTypes::Desert] ? true : false
  end

and then scrolling down further to line 109 paste it the following:
Code:
elsif self.isDesert?
      return EncounterTypes::Desert

Finally, scrolling down to line 132, paste in the following:
Code:
return true
    elsif self.isDesert?
This will allow Land Encounters and Desert Encounters to happen on the same map.


Second Bit

The next step is to ctrl+shift+F for:
Code:
# Choose backdrop
And
Code:
# Choose bases

There should be 2 results for each of them if you are using Lukas Battle System and only 1 if you are using Stock Essentials.

Under "backdrop" Paste in:
Code:
elsif environ==PBEnvironment::Desert
      backdrop="Desert"

And under "bases" Paste in:
Code:
elsif environ==PBEnvironment::Desert
      trialname="Desert"
This will make sure when the battle starts, it loads the corresponding BG and Battle Base.

The next step you're going to do is to ctrl+shift+F:
Code:
module PBTerrain
This is where you'll add in your new terrain tag for consistency so when you're playing you don't accidentally run into unwanted encounters , ie, setting desert to the dirt terrain tag, but having a map where there is a sand path leading up to a desert like Route 111 and you accidentally have Trapinch where they don't belong.

In Stock Essentials there should be 15 Terrain Tags, add in the 16th:
Code:
Desert          = 16
If you have already added in Terrain Tags of your own, add this one after the last one.

Now add in:
Code:
def pbIsDesertTag?(tag)
  return tag==PBTerrain::Desert
end
into the same section (I added it at about line 50, but that was a personal choice.)


Third Bit

RMXP is not equipped to deal with more than 7 types of terrain tags, so you'll need to use the external Editor in order to add in the new Terrain Tag - it should be self explanatory, but incase you're unfamiliar with how to do so, check the spoiler, if you know how to already feel free to skip it.

Spoiler:



Once that has been taken care of, ctrl+shift+F:
Code:
terrain=$game_player.terrain_tag
in the section PField_Field, and add in:
Code:
elsif terrain==PBTerrain::Desert
      return PBEnvironment::Desert

Now ctrl+shift+F:
Code:
module PBEnvironment
and add a new one under the last one, in Stock essentials the last one is:
Code:
Sand        = 8

so you should be adding:
Code:
Desert      = 9


And that should be everything you need to do! You now have a new Desert Encounter type! You can substitute Desert for anything and make necessary changes to suit your needs, but these are the sections that should be altered in order to add in the new encounter. You'll want to keep in mind however, if you're adding in a new Cave Encounter variation, that you look closely at how the Cave encounters are defined, such as:
(around line 1032 of Compiler)
Code:
      if thisenc && (thisenc[1][EncounterTypes::Land] ||
                     thisenc[1][EncounterTypes::LandMorning] ||
                     thisenc[1][EncounterTypes::LandDay] ||
                     thisenc[1][EncounterTypes::BugContest] ||
                     thisenc[1][EncounterTypes::LandNight]) &&
                     thisenc[1][EncounterTypes::Cave]
        raise _INTL("Can't define both Land and Cave encounters in the same area (map ID {1})",mapid)
      end
this makes it so you cannot have a Land and a Cave encounter in the same map, you would do something similar if your new Encounter clashes with another.


Resources and Credits
Luka had not included these BG's and Bases in his resources, nor the fairy move button for battle moves. You do not have to credit me for this tutorial, I'm happy to help, but If you use these resources then I ask you kindly to credit:
• Me for my work
Eli | Ripping and compiling the backgrounds
• Luka S.J. For the resources and images I edited for his Battle System. 

(for the "moveSelButtons" use the one that corresponds to your type pbs file.)
Link
 

Chrisario

Friend code :0018 2912 2366 let me know
108
Posts
10
Years
No I meant when walking in the swamp like those puddles in Iciurus City you know that type of en encounter do. You understand now?
 

Radical Raptr

#BAMFPokemonNerd
1,121
Posts
13
Years
No I meant when walking in the swamp like those puddles in Iciurus City you know that type of en encounter do. You understand now?

...Yeah?
That is by definition an encounter type. This is a tutorial on how to make an encounter...
Of course you can make a swamp, or puddle, r flower, or sand, or desert, or snow, etc encounter type... I thought that was obvious...

Of course you would need to play with certain terrain effects, but that is just as obvious...
 

Chrisario

Friend code :0018 2912 2366 let me know
108
Posts
10
Years
Yes but I know how to make it but is it the same as your example cause the PBEncounter::cave can you show me how since I want to make my game a 6th gen game

...Yeah?
That is by definition an encounter type. This is a tutorial on how to make an encounter...
Of course you can make a swamp, or puddle, r flower, or sand, or desert, or snow, etc encounter type... I thought that was obvious...

Of course you would need to play with certain terrain effects, but that is just as. obvious...
yes I see thanks I will try it when I'm back home the thing is my scripting is very low so I felt dumb asking you this
 
Last edited by a moderator:

Radical Raptr

#BAMFPokemonNerd
1,121
Posts
13
Years
Yes but I know how to make it but is it the same as your example cause the PBEncounter::cave can you show me how since I want to make my game a 6th gen game

what exactly do you mean it's the same as the PBEncounter::Cave? regardless of why, if it's like the cave encounter the only difference is that you need to look where the cave is put and copy the coding but change it to puddle, doing CTRL+SHIFT+F and searching "cave" will help, do that and just copy the parts that make it so it can't appear where land is, or make an entirely new thing and make it so it can't be on the same map as any other thing. However as far as I know there is no such restriction, but w/e.
 

Chrisario

Friend code :0018 2912 2366 let me know
108
Posts
10
Years
what exactly do you mean it's the same as the PBEncounter::Cave? regardless of why, if it's like the cave encounter the only difference is that you need to look where the cave is put and copy the coding but change it to puddle, doing CTRL+SHIFT+F and searching "cave" will help, do that and just copy the parts that make it so it can't appear where land is, or make an entirely new thing and make it so it can't be on the same map as any other thing. However as far as I know there is no such restriction, but w/e.
I meant messed up and got stuck there but thanks .
 
Back
Top