• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll 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.

Trainer properties (items etc.)

Arma

The Hyena
  • 1,688
    Posts
    15
    Years
    Currently, the maximum amount of items a trainer can carry is 4, adding another one in the pbs file creates an error. Why is this limit set on 4, and is there a simple way of increasing this amount?

    I was wondering which script(s) which script I should be looking at, as there are more things I'd like to edit (NPC trainers also having Pokemon with nicknames, their Pokemon not starting out with full HP, etc.)

    Note, I have some programming experience in C#, but I don't know much about ruby. So, I'm not completely clueless, but some pointers on were to start would help. (the lack of comments in essentials isn't really helping me out XD)
     
    It's an arbitrary limit, based on the probability that 4 items is a large amount for one trainer (I heard somewhere that no trainer in the official games has more than 2 items). It used to be an important limit due to an old way trainer data was saved, but nowadays it serves no purpose. I've removed it in v11.

    In the script section Compiler, go to line 1400 (a raise which complains about too many items), and delete it. That's all. Now trainers can have a hundred items each.

    Trainer Pokémon can already be given nicknames. As for modifying their starting HP/PP/whatever, you may want to do that for each trainer in turn in the def pbLoadTrainer (assuming you don't want to do that for every trainer, which would be tedious and, frankly, a bit OCD).
     
    Last edited:
    Thank you! I should've looked at the tutorial for the nicknames, instead of the old notes.html file XD.

    EDIT:
    This error keeps popping up:
    Spoiler:

    I placed this if below the one checking for shadow Pokemon (line 54):
    Code:
          if poke[16] > 0 && poke[16] < 100 #### percentage of pokemon's max health
            Pokebattle_Pokemon(poke[1]).hp = Pokebattle_Pokemon(poke[1]).maxHP * poke[16] / 100
          end
          poke.calcStats
     
    Last edited:
    When you added code to pbCompileTrainers to allow for a 16th value, did you add a line saying poke[16]=poke[16].to_i? You need to turn it into an integer.

    Also, the code you mentioned is wrong. Use this:

    Code:
    if poke[16] > 0 && poke[16] <= 100
      pokemon.hp = (pokemon.totalhp * poke[16] / 100).floor
    end
    At least you put it in the right place.
     
    Back
    Top