• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

[Question] Making Pokemon start with low HP?

  • 31
    Posts
    6
    Years
    I was thinking of having a Pokemon battle in my game where the player's Pokemon start with low HP due to a problem with their pokeballs in an important battle, and was wondering if that could even be done.

    If it can, could someone point me in the right direction as to how I would script it? I'm not very good at ruby and mostly make simple lines of code/alterations. I would be very grateful.
     
    Hi, this block in "PField_Battles" triggers at the start of each battle:
    Code:
    Events.onStartBattle += proc { |sender|
      # Record current levels of Pokémon in party, to see if they gain a level
      # during battle and may need to evolve afterwards
      $PokemonTemp.evolutionLevels = []
      for i in 0...$Trainer.party.length
        $PokemonTemp.evolutionLevels[i] = $Trainer.party[i].level
      end
    }
    Maybe add something along these lines:
    Code:
    Events.onStartBattle += proc { |sender|
      # Record current levels of Pokémon in party, to see if they gain a level
      # during battle and may need to evolve afterwards
      $PokemonTemp.evolutionLevels = []
      for i in 0...$Trainer.party.length
        $PokemonTemp.evolutionLevels[i] = $Trainer.party[i].level
        [B]$Trainer.party[i].hp - $Trainer.party[i].hp/2 if $game_switches[XXX][/B]
      end
    }
    This basically halves each of your Pokemon's current health. If you need further help be sure to ask. :)
     
    Hi, this block in "PField_Battles" triggers at the start of each battle:
    Code:
    Events.onStartBattle += proc { |sender|
      # Record current levels of Pokémon in party, to see if they gain a level
      # during battle and may need to evolve afterwards
      $PokemonTemp.evolutionLevels = []
      for i in 0...$Trainer.party.length
        $PokemonTemp.evolutionLevels[i] = $Trainer.party[i].level
      end
    }
    Maybe add something along these lines:
    Code:
    Events.onStartBattle += proc { |sender|
      # Record current levels of Pokémon in party, to see if they gain a level
      # during battle and may need to evolve afterwards
      $PokemonTemp.evolutionLevels = []
      for i in 0...$Trainer.party.length
        $PokemonTemp.evolutionLevels[i] = $Trainer.party[i].level
        [B]$Trainer.party[i].hp - $Trainer.party[i].hp/2 if $game_switches[XXX][/B]
      end
    }
    This basically halves each of your Pokemon's current health. If you need further help be sure to ask. :)

    Just to be sure I'm reading it correctly, I'm supposed to reserve a new switch and insert it where the XXX is, right? Just wanna be sure.
     
    Just to be sure I'm reading it correctly, I'm supposed to reserve a new switch and insert it where the XXX is, right? Just wanna be sure.
    Yip, that sounds right :)
     
    Yip, that sounds right :)

    I've been trying to get it to work. It runs without any errors, but when I have the switch that I have it set to ON, my Pokemon's HP will still be full at the start of the battle. I even made a new switch to make sure it wasn't a reserved switch.

    Events.onStartBattle+=proc {|sender,e|
    $PokemonTemp.evolutionLevels = []
    for i in 0...$Trainer.party.length
    $PokemonTemp.evolutionLevels = $Trainer.party.level
    $Trainer.party.hp - $Trainer.party.hp/2 if $game_switches[127]
    end
    }


    Did I do something wrong when setting a switch to it?
     
    Did I do something wrong when setting a switch to it?
    Nope, it was my mistake. I forgot to finish the calculation. A simple "=" should suffice though. :)
    Code:
    Events.onStartBattle+=proc {|sender,e|
    $PokemonTemp.evolutionLevels = []
    for i in 0...$Trainer.party.length
    $PokemonTemp.evolutionLevels[i] = $Trainer.party[i].level
    $Trainer.party[i].hp -[COLOR="Red"]=[/COLOR] $Trainer.party[i].hp/2 if $game_switches[127]
    end
    }
     
    That's like the one place I didn't try putting the = when trying to fix it before asking, omg. XD well, I'll give this a shot.
     
    It works perfectly fine now! Thank you so so much!
     
    Back
    Top