Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Reply
 
Thread Tools
  #1    
Old July 18th, 2012 (7:38 PM).
zingzags's Avatar
zingzags zingzags is offline
PokemonGDX creator
     
    Join Date: Jan 2009
    Location: Boston
    Age: 23
    Nature: Adamant
    Posts: 562
    In your settings add this
    BALANCE=X where "X" is the game variable which holds the data which is used for the bank.
    Just call pbDeposit, or pbWithdraw in an event.
    Enjoy

    Code:
    class Bank
    
    def pbDeposit
    params=ChooseNumberParams.new
    params.setRange(1,$Trainer.money)
    params.setInitialValue($Trainer.money)
    params.setCancelValue(0)
    qty=Kernel.pbMessageChooseNumber(_INTL("Teller: How much would you like to deposit?"),params)
    newmoney=$Trainer.money-qty
    store=$Trainer.money-newmoney
    $game_variables[BALANCE]=$game_variables[BALANCE]+store
    $Trainer.money=newmoney
    end
    
    def pbWithdraw
    params=ChooseNumberParams.new
    params.setRange(1,$game_variables[BALANCE])
    params.setInitialValue($game_variables[BALANCE])
    params.setCancelValue(0)
    qty=Kernel.pbMessageChooseNumber(_INTL("Teller: How much would you like to withdraw?"),params)
    newmoney=$Trainer.money+qty
    remove=$game_variables[BALANCE]-qty
    $game_variables[BALANCE]=remove
    $Trainer.money=newmoney
    end
    
    end
    
    class BankScreen
     def initialize(scene)
      @scene = scene
     end
     def pbStartScreen
       @scene.pbDeposit
     end
     def pbStartScreen2
       @scene.pbWithdraw
     end
    end
    Please use credits
    __________________
    Check out the Pokemon Game Engine I am working on:
    https://github.com/sjosegarcia/Pokemon
    Reply With Quote

    Relevant Advertising!

      #2    
    Old July 18th, 2012 (8:03 PM).
    shadowriver shadowriver is offline
       
      Join Date: Sep 2007
      Gender:
      Posts: 49
      Thank you very much for this,this will be very handy indeed.
      __________________
      V8 Essentials with Ultimate BW Pack and pokemon follow ready to go.
      (I had nothing to do with its creation just put it together for genarl use) http://www.mediafire.com/?rtrco39udskdb81
      Credits go to
      p-Sign
      Clowcardruler
      Maruno
      Venom12
      FL .
      Help-14
      zingzag
      rick1234
      Reply With Quote
        #3    
      Old July 19th, 2012 (1:59 AM).
      p.claydon p.claydon is offline
         
        Join Date: Jan 2011
        Gender:
        Posts: 335
        lol looks like a similar script i made for money storage with the players mother

        Quote:
        def withdrawmommoney
        params=ChooseNumberParams.new
        params.setRange(0,$game_variables[30])
        params.setInitialValue(1)
        params.setCancelValue(0)
        qty=Kernel.pbMessageChooseNumber(
        _INTL("How much to withdraw."),params
        )
        if qty>0
        $Trainer.money+=qty
        $game_variables[30]-=qty
        Kernel.pbMessage(_INTL("${1} was added.",qty))
        else
        Kernel.pbMessage(_INTL("no money was added."))
        end
        end

        def depositmommoney
        params=ChooseNumberParams.new
        $game_variables[31]=$Trainer.money
        params.setRange(0,$game_variables[31])
        params.setInitialValue(1)
        params.setCancelValue(0)
        qty=Kernel.pbMessageChooseNumber(
        _INTL("How much to deposit."),params
        )
        if qty>0
        $Trainer.money-=qty
        $game_variables[30]+=qty
        Kernel.pbMessage(_INTL("${1} was stored.",qty))
        else
        Kernel.pbMessage(_INTL("no money was stored."))
        end
        end

        def mommoney
        Kernel.pbMessage(_INTL("You have ${1}",$game_variables[30]))
        withdrawmommoney
        depositmommoney
        end
        Reply With Quote
          #4    
        Old July 19th, 2012 (7:09 AM).
        zingzags's Avatar
        zingzags zingzags is offline
        PokemonGDX creator
           
          Join Date: Jan 2009
          Location: Boston
          Age: 23
          Nature: Adamant
          Posts: 562
          Quote:
          Originally Posted by p.claydon View Post
          lol looks like a similar script i made for money storage with the players mother
          Its the same math really.
          __________________
          Check out the Pokemon Game Engine I am working on:
          https://github.com/sjosegarcia/Pokemon
          Reply With Quote
          Reply
          Quick Reply

          Sponsored Links
          Thread Tools

          Posting Rules
          You may not post new threads
          You may not post replies
          You may not post attachments
          You may not edit your posts

          BB code is On
          Smilies are On
          [IMG] code is On
          HTML code is Off

          Forum Jump


          All times are GMT -8. The time now is 11:56 AM.