• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Cyndy, May, Hero (Conquest), or Wes - 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.

[Scripting Question] Viewing Triple Triad Cards

  • 217
    Posts
    15
    Years
    • Seen Nov 29, 2021
    So I tried to butcher a script into allowing you to view your Triple Triad cards from a key item in your bag. Unfortunately it keeps throwing an error, and I've no idea why (or even if this'll work).
    Code:
    def pbViewTriadCard(cardStorage=@triadCards)
      commands=[]
        for item in cardStorage
          commands.push(_INTL("{1} x{2}",PBSpecies.getName(item[0]),item[1]))
        end
        command=Window_CommandPokemonEx.newWithSize(commands,0,0,256,Graphics.height-64,@viewport)
     #   @sprites["helpwindow"].text=_INTL("Choose {1} cards to use for this duel.",@battle.maxCards)
        preview=Sprite.new(@viewport)
        preview.z=4
        preview.x=276
        preview.y=60
        index=-1
        for i in [email protected]
          @sprites["player#{i}"]=Sprite.new(@viewport)
          @sprites["player#{i}"].z=2
          @sprites["player#{i}"].x=Graphics.width-96
          @sprites["player#{i}"].y=34+48*i
        end
        loop do
          Graphics.update
          Input.update
          pbUpdate
          command.update
          if command.index!=index
            preview.bitmap.dispose if preview.bitmap
            if command.index<cardStorage.length
              item=cardStorage[command.index]
              preview.bitmap=TriadCard.new(item[0]).createBitmap(1)
            end
            index=command.index
          end
          if Input.trigger?(Input::B)
          end
        end
        command.dispose
        preview.bitmap.dispose if preview.bitmap
        preview.dispose
    end
     
    Where exactly do you put this script?
    I've never seen methods that use variables as a default value. Usually they set them to nil, then set it to the variable if it is nil.
    Also, @triadcards is a global variable that only exists in class TriadScreen.

    Personally, I would use $PokemonGlobal.triads, which returns a TriadStorage object, then you can use the class TriadStorage methods.
    But I'm just looking over the methods, I don't have the time to play around with what I'm saying.
     
    I have it in PMiniGame_TripleTriad.
    Will try $PokemonGlobal.triads.

    EDIT: Nope, that didn't help (or it did and there's still problems), sorry
     
    After scratching my head for 3 hours, I just realized that pbTriadList does something similar to what you are doing.
    [PokeCommunity.com] Viewing Triple Triad Cards

    You can call it from anywhere. (I hijacked a repel)
    [PokeCommunity.com] Viewing Triple Triad Cards

    It would possibly be an easier starting point for whatever you want this to look like.
     
    Oh, nice find!
    I'll check it out in the morn, thanks!

    EDIT: That works great!
    Might mess around with it for a bit, try to get it to list by tier, then by name.
     
    Last edited:
    Back
    Top