Radical Raptr
#BAMFPokemonNerd
- 1,124
- Posts
- 14
- Years
- Age 30
- everywhere
- Seen Sep 19, 2024
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, you're going to want to ctrl+shift+F in the script section for:
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:
So add in the new one which will be:
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:
Names=[
"Land",
"Cave",
"Water",
"RockSmash",
"OldRod",
"GoodRod",
"SuperRod",
"HeadbuttLow",
"HeadbuttHigh",
"LandMorning",
"LandDay",
"LandNight",
"BugContest",
"Desert"
]
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]
]
EnctypeDensities=[25,10,10,0,0,0,0,0,0,25,25,25,25,25]
EnctypeCompileDens=[1,2,3,0,0,0,0,0,0,1,1,1,1,1]
end
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:
The next step is to paste under, at the end of line 76, something along the lines of:
and then scrolling down further to line 109 paste it the following:
Finally, scrolling down to line 132, paste in the following:
This will allow Land Encounters and Desert Encounters to happen on the same map.
The next step is to ctrl+shift+F for:
And
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:
And under "bases" Paste in:
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:
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:
If you have already added in Terrain Tags of your own, add this one after the last one.
Now add in:
into the same section (I added it at about line 50, but that was a personal choice.)
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.
First open the Editor and scroll down to "Set Terrain Tags"
It will ask if you wish to load recent edits, select yes.
Use the arrow keys or use the "pg up" and "pg dn" keys to scroll through the tileset.
Once you have come across the tile you wish to set with the corresponding Terrain Tag, hit enter and use the arrow keys to choose the correct number (in our case 16).
If you use multiple tilesets for different routes, do this for each tileset by clicking the "Z" button to open the menu, and clicking "change tileset" to switch to the next one.
Once you have finished, click "esc" and save and you're done.
Once that has been taken care of, ctrl+shift+F:
in the section PField_Field, and add in:
Now ctrl+shift+F:
and add a new one under the last one, in Stock essentials the last one is:
so you should be adding:
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)
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.
• 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
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
Code:
Desert = 13
And make the following changes afterwards:
Spoiler:
Names=[
"Land",
"Cave",
"Water",
"RockSmash",
"OldRod",
"GoodRod",
"SuperRod",
"HeadbuttLow",
"HeadbuttHigh",
"LandMorning",
"LandDay",
"LandNight",
"BugContest",
"Desert"
]
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]
]
EnctypeDensities=[25,10,10,0,0,0,0,0,0,25,25,25,25,25]
EnctypeCompileDens=[1,2,3,0,0,0,0,0,0,1,1,1,1,1]
end
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?
Second Bit
The next step is to ctrl+shift+F for:
Code:
# Choose backdrop
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"
The next step you're going to do is to ctrl+shift+F:
Code:
module PBTerrain
In Stock Essentials there should be 15 Terrain Tags, add in the 16th:
Code:
Desert = 16
Now add in:
Code:
def pbIsDesertTag?(tag)
return tag==PBTerrain::Desert
end
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:
First open the Editor and scroll down to "Set Terrain Tags"
It will ask if you wish to load recent edits, select yes.
Use the arrow keys or use the "pg up" and "pg dn" keys to scroll through the tileset.
Once you have come across the tile you wish to set with the corresponding Terrain Tag, hit enter and use the arrow keys to choose the correct number (in our case 16).
If you use multiple tilesets for different routes, do this for each tileset by clicking the "Z" button to open the menu, and clicking "change tileset" to switch to the next one.
Once you have finished, click "esc" and save and you're done.
Once that has been taken care of, ctrl+shift+F:
Code:
terrain=$game_player.terrain_tag
Code:
elsif terrain==PBTerrain::Desert
return PBEnvironment::Desert
Now ctrl+shift+F:
Code:
module PBEnvironment
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
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