• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Friend Safari

v20.1 Friend Safari 1.0.11

This resource pertains to version 20.1 of Pokémon Essentials.
Pokémon Essentials Version
v20.1 ➖
Vanilla Essentials Compatibility
This plugin works for Pokemon Essentials 20.1. It may also work for Pokemon Essentials 21.

Other's plugin compatibility
This plugin should not interfere with another plugin unless they alter the wild pokemon created.
It's tested to be compatible with Automatic Level Scaling.
This plugin has been made compatible with Cable Club so you can now let the players send their friend safari code to their friends.

The plugin now has all the code needed for a functional Friend Safari. You still need to make the events to transport the player to other places and to create and register the safaris for the player to access them but this plugin should make it easier and shorter to do.

The updates from now on should only be bug fixes unless someone points things from X and Y's Friend Safari that I forgot to add.

  1. Drop the contents of the zip into the game's folder.
  2. Delete Safari_Compiler v20.1 or v21+ in Lin's Friend Safari/01 - Main if you are not using the proper version of pokemon Essentials.
  3. Configure the script to your liking.
  4. Compile the game.
  5. Start a new game.
  1. Edit the arrays in the Safari_Types file. The first one will have the text to display so put the text inside the _INTL() function. The second array will be used to compare to the pokémon's flags so it has to go without the _INTL() function. Both arrays have to be of the same length.
  2. Edit the Pokemon and Pokemon_forms PBS files to add the flags to the pokémon. You can use Mass Flag/TutorMove adder plugin to facilitate this work.
  3. Use pbGetPokemonFlagList(flagID) instead of pbGetPokemonTypeList(type) to get a list of the pokémon with the flag of the provided index. Note that "flagID" and "type" are both indexes.
  4. You can change the text in pbShowNPCSafariType (in the Safari_NPC file) and pbShowFriendSafariType (in the Safari_Player) from "Type" to any text fits your new safari or just translate it in the language files.

How to use
Be aware that all the plugins calls check if the name you are trying to register has already been stored. This means that you can't register two or more NPC or players with the same name. Multiple NPC or players registered can have the same safari type, though.
Command: pbSetTypeName
Use: used by the pbShowSafari and pbSaveSafariTypeToTxt to show types names instead of a number. Can be used to create messages where an NPC says the name of a type depending on the value of a variable.
Variable:
The types names are stored in $PokemonGlobal.typename.
Command: pbSetTypeID
Use: used by pbGetPokemonTypeList to get a list of pokémon of a certain type.
Variable:
The types names are stored in $PokemonGlobal.typeid.
A variable used to pass and store a list of pokémon. It's used by many of the commands there to pass the array with the pokémon around. It's also used to determine which pokémon overwrite the encounters of the allowed maps.
Variable: $PokemonGlobal.pkmnlist
This makes use of two commands that are, not directly, related to the register friends for the Friend Safari but it allows you to store the name and safari type of NPC to recover anytime during the game to easily register them afterwards. Quite useful if you use variables to randomise the safari type of each NPC at the intro event.
Command: pbStoreNPC(name, type, pkmn)
Use: You have to define the "name", "type" and "pkmn" for it to work. While you can register either text or numbers (maybe more, since there's no check on what is being stored), I recommend using text for the name, a number for the type and an ID or array of ID for the pkmn for the other functions to work.
Variables:
The names are stored in $PokemonGlobal.storage[i].name.
The type's position are stored in $PokemonGlobal.storage[i].type.
The type's names are stored in $PokemonGlobal.storage[i].type_name.
The type's id are stored in $PokemonGlobal.storage[i].type_id.
The pokémon are stored in $PokemonSystemGlobal.storage[i].pkmn_list.
The i indicates a position in the $PokemonSystemGlobal.storage array.
Examples:

While the images show the variable picking a random number between 1 and 18 (one for each type), you can also have each character have a predetermined type.
Command: pbGetNPC(name, var1, var2)
Use: All three have to have a value. Name is a string, the text you used as a name with pbStoreNPC. Var1 and var2 are numbers that correspond to the variables' ID you want to store the data with. Var1 will store the name and var2 will store the type. $PokemonGlobal.pkmnlist will store the array of pokémon.
Example:
A serie of commands for the NPC friend safari. One of them only allows for a visual display of the NPC registered and their friend safari type.
Command: pbAddNPC(name, type, pkmn)
Use: registers an NPC so the player can choose it when trying to enter the friend safari.
Variables:
The names are stored in $PokemonGlobal.npc[i].name.
The type's position are stored in $PokemonGlobal.npc[i].type.
The type's name are stored in $PokemonGlobal.npc[i].type_name.
The type's id are stored in $PokemonGlobal.npc[i].type_id.
The pokémon are stored in $pokemonGlobal.npc[i].pkmn_list.
Examples:

In combination with the NPC storage system:
Command: pbUpdateNPCName(name)
Use: for those that want to add multiple languages and have NPC whit a different name depending on the language. While the _INTL() function will translate the text in the plugins, it does not update when the language changes when it's stored in a variable. This function solves that by changing the matching name to the name the _INTL() returns.
Use it in a common event to just have to call it instead of updating every name every time you need them to be updated.
Command: pbUpdateNPC(name, type, pkmn)
Use: to update all the data of an already registered NPC. Used in the pbAddNPC(name, type, pkmn) command.
Command: pbChooseNPCSafari
Use: checks for all the NPC stored and adds them to show choices. When the player selects one of them, the value of the selected NPC's safari is returned to a variable whose ID is determined in the configuration of the plugin. You can use it with a conditional branch that checks the variable's value to decide where to take the player. Or maybe to change the game's version encounter. The pokémon stored with that NPC are stored in $PokemonGlobal.pkmnlist so they can overwrite the encounters if possible.
Examples:
Command: pbShowNPCPokemon(npcIndex)
Use: Creates a message where the names of the pokémon of the NPC in a certain index are displayed.
Command: pbShowNPCSafariType
Use: Shows a scene where the NPC's names and types are displayed (types with actual names instead of numbers) for the player to see which ones they have registered and which safari type they have. It now allows for multiple pages if there are more than 18 NPC registered.
Examples:
IMPORTANT
I don't know how to make the plugin create folders so you'll have to create the folder or folders for this part to work. The game will also need said folders when it's released so it works when the player tries to use these functions.
Command: pbCreatePlayerSafari(type, pkmn)
Use: stores the type and pokémon of the player's safari. Its needed for pbSaveSafariTypeToTxt.
Variables:
The name of the player is stored in [/ICODE]$PokemonGlobal.player.name[/ICODE].
The type's position of the player's safari is stored in $PokemonGlobal.player.type.
The type's name of the player's safari is stored in $PokemonGlobal.player.type_name.
The type's id of the player's safari is stored in $PokemonGlobal.player.type_id.
The pokémon of the player's safari are stored in $pokemonGlobal.player.pkmn_list.
Command: pbSaveSafariTypeToTxt
Use: When the player interacts with an event with this code, a txt file with the player's name as its name will be created in a folder within the game's folder. Where that folder is and its name can be changed in the configuration.
Example:
Command: pbGetFriendSafari
Use: When the player interacts with an event with this code, a screen to write a name will appear. If the name matches one of the txt names stored in a certain folder within the game's folder, the game will attempt to search for a valid type. If there's a valid type, the player's Safari and pokémon will be registered. The folder where the txt files are readen can be changed in the configuration.
Variables:
The names are stored in $PokemonGlobal.friend[i].name.
The type's position are stored in $pokemonGlobal.friend[i].type.
The type's names are stored in $PokemonGlobal.friend[i].type_name.
The type's id are stored in $PokemonGlobal.friend[i].type_id.
The pokémon are stored in $pokemonGlobal.friend[i].pkmn_list.
Example:
Command: pbAddFriend(name, type, pkmn)
Use: The pbGetFriendSafari uses it to register players but you can use it to manually register players the same way as NPC.
Command: pbUpdateFriend(name, type, pkmn)
Use: to update all the data of an already registered friend. Used in the pbAddFriend(name, type, pkmn) command.
Command: pbChooseFriendSafari
Use: It's used the same way and does the same as pbChooseNPCSafari, just that for players instead of NPC.
Command: pbShowFriendPokemon(friendIndex)
Use: It's used the same way and does the same as pbShowNPCPokemon, just that for players instead of NPC.
Command: pbShowFriendSafariType
Use: It's used the same way and does the same as pbShowNPCSafariType, just that for players instead of NPC.
Commands to facilitate the creation of a list of pokémon for the safari.
Command: pbGetPokemonTypeList(type)
Use: It creates a list of all the allowed pokémon of a certain type that are in your game.
Variables:
The list of pokémon is stored in $PokemonGlobal.pkmnlist.
Command: pbGetPokemonFlagList(flagID)
Use: It works the same way as pbGetPokemonTypeList but searches for pokémon with a certain flag instead of a type. Useful if you want the friend safari to use something else to sort the pokémon of each safari.
Variables:
The list of pokémon is stored in $PokemonGlobal.pkmnlist.
Command: pbGetPokemonSample
Use: It creates a list of pokémon from the list created in pbGetPokemonTypeList(type). The amount of pokémon that are randomly picked from the list is defined in the configuration.
Variables:
The list of pokémon is stored in $PokemonGlobal.pkmnlist.
A series of commands to create a PC for the Friend Safari.
Command: pbSafariPC
Use: For the PC to display the same message and reproduce the same text as when you start another PC. It uses the command pbSafariPCMenu to open the Safari PC.
Command: pbSafariPCMenu
Use: To show the options to choose between the NPC's PC options and the players' PC options. It uses the commands pbSafariNPCMenu and pbSafariFriendMenu to show each PC.
Command: pbSafariNPCMenu
Use: To show the options to choose between managing NPC data or displaying the list of NPC registered and their types. It uses the commands pbPCNPCSafari to manage NPC data and pbShowNPCSafariType to show the list of NPC registered.
Command: pbSafariFriendMenu
Use: It works the same way as pbSafariNPCMenu. It uses the commands pbPCFriendSafari and pbShowFriendSafariType instead.
Command: pbPCNPCSafari
Use: Creates a list to choose from the NPC registered. It allows deleting that NPC info from the register. It also uses the command pbShowNPCPokemon to show a list of that NPC's pokémon list.
Command: pbPCNPCSafari
Use: It works the same way as pbSafariNPCMenu. It uses the command pbShowFriendPokemon instead.
Credits
LinKazamine for the script and image.
FL for the diploma script that served as a base for the visual types list.
Edael for the code that was used to display the text in different positions on the screen.
Vendily for the help with the code.
  • 1690028438510.png
    1690028438510.png
    2.4 KB · Views: 450
  • 1690028590123.png
    1690028590123.png
    9.4 KB · Views: 459
  • 1690028751812.png
    1690028751812.png
    3.7 KB · Views: 457
  • 1690273757918.png
    1690273757918.png
    8.9 KB · Views: 369
  • 1690273781087.png
    1690273781087.png
    5.7 KB · Views: 365
  • 1692544576967.png
    1692544576967.png
    6.7 KB · Views: 306
  • 1692544618989.png
    1692544618989.png
    3.9 KB · Views: 278
  • 1692544624175.png
    1692544624175.png
    3.9 KB · Views: 265
  • 1692544659336.png
    1692544659336.png
    6 KB · Views: 267
  • 1692545865370.png
    1692545865370.png
    13.3 KB · Views: 260
  • 1692545870154.png
    1692545870154.png
    13.3 KB · Views: 262
Author
LinKazamine
Downloads
2,734
Views
2,754
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from LinKazamine

Latest updates

  1. 1.0.11

    Added a compiler that automatically adds flags to the pokemon from the file in...
  2. 1.0.10

    Fixed crash that happened when the game tried to give a hidden ability with a pokémon with less...
  3. 1.0.9

    Added compatibility with Cable Club. Changed the code to use fewer variables. Added a function...
Back
Top