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

[Scripting Question] How can I implement Nuzlocke-like permadeath on only certain battles?

Kudamon

It is finished when seven become one.
6
Posts
13
Years
  • wow it's been a while since I posted here

    A friend and I are starting work on a fangame and one of the defining aspects of the plot are that some- but not nearly all- trainers will let their Pokemon kill yours. Typically you would only send out one Pokemon each for these battles, and if your Pokemon faints it is of course dead.

    But this wouldn't be every battle- it wouldn't even be half of them, it's only very specific trainers and battles. A quick google search turned up several results for implementing a Nuzlocke mode, but said nothing about only applying it to certain battles.

    To clarify, most battles in this game would be completely normal. You have up to six Pokemon at your disposal and you can heal them as much as you like. But these battles against certain NPCs and occasionally wild Pokemon would only let you send out one Pokemon and if it faints, you can't revive it through any means.

    I'm still fairly new to Pokemon Essentials. Any help would be appreciated. :) Thank you!
     
    Last edited by a moderator:
    28
    Posts
    7
    Years
  • The first thing you want to do is to download the Nuzlocke script by ~JV~ right here:
    https://www.pokecommunity.com/showthread.php?t=342989

    Don't mess with it until the battle you want to trigger nuzlocke mode.
    Along with the Comment commands that start that battle, insert this script:
    Spoiler:

    That will activate Nuzlocke mode. You can keep it on the whole battle, but when the battle ends add this script:
    Spoiler:

    That will turn the Nuzlocke script off, returning your game to normal.
    Hope this helps!
     
    824
    Posts
    8
    Years
  • That will not entirely work. After all, he wants the dead Pokemon to remain dead even outside of Nuzlocke mode.

    Which means what he needs is some sort of way, while the Pokemon is fainting, to add a flag to say "this Pokemon isn't just fainted, it's dead". So that Pokecenters and the PC can't revive it.
     

    Kudamon

    It is finished when seven become one.
    6
    Posts
    13
    Years
  • That's the idea, yeah. I figured it would be something like what Rot8er_ConeX is describing, but I just haven't seen anything like that looking through Google and thus don't know how to implement something like this.

    It's not an immediate concern as we're focusing on an alpha that ends before the player encounters one of these battles, but it's something we will definitely need after that.
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    Try this.

    Search for this line: @pokemon.changeHappiness("faint")
    And below it, add: @pokemon.makeDead if $game_switches[1]
    Changing the switch number to one that isn't being used already.

    Search for this line: attr_accessor(:ribbons) # Array of ribbons
    And below it, add: attr_accessor(:dead) # Dead

    Search for this: def makeNotShiny
    And below the def, add:
    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

    Search for this line: @moves=[]
    And above it, add: @dead=false

    Search for this: def pbHealAll
    And change it to this def to:
    Code:
    def pbHealAll
      return if !$Trainer
      for i in $Trainer.party
        i.heal if i.checkDead==false
      end
    end

    I think that should work. I haven't tested it. But make sure the switch is turned on before a battle you need this script to work in and turn it off after the battle has finished.

    Maybe you can work out how to stop Revives, Potions and other healing objects from working on the Pokémon.

    Like it if helps you.
     
    Last edited:
    28
    Posts
    7
    Years
  • That will not entirely work. After all, he wants the dead Pokemon to remain dead even outside of Nuzlocke mode.

    Which means what he needs is some sort of way, while the Pokemon is fainting, to add a flag to say "this Pokemon isn't just fainted, it's dead". So that Pokecenters and the PC can't revive it.

    Oh, sorry. I thought you meant to just not be able to revive that Pokemon if it dies while in a battle >.<
    But what Nickalooose said will most likely work well with what you're trying to do :)
     
    Back
    Top