PDA

View Full Version : [Essentials tutorial] [Essentials] Adding Hidden Grottos


Rayd12smitty
March 8th, 2013, 01:56 PM
If this belongs in Tutorials and Resources I apologize Maruno. Please move it there if you think it should be. I put it here as it relates directly to Pokemon Essentials.

Alright, so someone asked a question about Hidden Grottos like in BW2 so I decided to add them to my game once I figured out how to make one. This can probably be done in a much simpler, easier way, but this way works just fine, and I don't know much on scripting.

=====
Sprites
=====
First, you want to find a resource pack that has all the overworld sprites for any Pokemon you want to have in your Hidden Grottos. These have been posted multiple times and a part of quite a few kits. You can find those on your own. Put them and any item/berry sprites you may want in the Graphics/Characters folder.

=======
Script Edits
=======
Open up the Script Editor and find the script section called PokemonEncounterModifiers. Add this to the bottom of it.
# Make all wild Pokémon have their Dream World Ability while Switch 158 is ON.
# You can change what Switch is used in this script by changing the 158 below
# to whatever switch you want to use. Use this just like you would the
# Always Shiny switch.
Events.onWildPokemonCreate+=proc {|sender,e|
pokemon=e[0]
if $game_switches[158]
pokemon.setAbility(2)
end
}
Like the commented out lines say, you can use whatever switch you like. Name the switch DW Wild Pokemon. This switch when turned on will make any wild Pokemon have their Dream World Ability.

===========
The Actual Grotto
===========
You need to make a map for your Hidden Grotto. Be creative. The event to enter your Hidden Grotto should say something like: "There's a small gap in between the trees! Go inside?" and then have a choice yes or no to enter it. This should be activated by the action button, NOT event touched.

The map should only have 3 events in it, plus the exit event(s). Mine looks like this.
http://i.imgur.com/qjTcoMv.png
The exit events should obviously just transport you out of the Grotto, and be activated by Event Touch.

Events A, B, can C are what we need to look at now. A and B determine what will appear in the Grotto and handle when it should respawn. Event C is the actual Pokemon/Item that appears.

=====
Event A
=====
Event A has 3 pages.This event handles 2 things. First, it decides what will appear in your Hidden Grotto, and second it handles when the Grotto should Respawn. There are 2 switches and a variable used in this event. You will need a switch and variable for each grotto you make. The time count down switch is always used in all of them (It is switch 23). If you make a second Grotto, it needs its own set of these switch/variable. If you make 7 Grottos, you will need 7 sets of these. The random number picked in the first page of this event can be changed to whatever you like. If you pick (0...9) like me, there are 10 possible outcomes for your Grotto.

The first page has no conditions and is triggered by Parallel Process. It should look like this.
http://i.imgur.com/PMjsc5r.png
Please note that the variable called Route 2 Grotto should be called x Grotto, with x being the location of the Grotto. Same for the switch called Route 2 Grotto. EX. if your Grotto is located in Route 7 of your game, both your switch and your variable should be called Route 7 Grotto.

The second page should be completely blank and have the condition "Self Switch A is ON"

The third page should be triggered by Autorun and have the conditions "Self Switch A is ON" and switch 23 which is called
"s:cooledDown?(86400) is ON" The page should look like this.
http://i.imgur.com/eZtegg5.png
Once again note that the switch called Route 2 Grotto should be called x Grotto, with x being the location of your Grotto.

=====
Event B
=====
The second event changes the graphics of what is in your Hidden Grotto, depending on the random number picked in Event A. This event only has one page, and is triggered by Parallel Process. There are no conditions for this event. The event first needs a Conditional Branch. This is dependent on the switch you made in Event A that was called x Grotto being OFF.
Everything else in this event goes inside this Conditional Branch.

Now, the next part is stackable, and you need one for each possible number picked in Event A for the variable called x Grotto. Remember that 0 counts as an option. Mine was set to (0...9) so there are 10 options. Each option needs a conditional branch that looks like this.
http://i.imgur.com/S0lzYpN.png
The event that this is effecting is Event C which we haven't gotten to yet. This is changing the graphics of Event C to the picture in Graphics/Characters called "012" which is Butterfree's overworld sprite.
These events can stack on top of each other. Remember, you need to make one of these for each outcome that your variable could be set to. You can have the graphic be a Pokemon, Item Ball, or nothing at all if you want there to be a chance the Grotto is empty. A full page of these could look like this.
http://i.imgur.com/y5WK1Bn.png
This goes on for however many options there are.

=====
Event C
=====
We are almost done. Event C is the actual event you interact with inside the Grotto. It has two pages. NEITER HAVE A GRAPHIC.

The first page has no conditions and is triggered by Action Button. This page contains many conditional branches, just like Event B. There is one for each possible outcome. Each one will look different depending on what you want. For each one that in Event B you set a graphic for a Pokemon, it should look like this. Make sure you do the same Pokemon as the Graphic, or clicking on a Butterfree could start a battle with a Dunsparce.

This is what a Wild Pokemon's should look like.
http://i.imgur.com/6En5HFk.png
Once again the variable this depends upon is the one you named x Grotto.
The switch that is turned on before the battle and off after the battle makes the Pokemon have their Dream World Ability.

You can change these to do whatever you want. If you have the graphic set to an Itemball, make it give you an item. If its set to no graphics, make it blank. Use your creativity and imagination.

After you have all of them stacked on top of each other, which in my case is 10, add this line to the bottom of the event page.
http://i.imgur.com/HxrJVyV.png
Like I said many times before, the switch should be called x Grotto, where x is the location of the Grotto.

The second page of the event should be blank, and have the condition "x Grotto is ON"


Thats all :D Please try this out and let me know what you think. Also let me know if this is easy to understand or if I could explain it better.

joeyhugg
February 23rd, 2014, 08:02 PM
Thank you so much, Rayd! This has helped tremendously!

Edit: I've encountered a problem. I did exactly as the instructions say, and yet Event C has no graphic nor does it provide me with an encounter upon pressing the action button. Help?

Rayd12smitty
February 24th, 2014, 12:14 PM
This is from a long time ago. I would guess you did something wrong but I wouldn't worry about it. I'm working on a much better version that I'll release in a few days if you can wait.

joeyhugg
February 24th, 2014, 02:19 PM
This is from a long time ago. I would guess you did something wrong but I wouldn't worry about it. I'm working on a much better version that I'll release in a few days if you can wait.

Oh, I can wait. I look forward to it, Rayd!

Chrisario
March 1st, 2014, 02:43 AM
I when I tried to test it it gave me this long error message

Interpreter:276:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'
Exception: RuntimeError
Message: Script error within event 5, map 4 (Hidden Grotto):
Exception: NoMethodError
Message: (eval):1:in `pbExecuteScript'undefined method `PBSpecies' for #<Interpreter:0x9d9ee68>
***Full script:
pbWildBattle(PBSpecies:HERACROSS,24)

Interpreter:243:in `pbExecuteScript'
Interpreter:1600:in `eval'
Interpreter:243:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'

Interpreter:276:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'
Exception: RuntimeError
Message: Script error within event 5, map 4 (Hidden Grotto):
Exception: NoMethodError
Message: (eval):1:in `pbExecuteScript'undefined method `PBSpecies' for #<Interpreter:0x9d02160>
***Full script:
pbWildBattle(PBSpecies:SANDILE,29)

Interpreter:243:in `pbExecuteScript'
Interpreter:1600:in `eval'
Interpreter:243:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'

Interpreter:276:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'
Exception: RuntimeError
Message: Script error within event 5, map 4 (Hidden Grotto):
Exception: NoMethodError
Message: (eval):1:in `pbExecuteScript'undefined method `PBSpecies' for #<Interpreter:0x9d02ad8>
***Full script:
pbWildBattle(PBSpecies:PHANPY,29)

Interpreter:243:in `pbExecuteScript'
Interpreter:1600:in `eval'
Interpreter:243:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'

Interpreter:276:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'
Exception: RuntimeError
Message: Script error within event 5, map 4 (Hidden Grotto):
Exception: NoMethodError
Message: (eval):1:in `pbExecuteScript'undefined method `PBSpecies' for #<Interpreter:0x9d01c38>
***Full script:
pbWildBattle(PBSpecies:RATTATA,24)

Interpreter:243:in `pbExecuteScript'
Interpreter:1600:in `eval'
Interpreter:243:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'

Interpreter:276:in `pbExecuteScript'
Interpreter:1600:in `command_355'
Interpreter:494:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'

Is it when which switch is activated Do I need to Add the DW Pokemon Var to make it work

Maruno
March 1st, 2014, 05:22 AM
You have this:

pbWildBattle(PBSpecies:RATTATA,24)This is just wrong. You should use one of these instead:

pbWildBattle(PBSpecies::RATTATA,24)
pbWildBattle(:RATTATA,24)Note where the colons are, and how many of them there are.