Solved Making Dead Pokemon

kmb

dabbling in game design
Member
Posts
61
#1
I saw a neat little "death" feature in a Pokemon fan game, where the entered Pokemon doesn't faint if it loses but instead "dies" and cannot be revived in a Pokemon center. The status is changed to "dead" and it remains fainted in the party even after a Pokemon center heal or being deposited into a box. I would like to know how to recreate this.

I know there are easier ways to represent a "dead" Pokemon, but I'm interested in recreating this status change.

My fan game isn't a Nuzlocke, but I think having an extra layer of challenge, such as Pokemon death via permanent status change, would have its use.
 
Last edited:

kmb

dabbling in game design
Member
Posts
61
#2
I guess maybe just seeing if I can add a status change like that in the scripts might work, but I'm not really sure...
 

MGriffin

Trainer
Member
Posts
74
#3
I guess an easy way to do this is change the Pokémon Center and Box scripts to check if hp > 0 before healing? You'll also want to remove Revives etc, and probably also tweak how Rare Candy works.
 

kmb

dabbling in game design
Member
Posts
61
#4
I guess an easy way to do this is change the Pokémon Center and Box scripts to check if hp > 0 before healing? You'll also want to remove Revives etc, and probably also tweak how Rare Candy works.
That might work, but in Pokemon Sardonyx, for example, they have a separate "death" status for the Pokemon that is different from the regular "faint" status, even though both are in the game. Fainted Pokemon, of course, can be healed at a Pokemon center, but not dead ones.
 

Lord X-Giga-X

Sardonyx's Reaper
Member
Posts
37
#5
Did someone say Pokémon Sardonyx? ;)


Oh boy, I'm just gonna straight up say that we're working mainly on v16.2. (And before anyone butts in, my co-dev and I both have fresh v17.2 which we mostly pull code from to update/add certain features. And even then, I am aware of the different sections between both versions.) There is also A LOT that you'll need to do for this. So much so that if I went into every single step of this, this post would probably take allday to put together a post for it...

So instead, let's start with some basics. Brought to you by Nickaloose, who responded to my co-dev's request for help on the matter before we even made the pre-release alpha that Ruffled Rowlit played. And I feel bad for completely forgetting to credit the person, since Sardonyx probably would not have been possible without their help.

So let's start with PokeBattle_Pokemon. Specifically under class PokeBattle_Pokemon:
Below all of the various attr_accessors, you're gonna want to add attr_accessor(:dead).

Now somewehere in that same section of script, you're gonna want to add the following:

Code:
################################################################################
# Dead or not
################################################################################
# Kill this Pokémon
  def makeDead
    @dead=true
  end
 
# Revive this Pokémon
  def makeUndead
    @dead=false
  end

# Check if dead
  def checkDead
    return @dead
  end
I suggest somewhere like under the section for shiny Pokemon to make it relatively easy to find.

And within def initialize further down, add @dead=false to initialize the flag.

Next, search up def pbFaint in PokeBattle_Battler, look for the line @pokemon.changeHappiness("faint"). Under that, add @pokemon.makeDead if $game_switches[#]. (Important note: # should be a switch number that isn't already being used).

With what we have so far, we have a means to check to see if a Pokémon is dead, the means to kill and revive them, and set up a way to kill Pokémon if a switch is on during battle.

And now, you should find def pbHealAll, located either in PSystem_Utilities or PSystem_PokemonUtilities. In this bit of code, change i.heal to i.heal if i.checkDead==false. This will keep Pokémon from being healed from events using this script, and therefore keeping them unable to be healed at Pokémon Centers.


There's a lot of other things involved in this, like making sure items don't work on dead Pokémon, making them unable to be healed in PCs, etc. But again, we'd be here all day. Plus even then, a lot of adjustments can be figured out from this point with a bit of logic. Either way, I hope this serves as a good enough starting point as it did for me.
 

kmb

dabbling in game design
Member
Posts
61
#6
Did someone say Pokémon Sardonyx? ;)


Oh boy, I'm just gonna straight up say that we're working mainly on v16.2. (And before anyone butts in, my co-dev and I both have fresh v17.2 which we mostly pull code from to update/add certain features. And even then, I am aware of the different sections between both versions.) There is also A LOT that you'll need to do for this. So much so that if I went into every single step of this, this post would probably take allday to put together a post for it...

So instead, let's start with some basics. Brought to you by Nickaloose, who responded to my co-dev's request for help on the matter before we even made the pre-release alpha that Ruffled Rowlit played. And I feel bad for completely forgetting to credit the person, since Sardonyx probably would not have been possible without their help.

So let's start with PokeBattle_Pokemon. Specifically under class PokeBattle_Pokemon:
Below all of the various attr_accessors, you're gonna want to add attr_accessor(:dead).

Now somewehere in that same section of script, you're gonna want to add the following:

Code:
################################################################################
# Dead or not
################################################################################
# Kill this Pokémon
  def makeDead
    @dead=true
  end

# Revive this Pokémon
  def makeUndead
    @dead=false
  end

# Check if dead
  def checkDead
    return @dead
  end
I suggest somewhere like under the section for shiny Pokemon to make it relatively easy to find.

And within def initialize further down, add @dead=false to initialize the flag.

Next, search up def pbFaint in PokeBattle_Battler, look for the line @pokemon.changeHappiness("faint"). Under that, add @pokemon.makeDead if $game_switches[#]. (Important note: # should be a switch number that isn't already being used).

With what we have so far, we have a means to check to see if a Pokémon is dead, the means to kill and revive them, and set up a way to kill Pokémon if a switch is on during battle.

And now, you should find def pbHealAll, located either in PSystem_Utilities or PSystem_PokemonUtilities. In this bit of code, change i.heal to i.heal if i.checkDead==false. This will keep Pokémon from being healed from events using this script, and therefore keeping them unable to be healed at Pokémon Centers.


There's a lot of other things involved in this, like making sure items don't work on dead Pokémon, making them unable to be healed in PCs, etc. But again, we'd be here all day. Plus even then, a lot of adjustments can be figured out from this point with a bit of logic. Either way, I hope this serves as a good enough starting point as it did for me.
Thank you so much! That was what I was looking for...

Who should I credit if I add this script? Nickaloose or someone else?
 
Last edited:
Top