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

Game Corner: Buying coins with money

  • 16
    Posts
    11
    Years
    • Seen Aug 9, 2012
    Can someone give me a code or tell me how to make a desk where a person transfers player coins for game corner coins? It is some of the games, definitely emerald and diamond/pearl, I believe. Also how do you change the price of items in marts/game corner?
     
  • 49
    Posts
    16
    Years
    • Seen Apr 28, 2013
    Set it up like this.

    creat an event of a person who will sell coins. then set up a
    conditional branch.
    this lets you buy coins only if you posses a coin case

    @>Conditional Branch:$PokemonBag.pbQuantity(PBItems::COINCASE)==1
    (this checks to see if you have a coincase in bag)
    @>Conditional Branch: Gold 1 or more
    @>Change Gold: - 1
    @>script: $PokemonGlobal.coins+=1 (This raises the coin value you posess)
    @>Text: \GHere you go! (or somthing more relavent.)

    : Else
    @>Text: You dont seem to have a coin case yet.
    @>
    : Branch End
    @>
    : Else
    @>Text: \GYou don't have enough money.
    @>
    : Branch End
     

    IceGod64

    In the Lost & Found bin!
  • 624
    Posts
    15
    Years
    There's a couple of problems with that code. You got the "You do't have a coin case" and "you don't have enough money" in the wrong place. Also, for cleanliness, you should try (PBItems::COINCASE) > 0. It's not possible to have more than one one coin case, but this is just a preventive measure.

    So, try it more like this:

    @>Conditional Branch:$PokemonBag.pbQuantity(PBItems::COINCASE) > 0
    @>Conditional Branch: Gold 1 or more
    @>Change Gold: - 1
    @>script: $PokemonGlobal.coins+=1
    @>Text: \GHere you go!
    : Else
    @>Text: \GYou don't have enough money.
    @>
    : Branch End
    @>
    : Else
    @>Text: You dont seem to have a coin case yet.
    @>
    : Branch End
     
  • 49
    Posts
    16
    Years
    • Seen Apr 28, 2013
    lol opps thanx for cleaning that up for me i did that off the top of my head. i didnt mean to get them round the rong way.
     
  • 16
    Posts
    11
    Years
    • Seen Aug 9, 2012
    ok cheers,now can someone maybe give me a code for a shop at the game corner that sells Tms, Pokemon etc.? (i tried using one someone used earlier but i can't choose the coin price for the items and some of them don't appear) thanks
     

    IceGod64

    In the Lost & Found bin!
  • 624
    Posts
    15
    Years
    ok cheers,now can someone maybe give me a code for a shop at the game corner that sells Tms, Pokemon etc.? (i tried using one someone used earlier but i can't choose the coin price for the items and some of them don't appear) thanks

    Actually, I have an example of that lying around. :t135:

    First off, if you want a lot of prizes like I did, you'll want to learn about showing choices via text. This is explained on the wiki.

    Once you understand that, this is the general structure you'll want to use:
    Code:
    @>Text: Choose a prize.\ch[5,2,FIRE STONE,WATER STONE,CANCEL]
    @>Conditional Branch: Variable[5] == 0
       @>Text: You want the Fire Stone  for 2400 coins?
       @>Show Choices:Yes,No
         :When [Yes]
         @>Conditional Script: $PokemonGlobal.coins > 2399
             @>Kernel.pbReceiveItem(::PBItems::FIRESTONE)
                   $PokemonGlobal.coins -=2400
             @>
            :Else
             @Text: You don't have enough coins.
             @>
            :Branch End
         : When[No]
           @>
         : Branch End 
       @>
       :Branch End
    @>Conditional Branch: Variable[5] == 1
       @>Text: You want the Water Stone  for 2400 coins?
       @>Show Choices:Yes,No
         :When [Yes]
         @>Conditional Script: $PokemonGlobal.coins > 2399
             @>Kernel.pbReceiveItem(::PBItems::WATERSTONE)
                   $PokemonGlobal.coins -=2400
             @>
            :Else
             @Text: You don't have enough coins.
             @>
            :Branch End
         : When[No]
           @>
         : Branch End 
       @>
       :Branch End
    Of course, you want TM's, which in your game may or may not be infinite-use, in which case their conditional branch will need to be a little more full, particularly in that you will need to make sure to include a check for whether or not the player has the TM already or not. For example, $PokemonBag.pbQuantity(PBItems::TM24) > 0
     
  • 16
    Posts
    11
    Years
    • Seen Aug 9, 2012
    thank you very much. and my tms do have infinite uses, but i can sort that out.
     
    Back
    Top