• 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.

Pokémon Dying

119
Posts
10
Years
  • Seen Sep 1, 2023
These script changes count Pokémon who have fainted as dead, and store them in a graveyard storage (after battle, or when dying from poison while walking around). This graveyard storage can be accessed from the PC and allows players to view their dead Pokémon (only summary, item, and markings are available). This can be great for a nuzlock challenge or maybe even standard in your game.

Implementing this script requires you to address a few problems caused by Pokémon dying in the players party (game design related);
The first problem is what happens when the player has no more Pokémon left in their party. The script below makes the player go game over. I emphasized the game over part of the code so you can remove it if this is not what you want. In case you remove that part the player will always end up in the last PokéCenter they visited, thus you can prevent them from leaving it without any Pokémon in their party and implement your solution there. Do note that the game crashes if the player enters a battle without any Pokémon in their party.
The second problem is what happens if the player gets stuck because the only Pokémon knowing a HM in their party died (i.e. when on a small island and the Pokémon which knew surf died). There are a few possible solutions to this problem;
1: Design the levels (maps) in such a way that this cannot happen. It's the most elegant solution, yet also the hardest to implement).
2: Use items for HMs instead of Pokémon. I know there's been quite some talk about it and I believe the code exists on this forum, yet this just might not be what you want for your game.
3: Give the player the ability to return to the last PokéCentre they visited (as if using teleport). The player would be able to use this anywhere and anytime, for the cost of 50% of their money. This is the easiest and most fail safe solution.


Pokémon 'dying'
Spoiler:

A graveyard storage
Spoiler:

NOTE: Copying code from the PokéCommunity forum might still be broken, to solve this use 'Threat Tools' and click on 'Show printable version'

PS. Credit would be appreciated
 
Last edited:

ShadowFiendZX

Gym Leader
59
Posts
11
Years
While this is a nice feature, and something my friends and I have always joked about adding to our game, what happens if you've got no pokemon whatsoever even in regular storage? How would you get pokemon, especially before given access to the safari zone or something similar?
 
1,224
Posts
10
Years
A big problem I see is in games that use HMs. You surf to an island, that pokemon dies, you're stuck. Game over. You're in the middle of surfing and that pokemon dies, possible errors. etc.
 
119
Posts
10
Years
  • Seen Sep 1, 2023
Those are good points which, to be honest, I hadn't thought about yet. I quickly made the code for someone and thought more people might be interested in it. After running some tests the code doesn't cause errors by removing the only Pokémon which knows surf, or by removing the last Pokémon from the players party. It does indirectly cause 2 problems;

Starting a battle without any Pokémon in the party causes the game to crash. Do note that the code causes the player to always return to the Pokémon center when this happens (blacking out). This gives two ways to solve the problem; 1, the player goes game over when all pokemon in their party are dead; 2, the player isn't allowed to leave the pokemon center with an empty party and goes game over when the player doesn't have any pokemon in either their party or their storage. (I updated the first post to include the first solution).

the second problem is slightly more complex; if the player loses a Pokémon which knows a HM they can get stuck (i.e. the player surfs to an island). There are a few possible solutions to this problem;
1: Design the levels (maps) in such a way that this cannot happen. It's the most elegant solution, yet also the hardest to implement).
2: Use items for HMs instead of Pokémon. I know there's been quite some talk about it and I believe the code exists on this forum, yet this just might not be what you want for your game.
3: Give the player the ability to return to the last PokéCentre they visited (as if using teleport). The player would be able to use this anywhere and anytime, for the cost of 50% of their money. This is the easiest and most fail safe solution.

Note: I've updated the OP to include this information.
 
133
Posts
9
Years
  • Age 26
  • Seen Nov 17, 2018
I really wouldn't be discouraged by those obstacles. Most fangames like ZetaOmicron, who's popularity is on par with Reborn and Raptor, have Nuzlockes as optional anyway. So it's really a quick and easy switch on/off. There's also the unconventional method of doing what the creator of SPEE did, before Gold had gained Eevee, by making the player a "Pokemon", except the only options available were to run away. In the situations you listed, it's an easy fix for going this route.
 
119
Posts
10
Years
  • Seen Sep 1, 2023
In case you're referring to JV's nuzlock mode script, I believe that one already has some functionality in it for dying Pokémon. Though I don't exactly know how that one works. If not, then please tell me which one you're referring to.
 
1,224
Posts
10
Years
In case you're referring to JV's nuzlock mode script, I believe that one already has some functionality in it for dying Pokémon. Though I don't exactly know how that one works. If not, then please tell me which one you're referring to.

That one just prevents healing scripts from healing fainted pokemon is all. It doesn't remove them from your party or anything.
 

Tricko

Developing Pokémon Dark Leaf
45
Posts
12
Years
A big problem I see is in games that use HMs. You surf to an island, that pokemon dies, you're stuck. Game over. You're in the middle of surfing and that pokemon dies, possible errors. etc.

Mej, Is absolutely right...
 
129
Posts
14
Years
  • Age 24
  • Seen Sep 4, 2023
Very nice! Thank you very much for the script.

Well, I have a small correction, just a subltety (however, it is important):
When you say:
There should be a "if selected[0]==-1" a few lines later, change that one (and only that one) to "if selected[0]==-1 && !@graveyard"
Actually, if you simple do this, the code will look like:
if selected[0]==-1&& !@graveyard
commands[2]=_INTL("Store")
[S-HIGHLIGHT]else
commands[2]=_INTL("Withdraw")[/S-HIGHLIGHT]
end
I highlight the yellow part, because it means that it will not only write "withdraw" when the left side of the "if" is not satisfied, but also when !@graveyard is not satisfied. In order words, it will write Withdraw inside of the graveyard box.
I believe it should be:
if selected[0]==-1 && !@graveyard
commands[2]=_INTL("Store")
elsif selected[0]==-1 && @graveyard
commands[2]=_INTL("Mark")
elsif selected[0]!=-1 && !@graveyard
commands[2]=_INTL("Withdraw")
end
Again, thank you for the script! I was really looking for something on these lines!

As a side question, I was wondering if it would be possible to still give a use to the item Revive. Maybe turning it into a very rare item, that would really Revive the pokemon, and not "unfaint" it, as usual. Do you think it is possible?


Other than that, I get an error when picking a pokémon in the box, using "Move".
Spoiler:


Cheers!
 
Last edited:
67
Posts
12
Years
I quite like the idea to have a pokemon dying in an way overpowered battle. (alright, that sounded grim) but having it die everytime it faints goes quite far and makes it very difficult to have any pokemon on your team for the entire game. So how about a conditional variable in the script? Let say that the pokemon only dies when the landing attack does twice the amount of damage as the pokemon's full hp. So say if you have a level 30 Quilava (total hp 120) facing a, say, level 80 Kyogre using waterspout at full hp and ability drizzle; the damage dealt to Quilava would be like off the chart! (Way more then 240 hp points, that's a for sure) It stands to reason that it won't survive such an attack and dies. But, if you have that same Quilava facing off against a level 35 Geodude which just tossed some rocks at it and gradiently weakens it down till Quilava has no hp left, Quilava faints and can be recovered using either a Revive or PokeCenter. So the dev will look at the total hp of the battler, doubles this into a set variable, then looks at every individual move and its damage dealt during the battle and checks if this is more or less then the amount in the variable and treats it as a conditional branch. Is it more; it dies, is it less; it faints.
 
119
Posts
10
Years
  • Seen Sep 1, 2023
Updated the script in the first post to fix the withdraw/mark text error. I've pm'd you about the crash to see if we can find a solution (I'll post it here if it affects the script or if more people encounter the same problem).

With regards to the revive item, if I'm not mistaken it should still be possible to revive fainted Pokémon during battle. If you'd like to use it outside of battle you'd need a way to select a single Pokémon from the Graveyard Storage.

@Yero; Actually this script is the dying functionality from a more elaborate script I've made where Pokémon receive wounds over multiple battle and die as a result thereof (which I'm using in the game I'm working on, of course players also have a way to heal these wounds).
With regards to your idea: you'de have to edit 'pbReduceHPDamage' in PokeBattle_Move, that function deals damage to the Pokémon (and currently caps the damage to the amount of hp the Pokémon has left). From there it's probably the easiest to add an extra variable to the battler/pokemon where the excessive amount of damage is stored, and a check in the faint function whether this excessive amount of damage would kill the Pokémon (or the check in the damage function with a variable which stores if the Pokémon dies).

ps. @Yero, tip: adding line breaks to your post makes it a lot more readable ;)
 
32
Posts
6
Years
  • Age 32
  • Seen Sep 9, 2019
I find this script really cool, tho I when I tried to injected i had trouble finding some of the scripts i needed to change .. im literally new to this whole deal, but could it be because the newer versions of PE have changed their script files in some way?
or am i just blind -
 

Pokeminer20

PDM20, Coder of Chaos!
412
Posts
9
Years
Just got this script to give some difficulty to my game, and the SECOND I take a step, I get auto game over.

EDIT: I'm also getting this error
---------------------------
Pokemon Angelic Bond
---------------------------
[EOFError, "End of file reached", ["Section050:1743:in `oldload'", "Section050:1743:in `load'", "Section145:536:in `pbStartLoadScreen'", "Section145:517:in `open'", "Section145:517:in `pbStartLoadScreen'", "Section145:491:in `loop'", "Section145:859:in `pbStartLoadScreen'", "Section189:30:in `main'", "Section189:74:in `mainFunctionDebug'", "Section189:52:in `mainFunction'", "Section189:52:in `pbCriticalCode'", "Section189:52:in `mainFunction'", "Section189:84", "Section189:83:in `loop'", "Section189:92"]]
---------------------------
OK
---------------------------
originally thinking it was an old save file error but that wasn't the case after starting a new save file.
 
Last edited:
Back
Top