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

Script: Rescue Chain [v17.2]

1,682
Posts
8
Years
    • Seen today
    So, funny thing, I misread a reddit comment describing SOS battles, and came up with this.

    As for what this is, it's a script that evolves wild Pok?mon if you keep beating up the same evolutionary family.
    So, let's say you beat or catch up a bunch of Pidgeys. After a while, Pidgeottos will appear sometimes to fight you. If you keep fighting all of them, Pidgeots will have a small chance to appear as well. If you fight a Rattata in the middle though, the Pidgeottos and Pidgeots will disappear until next time.

    These evolved forms will match their requirements, so a Pok?mon that evolves through level will be that level plus a bit, meanwhile Pokemon that evolve through items, will just add a bit to the level of the pre-evolved form.

    Mind you this script applies to the whole family, so the chain will not break if you fight a Ratticate with Rattatas, and it ignores Trainer battles, Roamers, and the Poke Radar.

    The script is here, and just put it above Main.
     
    Last edited:
    465
    Posts
    7
    Years
    • Seen Apr 26, 2024
    This sounds like a really cool idea!
    Since its kind of a mistranslation of SOS chaining (As in misreading) would their be a way to make a shiny chaining method for this? as in the more you chain/beat up, the higher chance you get of a shiny?

    I've been doing alot of pokeradar stuff so yea, trying to get shiny hunting methods sorted or just cool methods.

    One question, since its for chaining, its not that reliable as you just got to get lucky if you'll repeatably get the same family, would there be anyway, like the pokegear does, after like 2 or 3 chains it locks the line in, and like the pokeradar and even how the chaining works here, stops when you run?

    Sorry if you're not sure how to do that, just felt it'd be cool to configure it like that, into an efficient either grinding chain or shiny hunting chain method.
     

    Byliyth

    A Giant Mess
    13
    Posts
    5
    Years
    • Seen Jul 4, 2020
    Tried the script and keep getting this message:
    unknown.png
     
    1,682
    Posts
    8
    Years
    • Seen today
    Tried the script and keep getting this message:
    unknown.png

    Sorry about that, I made a typo in the script when I put it in Pastebin. it should be onStartBattle, with a lower case o. the paste has been corrected.

    Again apologies.
     
    465
    Posts
    7
    Years
    • Seen Apr 26, 2024
    So trying to use this, but on encountering a pokemon, this hapens

    xftXism.png


    Happens whenever i encounter something so :/
     
    1,682
    Posts
    8
    Years
    • Seen today
    So trying to use this, but on encountering a pokemon, this hapens

    xftXism.png


    Happens whenever i encounter something so :/

    You at using v17+, right? That's the only version with the fSpecies method on the Pokemon object, because of the new way forms are defined (basically a new species)

    It will not work in any version below that, and I don't have a copy of v16 to change that fact any time soon.
     
    465
    Posts
    7
    Years
    • Seen Apr 26, 2024
    Okay thats my fault then!

    I'll try and work a work around out for it ^^; thanks for letting me know tho
     
    465
    Posts
    7
    Years
    • Seen Apr 26, 2024
    it?s possible to incrase shiny chance with this? or even make final evo pokemon 6iv?s?

    Would be cool to do/first one could be done through the usual shiny code/pokeradar code, and the second could be worked out aswell.

    However, its not 100% reliable as you rely on spawn chances so can only do it for the super common pokemon.
     
    1,682
    Posts
    8
    Years
    • Seen today
    Okay thats my fault then!

    I'll try and work a work around out for it ^^; thanks for letting me know tho

    I'll give you a bit of a start then. you'll need to remove all instances of fSpecies and change it to just species, and just flat out remove the species from fSpecies method.

    it?s possible to incrase shiny chance with this? or even make final evo pokemon 6iv?s?

    I suppose it could do those things, if we add another Events proc for the shiny.
    Code:
    Events.onWildPokemonCreate+=proc{|sender,e|
       next if !$PokemonTemp.rescuechain
       pokemon =e[0]
       family=pbGetBabySpecies(pokemon.fSpecies)
       next if family != $PokemonTemp.rescuechain[1]
       shinyretries=($PokemonTemp.rescuechain[0]/EVOCHAINLENGTH).floor() # for every multiple of chain, try for shiny
       for i in 0...shinyretries
          break if pokemon.isShiny?
          pokemon.personalID=rand(65536)|(rand(65536)<<16)
        end
    }

    for perfect IVs we must edit the on start battle.
    Code:
              pokemon.name=PBSpecies.getName(newspecies)
             pokemon.calcStats
             pokemon.resetMoves
    [COLOR="Red"]       elsif evodata.length==0 # no more evolutions
             for i in 0...6
               pokemon.iv[i]=31
             end
             pokemon.calcStats[/COLOR]
           end

    there may be errors because I typed this on my phone.
     
    72
    Posts
    4
    Years
  • To update this to V18 (.1) change
    Code:
    Events.onStartBattle+=proc
    To this
    Code:
    Events.onWildPokemonCreate+=proc

    It should work with fSpecies after that since e[0] is a bool in start battle and is a pkmn in wildpkmncreate

    For using with overworld encounters

    EDIT: actually make the whole script this

    Code:
    ===============================================================================
    # Rescue Chain - By Vendily [v17]
    #This edited version was edited by lemiho19
    # This script makes it so that if you chain pokemon of the same evolutionary
    #  family together, an evolved form of the species will appear.
    # I used no references and I completly misinterpreted a description of SOS
    #  battles as this thing.
    # * Minimum length of chain before evolved forms begin to appear. With every
    #    multiple, the chance for the evolved form or a second evolved form to appear
    #    increases. (Default 10)
    # * Chance that the evolved form will even show up, 1 out of this constant.
    #    (Default 4, for 1/4 chance, it's probably too high)
    # * Random number added to the minimum level this pokemon can evolve at or
    #    the wild pokemon's current level if it evolves through item (Default 5)
    # * Disable this modifier while the pokeradar is being used.
    #    I recommend leaving it as is as the pokeradar may behave strangely and the
    #    two scripts may reset each others' chain. (Default true)
    # * The maps where this effect can only take place in.
    # * The maps where this effect will never happen. Ever.
    # * The switch to disable this effect. (Default -1)
    #===============================================================================
    EVOCHAINLENGTH      = 4
    EVORANDCHANCE       = 3
    EVOLEVELWOBBLE      = 10
    EVOPKRADERDISABLE   = true
    EVOMAPSWHITELIST    = []
    EVOMAPSBLACKLIST    = []
    EVODISABLESWITCH    = -1
    family = 0
    species = 0
    class PokemonTemp
      attr_accessor :rescuechain # [chain length, evo family]
    end
     
    Events.onStartBattle+=proc{|sender,e|
    next if species.nil? 
    family=pbGetBabySpecies(species)
    
       if family != $PokemonTemp.rescuechain[1]
          #p "DEBUG: Item ID: #{family}"
         $PokemonTemp.rescuechain=[0,family]
       end 
       }
    
    
    Events.onWildPokemonCreate+=proc{|sender,e|
       next if EVOMAPSBLACKLIST.include?($game_map.map_id)
       next if EVOMAPSWHITELIST.length>0 && !EVOMAPSWHITELIST.include?($game_map.map_id)
       next if EVODISABLESWITCH>0 && $game_switches[EVODISABLESWITCH]
       next if EVOPKRADERDISABLE && !$PokemonTemp.pokeradar.nil?
       next if !$PokemonGlobal.roamEncounter.nil?
       pokemon=e[0]
       next if pokemon.nil?
       if !$PokemonTemp.rescuechain
         $PokemonTemp.rescuechain=[0,nil]
       end
           family=pbGetBabySpecies(pokemon.fSpecies)
    
       next if family != $PokemonTemp.rescuechain[1]
       if $PokemonTemp.rescuechain[0]>=EVOCHAINLENGTH
         for i in 0..($PokemonTemp.rescuechain[0]/EVOCHAINLENGTH).floor()
           evodata=pbGetEvolvedFormData(pokemon.fSpecies)
           if evodata.length>0 && rand(EVORANDCHANCE)==0
             fspecies=evodata[rand(evodata.length)][2]
             newspecies,newform=pbGetSpeciesFromFSpecies(fspecies)
             level=pbGetMinimumLevel(fspecies)
             level=[level,pokemon.level].max
             level+=rand(EVOLEVELWOBBLE)
             pokemon.species=newspecies
             pokemon.form=newform
             pokemon.level=level
             pokemon.name=PBSpecies.getName(newspecies)
             pokemon.calcStats
             pokemon.resetMoves
           end
         end
       end
    }
     
    Events.onWildBattleEnd+=proc {|sender,e|
       next if EVOMAPSBLACKLIST.include?($game_map.map_id)
       next if EVOMAPSWHITELIST.length>0 && !EVOMAPSWHITELIST.include?($game_map.map_id)
       next if EVODISABLESWITCH>0 && $game_switches[EVODISABLESWITCH]
       next if EVOPKRADERDISABLE && !$PokemonTemp.pokeradar.nil?
       next if !$PokemonTemp.rescuechain
       species=e[0]
       result=e[2]
       family=pbGetBabySpecies(species)
     
       if (result == 1 || result == 4) && family==$PokemonTemp.rescuechain[1]
        $PokemonTemp.rescuechain[0]+=1
      
       # $game_variables[200] = $PokemonTemp.rescuechain[0]#####################
       # $game_variables[199] = $PokemonTemp.rescuechain[1]#####################
       end
    }

    this will now work in V18.1 inside the overworld encounters script (should also work normal but yea)
     
    Last edited:
    Back
    Top