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

Creating a Contest Pass (secondary Trainer Card)

67
Posts
12
Years
  • Line 192 is where I put a replica of the badges but then with trophies instead.

    The whole def from line 164 to 197:
    Code:
      def initialize(name,trainertype)
        @name=name
        @language=pbGetLanguage()
        @trainertype=trainertype
        @id=rand(256)
        @id|=rand(256)<<8
        @id|=rand(256)<<16
        @id|=rand(256)<<24
        @seen=[]
        @owned=[]
        @shadowcaught=[]
        @formseen=[]
        @formlastseen=[]
        @badges=[]
        @trophies=[8]
        @pokedex=false
        @pokegear=false
        for i in 1..PBSpecies.maxValue
          @seen[i]=false
          @owned[i]=false
          @shadowcaught[i]=false
          @formlastseen[i]=[]
          @formseen[i]=[[],[]]
        end
        for i in 0...8
          @badges[i]=false
        end
        for i in 0...8
          [B]@tropies[i]=false[/B]
        end
        @money=INITIALMONEY
        @party=[]
      end
    end

    So this part has an direct influence on restarting the game. As of course, renewing a game also resets the number of badges back to zero, or as in this case, the number of trophies.

    Even while I have duplicated all badge components and renamed those with trophies, there still is an error in the script. But I wonder where?
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen yesterday
    Spelling mistake, mate. "tropies" isn't the same as "trophies".

    While you're there, you can remove the 8 from @trophies=[8]. It's not causing any harm, but there's no reason to have a number there.
     
    67
    Posts
    12
    Years
  • NO WAY!!
    For Bloody Damn Sake how could I have overseen a spelling mistake like that!
    Thanks heaps for mentioning it, though... Damn that is of a loser-grade less than a Wobbuffet!

    So I restarted a game, the $Trainer.trophies variable seems to return no problems.
    However, now I can't open the card (>_<)
    I keep getting this undefined local variable error in ItemEffects script
    ezimba19963487160600.png

    I have checked it over and over and over and over (and that like a hundred times)
    to prevail another one of these stupid overseen mistakes, but I can't figure it out. I have replicated all Townmap files (as being the most similar item in ItemEffects) and got it like this:
    from line 118 to 131
    Code:
    ItemHandlers::UseFromBag.add(:TOWNMAP,proc{|item|
       pbShowMap(-1,false)
       next 1 # Continue
    })
    
    ItemHandlers::UseFromBag.add(:CONTESTPASS,proc{|item|
       pbContestPass
       next 1 # Continue
    })
    
    ItemHandlers::UseFromBag.add(:COINCASE,proc{|item|
       Kernel.pbMessage(_INTL("Coins: {1}",$PokemonGlobal.coins))
       next 1 # Continue
    })

    Followed up by
    lines 965 to 976
    Code:
    ItemHandlers::UseInField.add(:TOWNMAP,proc{|item|
       pbShowMap(-1,false)
    })
    
    ItemHandlers::UseInField.add(:CONTESTPASS,proc{|item|
       pbContestPass
    })
    
    ItemHandlers::UseInField.add(:COINCASE,proc{|item|
       Kernel.pbMessage(_INTL("Coins: {1}",$PokemonGlobal.coins))
       next 1 # Continue
    })

    Can someone shed some light on this??
     
    Last edited:

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen yesterday
    Have you made a def called pbContestPass? Where have you put it?
     
    67
    Posts
    12
    Years
  • finally, I got it working! Was more complex than I thought :-S I placed a small def in PokemonUtilities where appeared to be the problem. In the end, I placed the card as an item of course in ItemEffects and the PBS file, I made a new script named PokemonContestPass which in fact is a replica of PokemonTrainerCard, And another smaller def in PokemonUtilities.

    Now for my next great challenge is to solve the Pokemon-following problem as I placed in the script-request folder under Help-14's Pokemon following script. I hope you can help me out with that one too?
     
    67
    Posts
    12
    Years
  • Thanks everyone who has helped me to perfect the concept of a Contest Card (which I later renamed Colosseum Card)
    The final product (with all 10 trophies) is as follows:

    ezimba19963410339800.png


    So once again, thanks heaps!
     
    Back
    Top