• 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] Adding Affection Effects

HeyHeyHenry

HeyHeyHenryΔ
11
Posts
4
Years
Oh hey! It's me, HeyHeyHenry. Today I'll try to teach you how to apply almost EVERY Affection Effects in Pokémon Essentials, but first, I want to make sure that you have the Pokémon Amie or Refresh Script Installed in your project... So if you still don't have it, click here to learn how to install it! (Remembering that this Script was an adaptation of the rigbycwts's Script, so please credit Pizza Sun and rigbycwts for this Script!).

First, let's make a small list of what we need to do, current this is everything that is affected by Affection:
Spoiler:

Ok, so First, let's change the Experience Gain! Open your project and search for the "PokeBattle_Battle" script, and go to the Line N°1932, add a new line and in this new line, add this:
Spoiler:


Now search for "if exp>0" in the line N°1937 and Substitute Everything until the line N°1944 with this:

New Code:
Spoiler:

Old Code:
Spoiler:


Good! Now, all Pokémon that have 2 Levels of Affection, already receive a 1.2x experience increase. The next step is to make our Pokémon be able to sometimes, endure attacks, Let's to the "PokeBattle_Move" script, and search for the line N°1165 and substitute all the code until the line N°1187 with this:

New Code:
Spoiler:

Old Code:
Spoiler:


All right! So now our Pokémon can survive from attacks, but we need to make it be able to avoid them too, so let's go to the "PokeBattle_Battle" script, and then to the line N°2398, create a new line and in this new line, insert this:
Spoiler:


Okay! Now let's make it Shake Off those bad Status Conditions >:C!! Let's go to the line N°3299 and add a new line, then in this new line we'll insert this:
Spoiler:


All Right, we now wants to make our Pokémon be able to increase its Critical Ratio when it loves you, so let's go to "PokeBattle_Move" script and then to the line N°557 and add a new line, then in this new line we'll just add this:
Spoiler:


Last steps! We want the different battle quotes, right? So let's go!

1. When our Pokémon lands a Super Effective Move:
Let's go to "PokeBattle_Battler" script and go to the Line N°2855, we'll substitute this line with this lines:
Spoiler:


2. When our Pokémon is with Critical HP remaining:
Let's go to "PokeBattle_Battler" Script and then to Line N°3299, create a new line and in this new line, add this:
Spoiler:


3. Special Message when uses a Item that recovers the HP:
Go to the "PItem_items" script and find the line N°368 and replace everything until the line N°381 with this:
New Code:
Spoiler:

Old Code:
Spoiler:


4. Special Message when your Pokémon is Sleeping:
We'll have to go to "PokeBattle_BattlerEffects" script and then to the line N°472, you'll have to substitute the entire code until the line N°474, with this:
Spoiler:


5. Special Message when it lands a Critical Hit:
We'll have to go to the "PokeBattle_Move" script and then to the line N°1223, there you'll substitute it with this:
Spoiler:


6. Special Message when it enters in Battle:
First go to the "PokeBattle_Battle" script and then found the line N°2493, substitute it with this:
Spoiler:


Then go to the line N°2493 and substitute it with this:
Spoiler:


Now the last thing we need to do is go to the line N°2494 and add a new line, in this new line you will add this:
Spoiler:


And now you have a lot of the Affection effects in battle! I hope you enjoy it, and if you find any error, please, reply it to me! C:
Note: If you want to do it more like Pokémon Let's GO, you will have to change "getAffectionLevel" to "happiness" and the values too
 
Last edited:

Diegou18

Forever Chandelure lover.
75
Posts
6
Years
  • Age 25
  • Seen Aug 16, 2021
I would recommend you to write the new script phrases where users should place the new scripts. With numbers could be confusing if someone has changed his/her codes (Except in the parts that you showed where they should be xd). Besides, try using [code.]text[/code.] (without the dots) to write codes (lol).
But, in other hand, it's a fantastic script. I liked it a lot! Nice work!
 
Last edited:
62
Posts
6
Years
  • Age 118
  • Seen Aug 11, 2022
I didn't understand anything about your script.
It goes all the way.
 
2
Posts
3
Years
  • Age 36
  • Seen Mar 24, 2021
Has anyone successfully adapted this sucker to 18.1? It seems like it should be doable, but I'm not sure where everything should go given the code line directions. I want exactly these effects, though I intend to tie them to happiness rather than affection.
 
162
Posts
7
Years
  • Age 35
  • Seen today
This is a great script.
Works perfectly on 17.2

My question is. How can I reduce the chances of have an affection effect on battle (heal poison or prevent a enemy movement). In my game, my Pokemon are at level 20 and they already do it constantly, reducing the difficulty of the game a lot.

Thank you very much for your work.
 
Back
Top