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

Triple Triad Booster packs

60
Posts
13
Years
    • Seen Jun 2, 2023
    I like to implement Triple Triad in my game, but I'd rather have the player buy Booster Packs each containing a random card instead of buying each card individually. How do I do that and if possible, can I implement a level system so that, for example, a level 3 booster pack contains cards from level three or lower.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Yep, that's possible.

    Create a new item called TT Booster Pack (or something). It'll be an item you can use out of battle (like Repel), and its effect will be to give the player a random card. The item will be consumed in the process, like Repel. You can have multiple such items, each one containing a different set of cards.

    A Triple Triad card is nothing more than a Pokémon species. Card number 25 is a Pikachu, for instance. To generate a list of possible cards that a booster pack can provide, use something like this:

    Code:
    array=[]
    for i in 1..PBSpecies.maxValue
      cname=getConstantName(PBSpecies,i) rescue nil
      next if !cname   # Skip if the species doesn't exist
      triad=TriadCard.new(i)
      level=[triad.north,triad.south,triad.east,triad.west].max
      next if level>3   # Skip if the card doesn't match the criteria
      array.push(i)   # Add card to array
    end
    The above code makes a list of all cards of level 3 or lower. Of course, your criteria can be different depending on the booster pack, such as different level limits, elemental types, habitats, or be a predefined list of contents (e.g. legendaries pack). You could get quite interesting with this.

    Just pick a random entry in the array and give it to the player. Simple.
     
    60
    Posts
    13
    Years
    • Seen Jun 2, 2023
    Thanks, but there's one problem: I have like zero knowledge about scripting. how do I use that code, how do I give the player those random cards?
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    You're welcome to learn how to script if you want to script. I've already told you (twice) exactly what you can copy, and given you the majority of the code you'll need.
     
    Back
    Top