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

[Scripting Question] Gym Choices

  • 1
    Posts
    2
    Years
    • Seen Apr 17, 2024
    I was wondering if there was a way to have gym badges that the player could choose.
    An example being you could pick to fight the water, fire, or grass gyms instead of just one.
    Then have the corresponding badge show up in the trainer card.
    This would make each playthrough slightly different from the previous.
    Here is another example:
     

    Attachments

    • [PokeCommunity.com] Gym Choices
      card_2.png
      27.8 KB · Views: 17
    • [PokeCommunity.com] Gym Choices
      card_1.png
      28.1 KB · Views: 10
    There is a way and it involves using as many game variables as the number of gyms that would vary in type. In the file icon_badges, have each variant badge on the same column, but on separate rows (assuming you're using one region). In UI_TrainerCard find the following code…
    Code:
        region = pbGetCurrentRegion(0) # Get the current region
        imagePositions = []
        8.times do |i|
          if $player.badges[i + (region * 8)]
            imagePositions.push(["Graphics/Pictures/Trainer Card/icon_badges", x, 310, i * 32, region * 32, 32, 32])
          end
          x += 48
        end
    …and make the following changes where red represents the changed code:
    Code:
        [COLOR="Red"]regionBadges = [$game_variables[v1], $game_variables[v2], $game_variables[v3], $game_variables[v4], $game_variables[v5], $game_variables[v6], $game_variables[v7], $game_variables[v8]] # Use a previously blank game variable for each gym that varies its badge, its value set by an NPC player choice event; otherwise use 0 for the element value[/COLOR]
        imagePositions = []
        8.times do |i|
          if $player.badges[i + ([COLOR="Red"]regionBadges[i][/COLOR] * 8)]
            imagePositions.push(["Graphics/Pictures/Trainer Card/icon_badges", x, 310, i * 32, [COLOR="Red"]regionBadges[i][/COLOR] * 32, 32, 32])
          end
          x += 48
        end
    This should in theory allow you to vary up the types of some or all eight of your gyms. It doesn't have to be by player's choice either. Another idea is to vary up some of your gyms according to the time of day or day of the week.
     
    Last edited:
    Back
    Top