Advertiser Content

Recruiting Let's Fix Shadow Pokémon in Essentials!

Started by Prodigal96 September 26th, 2019 1:39 PM
  • 1023 views
  • 18 replies
Age 23
Male
Ohio
Seen 1 Day Ago
Posted 2 Days Ago
27 posts
148 Days
Recruiting scripters to help solve the problems with Shadow Pokemon in Essentials

Hi all! I'm looking to implement Shadow Pokemon into my game, in a fashion identical to that of Pokemon XD. Shadow Pokemon have numerous problems in Essentials, and I would love if we could figure them all out together! I've done tons of research, and can't find any place dedicated to the proper implementation of Shadow Pokemon in Essentials. I've solved a one of the main problems and will post the solution below.

Thanks in advance! Would love any help, information, or feedback! If you know if any of these issues already have a fix, I'd love to know. Also report any other issues with Shadow Pokemon, and I'll add them to the list. Note that I am not using Elite Battle System, which may have some differences.

Here is what I've found that needs fixed in unedited Essentials scripts:

1. TYPE EFFECTIVENESS -- SOLVED (see below posts)
Following the Wiki's method of adding the Shadow typing to Essential results in a few quirks. Shadow Pokemon lose their natural typing and literally become Shadow-type Pokemon. Shadow moves are also double super-effective against a normal Pokemon with two types. I will post my solution to this in a comment!

2. HEART GAUGE SIZES -- SOLVED by Vendily (see below posts)
In Colosseum/XD, each Pokemon has a different Heart Gauge Size, with larger sizes taking more time to purify. Essentials only has a singular Heart Gauge Size, which means an Arceus is as easy to purify as a Rattata. A way to specify a Heart Gauge Size for individual Pokemon is required.

3. HYPER MODE -- SOLVED (see my below post)
In Colosseum/XD, only your Shadow Pokemon can enter Hyper Mode. In Essentials, your opponent's Pokemon can enter Hyper Mode too. This is undesirable because Hyper Mode inflicts recoil after each turn. Your opponent's Shadow Pokemon may faint before capture due to this. Some condition should be created that prevents the opponent's Pokemon from entering Hyper Mode.

4. SNAGGING IN DOUBLE BATTLES
Colosseum/XD are unique in having almost all battles be double battles. Unlike in newer games, you could aim a Poke Ball at either Pokemon in a double battle. In Colosseum/XD, you could throw one Snag Ball per turn, with either one of your Pokemon, giving your other Pokemon the ability to attack, switch, Call, or use a different item in the same turn. In Essentials, you are only able to throw a Poke Ball with your first Pokemon, and it automatically aims at your opponent's Pokemon that is diagonal to yours. No choice is given as to which Pokemon to target. If you attempt to use your second Pokemon to throw a Poke Ball, it will say that it is impossible to aim with two Pokemon.

5. UNLOCK NATURE/MOVES GRADUALLY -- SOLVED (see my below post)
The Heart Gauge is divided up into 5 bars, with something new unlocked as you progress the purification process. A newly caught Shadow Pokemon will have its Nature hidden, and any non-Shadow moves hidden. After the first bar, you regain one of its non-Shadow moves. After the second bar, you reveal the Nature. After the third bar, you get another non-Shadow move. After the fourth bar, you get another move and it enters Hyper mode more often. Essentials seems to allow you to unlock moves gradually as expected, but this can interfere with special moves gained upon purification. Also, the Nature appears immediately in Essentials; after the second bar the Nature disappears until it is purified. This is obviously backward from the way it was intended.

6. REGAIN SPECIAL MOVES UPON PURIFICATION SOLVED by sonicfan7895 (see below posts)
In Pokemon XD, a Shadow Pokemon would regain special moves to replace its Shadow moves when it was purified. These would be Egg moves, TM moves, or moves exclusive to XD (such as Zapdos with Extrasensory). In Essentials, it replaces the Shadow moves with moves from the Pokemon's normal movepool based on its level. Ideally, it would be possible to define special moves for each Shadow Pokemon separate from its natural movepool. If you define these special moves in shadowmoves.txt, they will be replaced upon purification. If you define them in trainers.txt, purification will not replace Shadow moves with regular moves.

7. PURIFY CHAMBER BUGS
If you have updated Shadow Pokemon to include Heart Gauge Sizes (see Problem 2), the Purify Chamber will become incompatible with them. It does not recognize the new method we defined (I called it "vibecheck") to allow different-sized Heart Gauges, so this must be defined again in the Purify Chamber script.

In Essentials, the Purify Chamber only uses the primary typing of a Pokemon to determine Type matchups used in the Flow/Tempo. In XD, both Types of a dual-Typed Pokemon were considered. This is not super important, but it's a nice quality of life change.

When you open a PC Box in the Purify Chamber, the Party screen remains on top of the Boxes, covering up half of the Pokemon. It is also difficult to access the Party itself due to this--it may be worth it to remove access to the Party screen entirely from within the Purify Chamber, which would kill two birds with one stone.


MINOR ISSUES
8. GAIN EXPERIENCE FOR SNAGGING A POKEMON
If you have experience gained for catching a Pokemon, you will still not get experience for snagging a Shadow Pokemon.

9. SHINY/MEGA SHADOW POKEMON -- PARTIALLY SOLVED (see my below post)
Editing a Shadow Pokemon to Mega Evolve or be Shiny has numerous quirks. These are not things you'll need most likely, so they may not be worth fixing. The issues are that a snagged Mega will remain Mega, and a Shiny Shadow Pokemon will either not register as Shadow, or it will not be Shiny. In the main games, Shadow Pokemon have the doors to their hearts closed, so they probably wouldn't be able to Mega Evolve since that requires a bond with a Trainer (I guess if you made up some reason like a special device that forces Mega Evolution it could work). Also Shadow Pokemon in XD were Shiny-locked.

10. INCORRECT ORIGINAL TRAINER TEXT COLOR
This one is super nitpicky, but it's worth listing. The Original Trainer text on a Shadow Pokemon corresponds to the gender of the person you snagged it from, instead of based on your gender. For example, if you are the male Trainer and snag a female Trainer's Shadow Pokemon, its OT will say your name but be in red letters instead of blue. This is probably a very easy fix, I may get to it later.
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum
Age 23
Male
Ohio
Seen 1 Day Ago
Posted 2 Days Ago
27 posts
148 Days
HOW TO FIX TYPE EFFECTIVENESS ISSUES WITH SHADOW POKEMON
The procedure detailed in the Pokemon Essentials Wiki doesn't quite add in the Shadow Type correctly. Here I detail the steps to implement the Shadow type!

1. Add the Shadow type into types.txt, including desired type matchups. Make sure to add Shadow type graphics into types.png, icon_types.png, and cursor_fight.png

2. In the scripts, in the Shadow Pokemon section, go to the line "#Called into battle". There are lines that overwrite a Shadow Pokemon's natural typing to become a literal Shadow type. Delete or comment out the lines under "if self.isShadow?" that read:
if hasConst?(PBTypes,:SHADOW)
self.type1=getID(PBTypes,:SHADOW)
self.type2=getID(PBTypes,:SHADOW)
end
This should fix the typing issues!
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum

Vendily

Female
Seen 1 Hour Ago
Posted 3 Days Ago
1,079 posts
4.5 Years
For your second fix, perhaps we can add an optional property to pokemon.txt by editing the Compiler. Bytes 59 through 75 are free, and if we want enough room for big numbers, 2 bytes should do the trick. So kind of like "StepsToHatch".

    "Incense"          => [54,"E",PBItems],
    "ShadowHeartValue" => [59,"w"] # Wow, new property!
If ShadowHeartValue is not defined, it has a value of 0 automatically. this is something to watch out for later.

Then in the shadow stuff, we define a way to pull this new property. Since StepsToHatch is pretty close to what we want, we can look to how it pulls the data.
  dexdata=pbOpenDexData
  pbDexDataOffset(dexdata,babyspecies,21)
  eggsteps=dexdata.fgetw
  dexdata.close
So we need to modify this to point to our new offset.
  def vibecheck # I didn't want to think up a method name...
    dexdata=pbOpenDexData
    pbDexDataOffset(dexdata,self.species,59) # 59 is our offset from earlier
    shadowheart=dexdata.fgetw
    dexdata.close
    return shadowheart
  end
You should probably put in an exception for if shadowheart is 0, make a default value. That's an exercise for the reader :P

Finally, basically every instance of the constant HEARTGAUGESIZE has to change to point to our new method.

It doesn't deal with multiple forms having different heart gauges, you'll need to modify def pbCompilePokemonForms, as well as change the self.species to self.fspecies

Disclaimer, I only actively tested the first two steps.
Male
Seen October 6th, 2019
Posted October 1st, 2019
58 posts
4 Years
I'm glad to see that other people are interested in Shadow Pokemon in Essentials. I loved Colosseum back in the day, and I enjoyed the improved Shadow mechanics from XD.

I'm not much of a programmer, but I've fiddled a little bit with trying to correct the type effectiveness flaws of Shadow moves. Deleting the lines of text that you mentioned worked for me in the past, but here recently someone supplied me with a bit of code (I did not make it) that seemed to also correct the type effectiveness issue in a clean Essentials 17.2 without changing those four lines. I inserted the new code in the PokeBattle_Move section, around the type effectiveness subsection (~line 281), and the test Shadow Electabuzz took proper type damage like a normal one would. I've included this prospective fix code below. (I'm still trying to figure out how to post stuff on here, so I may not format the code properly.)

def pbTypeModifier(type,attacker,opponent)
    i = pbTypeModifierTrue(type,attacker,opponent)
    has_changed = false
    if isConst?(type,PBTypes,:SHADOW)
      if opponent.pokemon.isShadowForMove?
        i = 2
      else
        i = 8
      end
    end
    if $game_switches[302]
      if i == 8
        i = 2
        has_changed = true
      end
      if i == 2 && !has_changed
        i = 8
        has_changed = true
      end
      if i == 1 && !has_changed
        i = 16
        has_changed = true
      end
      if i == 16 && !has_changed
        i = 1
        has_changed = true
      end
      if i == 0 && !has_changed
        i = 16
        has_changed = true
      end
    end
    return i
  end
Maybe someone could test this and make sure that it actually works?

Pokeminer20

Team Ningo (PokeMiner20#8338)

Male
On Earth
Online now
Posted 1 Day Ago
143 posts
5.8 Years
for step 4, the first part is to remove the limiter that forbids you to capture a pokemon. so replace
ItemHandlers::BattleUseOnBattler.addIf(proc{|item|
                pbIsPokeBall?(item)},proc{|item,battler,scene|  # Any Poké Ball
   battle=battler.battle
   if !battler.pbOpposing1.fainted? && !battler.pbOpposing2.fainted?
     if !pbIsSnagBall?(item)
       scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there are two Pokémon!"))
       return false
     end
   end
   if battle.pbPlayer.party.length>=10 && $PokemonStorage.full?
     scene.pbDisplay(_INTL("There is no room left in the PC!"))
     return false
   end
   return true
})
with
ItemHandlers::BattleUseOnBattler.addIf(proc{|item|
                pbIsPokeBall?(item)},proc{|item,battler,scene|  # Any Poké Ball
   battle=battler.battle
#   if !battler.pbOpposing1.fainted? && !battler.pbOpposing2.fainted?
#     if !pbIsSnagBall?(item)
#       scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there are two Pokémon!"))
#       return false
#     end
#   end
   if battle.pbPlayer.party.length>=10 && $PokemonStorage.full?
     scene.pbDisplay(_INTL("There is no room left in the PC!"))
     return false
   end
   return true
})
that'll let you throw a pokeball regardless but you can't select which mon to catch, and since the battle will automatically continue with this, if we can aim properly, we have it working
Proud developer of Project Angel Links
Age 23
Male
Ohio
Seen 1 Day Ago
Posted 2 Days Ago
27 posts
148 Days
For your second fix, perhaps we can add an optional property to pokemon.txt by editing the Compiler. Bytes 59 through 75 are free, and if we want enough room for big numbers, 2 bytes should do the trick. So kind of like "StepsToHatch".

    "Incense"          => [54,"E",PBItems],
    "ShadowHeartValue" => [59,"w"] # Wow, new property!
...
So we need to modify this to point to our new offset.
  def vibecheck # I didn't want to think up a method name...
    dexdata=pbOpenDexData
    pbDexDataOffset(dexdata,self.species,59) # 59 is our offset from earlier
    shadowheart=dexdata.fgetw
    dexdata.close
    return shadowheart
  end
...
Finally, basically every instance of the constant HEARTGAUGESIZE has to change to point to our new method.
Thanks so much for your help! I did this and it definitely got things on the right track. However, there's one more problem left that I can't seem to figure out. I've been messing around with it for hours and didn't make much progress. So far, I've added ShadowHeartValue to pokemon.txt and the Compiler, defined "vibecheck", and replaced the instances of HEARTGAUGESIZE with vibecheck throughout the scripts.

The issue now is that I'll get a no method error saying I didn't define vibecheck.

[Pokémon Essentials version 17.2]

Exception: NoMethodError
Message: undefined method `vibecheck' for PokeBattle_Pokemon:Class

PScreen_Summary:363:in `drawPageOne'
PScreen_Summary:347:in `drawPage'
PScreen_Summary:163:in `pbStartScene'
PScreen_Summary:1312:in `pbStartScreen'
PScreen_Party:626:in `pbSummary'
PScreen_Party:1192:in `pbPokemonScreen'
PScreen_Party:1089:in `loop'
PScreen_Party:1289:in `pbPokemonScreen'
PScreen_PauseMenu:176:in `pbStartPokemonMenu'
PScreen_PauseMenu:173:in `pbFadeOutIn'
However, I added attr_accessor(:vibecheck) to the list of classes in PokeBattle_Pokemon and it doesn't notice it. I'm a novice coder so maybe I'm not understanding exactly how this functions?
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum

Vendily

Female
Seen 1 Hour Ago
Posted 3 Days Ago
1,079 posts
4.5 Years
<snip>
def vibecheck should be a method in class PokeBattle_Pokemon.
Like you could put this in a new script section, and that will define it as a method for the class, like def type1
class PokeBattle_Pokemon
  def vibecheck
    dexdata=pbOpenDexData
    pbDexDataOffset(dexdata,self.species,59)
    shadowheart=dexdata.fgetw
    dexdata.close
    return shadowheart
  end
end
You don't need the attr_accessor, it's not a variable, and doesn't need to save any data.
Age 23
Male
Ohio
Seen 1 Day Ago
Posted 2 Days Ago
27 posts
148 Days
<snip>
Thank you sooooo much! I got it working! It's a thing of beauty. XD
I'm going to post a step-by-step solution soon so others can use it. Next I'm going to try and figure out how to prevent your opponent from entering Hyper mode, and how to aim at either Pokemon in a double battle.
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum
Age 23
Male
Ohio
Seen 1 Day Ago
Posted 2 Days Ago
27 posts
148 Days
HOW TO PREVENT OPPONENT'S SHADOW POKEMON FROM ENTERING HYPER MODE

This fix is super simple. In Pokemon_ShadowPokemon, find the part defining Hyper Mode:
def pbHyperMode
    p=self.pokemon
    if p.isShadow? && !p.hypermode
Just add the condition specifying you want it to only apply to the player's Shadow Pokemon:
&& @battle.pbOwnedByPlayer?(@index)
The entire line will now look like this:
def pbHyperMode
    p=self.pokemon
    if p.isShadow? && !p.hypermode && @battle.pbOwnedByPlayer?(@index)
And that's it!
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum
Age 23
Male
Ohio
Seen 1 Day Ago
Posted 2 Days Ago
27 posts
148 Days
Made a couple of discoveries that refined the Shadow Pokemon mechanic more!

PREVENT SHADOW POKEMON FROM BEING IN THE DAY CARE
Starting in XD, you could not put a Shadow Pokemon in the Day Care. If you would like to prevent the player from putting Shadow Pokemon in the Day Care, we only need to alter one line in PSystem_PokemonUtilities. Find the section about halfway down "Choose a Pokémon in the party". We want to edit the function "pbChooseNonEggPokemon". Simply add another condition "!poke.isShadow?", which says that we don't want Shadow Pokemon chosen. It will look like this:

def pbChooseNonEggPokemon(variableNumber,nameVarNumber)
  pbChoosePokemon(variableNumber,nameVarNumber,proc {|poke|
     !poke.egg? && !poke.isShadow?
  })
end
Note that if you ever use this function in-game for something other than the Day Care Lady, it still won't let you choose a Shadow Pokemon. You could copy this function and give it a different name to create new conditions for certain situations. Also, I tried using "pbChooseTradablePokemon" which is supposed to exclude Shadows and Eggs, but for some reason it didn't work for me.

LOWER HEART GAUGE BY WALKING

In Colosseum and XD, every 256 steps walked reduces the Heart Gauge by 100. In Essentials, the default has each step taken lower the Heart Gauge by 1. This is too quick for my game, so I wanted to change it to be like Colosseum/XD. Since every 256 steps the game attempts to generate an Egg at the Day Care, we can use this script for our starting point. What we want to utilize is Events.onStepTaken and $PokemonGlobal.daycareEggSteps. In Pokemon_ShadowPokemon, either comment out or delete the original section starting with Events.onStepTaken. Replace it with this:

Events.onStepTaken+=proc{
   for pkmn in $Trainer.party
     if pkmn.hp>0 && !pkmn.egg? && pkmn.heartgauge>0
        $PokemonGlobal.daycareEggSteps=0 if !$PokemonGlobal.daycareEggSteps
        $PokemonGlobal.daycareEggSteps+=1
        if $PokemonGlobal.daycareEggSteps==256
           $PokemonGlobal.daycareEggSteps=0
           pkmn.adjustHeart(-100)
           pbReadyToPurify(pkmn) if pkmn.heartgauge==0
        end          
     end
   end
   if ($PokemonGlobal.purifyChamber rescue nil)
     $PokemonGlobal.purifyChamber.update
   end
   for i in 0...2
     pkmn=$PokemonGlobal.daycare[i][0]
     next if !pkmn
     pkmn.adjustHeart(-1)
     pkmn.pbUpdateShadowMoves()
   end
}
And there we have it! Every 256 steps the Heart Gauge of all Shadow Pokemon in the party decreases by 100. You could modify these numbers however you want based on how long you want it to take to purify. You could also remove this section altogether if you want the Heart Gauge to not decrease by walking. Note that Shadow Pokemon in the Day Care still reduce the Heart Gauge by 1 with every step. I left this code alone since I prevented Shadow Pokemon from entering the Day Care in the first place.
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum
Age 23
Male
Ohio
Seen 1 Day Ago
Posted 2 Days Ago
27 posts
148 Days
HOW TO PROPERLY DISPLAY NATURES DURING PURIFICATION

Shadow Pokemon have their Nature hidden until the Heart Gauge has been reduced by 2 bars. However, in Essentials they actually act backwards--the Nature is revealed at the start, and disappears when you have gone through 2 bars. Kinda weird! Thankfully it's a super easy fix since we're just tweaking one line.

Find "def drawPageTwo" in PScreen_Summary. We want to replace the line directly under the comment "# Write nature" with this slightly modified line:
shownature = (@pokemon.isShadow? && @pokemon.heartStage<=3 rescue false) || !(@pokemon.isShadow? rescue false)
That will hide the Nature on the 2nd page of a Shadow Pokemon's summary. However, page 3 still shows the increased/decreased stats affected by the Nature. But we can fix that with the same line! Under "def drawPageThree" find the line that looks like what we used before and replace it with this:
if (@pokemon.isShadow? && @pokemon.heartStage<=3 rescue false) || !(@pokemon.isShadow? rescue false)
Now Natures will behave properly for Shadow Pokemon.

UNLOCKING MOVES DURING PURIFICATION
To properly unlock moves as the Heart Gauge decreases, you'll want to set things up in this format. In trainers.txt, Define the Shadow Pokemon each Trainer has by setting things up normally, except leave the moves blank.

In shadowmoves.txt, only include the Shadow Moves you want each Shadow Pokemon to know--don't include any natural moves. These will unlock normally as the Heart Gauge goes down.

When a Pokemon is purified, it will fill its moveslots with its most recent moves learned by level-up. Still need to find a way to give exclusive moves upon purification that aren't in the normal movepool (like Lugia with Psycho Boost or Zapdos with Metal Sound from XD).
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum
Age 23
Male
Ohio
Seen 1 Day Ago
Posted 2 Days Ago
27 posts
148 Days
I'm glad to see that other people are interested in Shadow Pokemon in Essentials. I loved Colosseum back in the day, and I enjoyed the improved Shadow mechanics from XD.

I'm not much of a programmer, but I've fiddled a little bit with trying to correct the type effectiveness flaws of Shadow moves. Deleting the lines of text that you mentioned worked for me in the past, but here recently someone supplied me with a bit of code (I did not make it) that seemed to also correct the type effectiveness issue in a clean Essentials 17.2 without changing those four lines. I inserted the new code in the PokeBattle_Move section, around the type effectiveness subsection (~line 281), and the test Shadow Electabuzz took proper type damage like a normal one would. I've included this prospective fix code below. (I'm still trying to figure out how to post stuff on here, so I may not format the code properly.)

...

Maybe someone could test this and make sure that it actually works?
Hi Maicerochico! Sorry for my super late reply! I've been testing lots of things and working on my game lately. I did finally get around to testing out your code! Unfortunately, it didn't work for me. I added your code in, and I put the part I deleted back in. It would count Shadow moves as Super-effective against non-shadow Pokemon, and Shadow moves were not very effective against other Shadows. However, using any regular moves on a Shadow Pokemon would always result in a neutral hit. Not exactly sure what went wrong! I appreciate you helping me out with Shadow Pokemon though, it's definitely one of my favorite concepts in Pokemon.
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum
Age 23
Male
Ohio
Seen 1 Day Ago
Posted 2 Days Ago
27 posts
148 Days
SNAGGING SHADOW MEGA POKEMON

Depending on your version of Essentials, if you catch a Shadow Mega Pokemon, it might stay Mega once you have caught it. This is actually a well-known bug with the default script for Megas (and Primals), where they all remain Mega even after battle. Maruno gave the official fix here:

https://www.pokecommunity.com/showpost.php?p=9260625&postcount=984

Thanks Vendily for pointing this out!
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum

Vendily

Female
Seen 1 Hour Ago
Posted 3 Days Ago
1,079 posts
4.5 Years
snipped
thats the v16 code. this was the official fix.
https://www.pokecommunity.com/showpost.php?p=9260625&postcount=984

are you working with v16.2?

sonicfan7895

Just a dude, I guess

Age 22
Male
Akala Island, Alola
Seen 13 Hours Ago
Posted January 1st, 2020
106 posts
9.2 Years
Hello! I'm trying to experiment with some of these fixes.

I implemented the fix for custom Heart Gauge Sizes in my own custom project, and followed every instruction to a "T" (save for the instructions on multiple forms, for now). While I'm debugging, I try to make a Pokemon a Shadow Pokemon, and I get the following error:

---------------------------
Orre's Return
---------------------------
[Pokémon Essentials version 17.2]
Exception: FloatDomainError
Message: NaN
Pokemon_ShadowPokemon:372:in `ceil'
Pokemon_ShadowPokemon:372:in `heartStage'
Pokemon_ShadowPokemon:421:in `pbUpdateShadowMoves'
Pokemon_ShadowPokemon:409:in `makeShadow'
Debug_Pokemon:722:in `pbPokemonDebugActions'
Debug_Pokemon:711:in `loop'
Debug_Pokemon:744:in `pbPokemonDebugActions'
Debug_Pokemon:814:in `pbPokemonDebug'
Debug_Pokemon:798:in `loop'
Debug_Pokemon:818:in `pbPokemonDebug'

This exception was logged in 
C:\Users\Hollis Pierman\Saved Games\Orre_s Return\errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK   
---------------------------
Keep in mind, I do have custom Shadow Moves and the Pokemon in question, Mewtwo, is already defined in shadowmoves.txt, so it's set to update with all of its Shadow Moves.

How can I fix this? I may be the lead programmer in my projects, but I'm still kind of a novice when it comes to this language.

Also, quick fix for Prodigal96, wondering about Shadow Pokemon re-learning moves during purification, while I brought up shadowmoves.txt.
This is all true, but if you want your desired Shadow Pokemon to have some special moves, you hide them underneath the Shadow Moves by defining them in trainers.txt.

For example, if I decided I wanted to give Weepinbell, say, Frenzy Plant...

From trainers.txt...
WEEPINBELL,21,,FRENZYPLANT,XSCISSOR,,,,,,,,,,,true
From shadowmoves.txt...
WEEPINBELL=SHADOWSTORM,SHADOWRAVE
Now the first move in this Weepinbell's moveset will be replaced with Shadow Storm until it is purified, at which time it will learn Frenzy Plant. And the next move, Shadow Rave, will be replaced by X-Scissor when it reaches the correct Heart Stage.

Any ideas for my problem would be greatly appreciated!
Check out my band: Sliver!
On Facebook

mgriffin

Seen 1 Hour Ago
Posted 2 Days Ago
1,020 posts
5.8 Years
I implemented the fix for custom Heart Gauge Sizes in my own custom project, and followed every instruction to a "T" (save for the instructions on multiple forms, for now). While I'm debugging, I try to make a Pokemon a Shadow Pokemon, and I get the following error:
My guess is that you're getting a NaN because you've got 0.0/0.0 somewhere in the computation before you ceil it; at least that's typically how I end up with NaNs at work. But I haven't looked at your code, so I could be wrong.
Age 23
Male
Ohio
Seen 1 Day Ago
Posted 2 Days Ago
27 posts
148 Days
thats the v16 code. this was the official fix.
https://www.pokecommunity.com/showpost.php?p=9260625&postcount=984

are you working with v16.2?
Thanks for making me aware of that! I've been using v17.2. I tested it with regular Megas, and they would remain Mega outside of battle. Same thing if I were to make them Shadow. At any rate, it got fixed, so thanks! :)
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum
Age 23
Male
Ohio
Seen 1 Day Ago
Posted 2 Days Ago
27 posts
148 Days
Hello! I'm trying to experiment with some of these fixes.

I implemented the fix for custom Heart Gauge Sizes in my own custom project, and followed every instruction to a "T" (save for the instructions on multiple forms, for now). While I'm debugging, I try to make a Pokemon a Shadow Pokemon, and I get the following error:
**snip**
Any ideas for my problem would be greatly appreciated!
Thanks so much for your help! I actually got the same error with the ceilNaN stuff. I noticed that the ShadowHeartValues defined in pokemon.txt had all been erased. I'm assuming the compiler did that. Check if your heart values disappeared! It worked for me once I added them back in.
Developing Pokémon XD: Rebirth, a spiritual successor to Pokémon XD and Colosseum

sonicfan7895

Just a dude, I guess

Age 22
Male
Akala Island, Alola
Seen 13 Hours Ago
Posted January 1st, 2020
106 posts
9.2 Years
Thanks so much for your help! I actually got the same error with the ceilNaN stuff. I noticed that the ShadowHeartValues defined in pokemon.txt had all been erased. I'm assuming the compiler did that. Check if your heart values disappeared! It worked for me once I added them back in.
Well, in the only entry I have for this value, Mewtwo, it hadn't been deleted by the compiler. Since I'm using v17.2 as a baseline, I went through the Editor through Mewtwo's entry, and found that ShadowHeartSize isn't a value that appears in the Editor. Is it supposed to be there? And is the compiler supposed to change every Pokemon so they all have this value?

And no problem. With Shadow Moves, it was easily explained on the original website for Essentials, before it got removed... But it's very useful if you want Pokemon with custom moves after they get purified.

Also, I noticed this within PokeBattle_Battle:

      if thispoke.respond_to?("isShadow?") && thispoke.isShadow?
        thispoke.exp+=exp
      else
Perhaps this could lead some clue into gaining experience after snagging a Shadow Pokemon?
Check out my band: Sliver!
On Facebook
Advertiser Content