• 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!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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
    14
    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.
     
    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.
     
    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?
     
    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.
     
    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.
    I copied and pasted this into v21.1 and I think I'm close to getting it to work. I posted it under the sample pack indexes. I'm getting an error that says
    "Section330;1377' line in '<module: NameError occured.

    Uninitialized constant BoosterPack::PBSpecies"

    Would this be because i have yet to create the corresponding pack in the txt files? Or is it because I copy and pasted it in the wrong place? I know I'm missing something. I'm just not experienced enough to figure out exactly what yet. Thanks for any insight you can provide.
     
    I copied and pasted this into v21.1 and I think I'm close to getting it to work. I posted it under the sample pack indexes. I'm getting an error that says
    "Section330;1377' line in '<module: NameError occured.

    Uninitialized constant BoosterPack::PBSpecies"

    Would this be because i have yet to create the corresponding pack in the txt files? Or is it because I copy and pasted it in the wrong place? I know I'm missing something. I'm just not experienced enough to figure out exactly what yet. Thanks for any insight you can provide.
    this script won't work because this was made for a very old version of essentials (like, is very obvious, this script is 11 years old. duh), and many things have changed since then
     
    this script won't work because this was made for a very old version of essentials (like, is very obvious, this script is 11 years old. duh), and many things have changed since then
    Yea I know it's old but this is all I could find on the topic so I gave it a try. Wasn't even really sure I would get a reply here tbh.
     
    Swinging back to this to tell how I accomplished something kind of like this on 21.1 just in case anyone else comes looking. Honestly it ate up a good bit of time and was kind of tedious, but I took every card\Pokémon I have in my Dex (275 or so) and added all the stats of each card. I took their totals and split them up that way. Anyone with 10 or less total stats got stuck in the starter pack. Anything with 11-15 went in Expansion One and so one up to 30+. I only wanted cards from my Dex used in game so I have no idea how this would be done for every available Pokémon without some help. I still have the list of Pokémon, and their stat totals saved of the ones I did. Mostly gen 1 and 2. Few evolutions from later gens because the evolve from gen 1 or 2 dudes. I did it this way because I wasn't sure how the game determined card level and assumed this was close enough.
     

    Attachments

    • triad stat totals.txt
      6.6 KB · Views: 0
    Back
    Top