• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

[Scripting Question] Ultra Necrozma & Greninja-Ash

51
Posts
9
Years
  • Seen Jan 8, 2023
Hello Guys!
I have two questions for you. Actually i'm using the 17.2 version and i have some problem with "Mega Evolution" Script. I would like to add Ultra-Necrozma and Greninja Ash but i have these problems:
Greninja-Ash.
First i add in Compiler this line
Spoiler:

Then i wrote in MegaEvolution
Spoiler:

The problem is that the Mega Evolution not start. (I wrote in pokemonsform.txt)

Ultra Necrozma
in Mega Evolution i wrote this:
Spoiler:

The problem is when the battle ends, returns in the form 0 and not in 1/2 form. Can you help me?
 

mybusiness

Guest
0
Posts
I'll adress Greninja, for the moment, because Ultra-Necrozma is not at my disposal yet.
So, delete everything you have about Greninja in the scripts. Copy only what I've written with red. Let's go:

In PokeBattle_Battler:
Spoiler:


In PokeBattle_MoveEffects:
Spoiler:

In Pokemon_Forms, under def def initialize(*args):
Spoiler:

In PokeBattle_Battle, in def pbThrowPokeBall:
Spoiler:

In PField_Battles, in def pbAfterBattle:
Spoiler:

Edit: Now I saw that Poq and WolfPP solved this before me, although we arrived independently to this conclusion.
Edit2: With this code, a Greninja with Battle Bond can activate its ability again in the same battle if it dies, revives and faints an opponent again, which Bulbapedia says it shouldn't happen.
 
Last edited:

Poq

144
Posts
6
Years
  • Age 34
  • Seen Aug 28, 2021
With this code, a Greninja with Battle Bond can activate its ability again in the same battle if it dies, revives and faints an opponent again, which Bulbapedia says it shouldn't happen.

I've got solution for this! It's not exactly elegant, but it should work - and the good news is that it involves only a slight modification to mybusiness's code. What we need to do is give Greninja a dummy ability that looks just like Battle Bond, but doesn't do anything. I'll explain:

First things first, in abilities.txt, copy the line for Battle Bond at the bottom. Change the ability number to something unused, and change the internal name (the one in all caps) to something distinct but memorable, like XBATTLEBONDX. Leave the display name as is.

Next, in pokemon.txt, assign this ability to Greninja as a second hidden ability.

Now we're ready to get into the code. First, we'll go to PokeBattle_Battler and the code for pbFaint:
Spoiler:

That will give Greninja it's dummy ability when it faints, but only if it has changed form. So in Greninja's summary, it will still look like it has the usual Battle Bond ability, but if the player revives the Greninja, the dummy ability will not trigger any of the other code to activate Battle Bond.

Next, we need to make it so that the REAL Battle Bond gets reset after battle. Back in PField_Battles, in def pbAfterBattle:
Spoiler:

This should ensure that Greninja with Battle Bond can only change forms once per battle. I'm sure there is a more coherent way of accomplishing it, but this is what I came up with.
 
Last edited:
11
Posts
4
Years
  • Age 26
  • Seen Sep 23, 2022
Poq's script for PokeBattle_Battler seems to be missing an end statement, causing a syntax error.

Here's a fixed version:
Spoiler:


Basically, just add an end statement under @pokemon.setability(3) and it should work.
 
Back
Top