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

System of intereset

  • 70
    Posts
    19
    Years
    Hello everyone,

    I created a bank and it work's fine, but with a system of intereset it would be perfect. But i can't really implement this satisfactorily, so i need your help. The best solution (in my opinion) was to make an time delay event (https://pokemonessentials.wikia.com/wiki/Time-sensitive_events#Time_delay). I put the event in every Mart-Map (Where the banksystem was included), but the problem are the self switches. Each event has his own self switches and each event is on a different map. That means, only one self switch will be trigged to on, so when you going to an another mart, the system of interest will starts again (Because his self switch are not triggered yet), even the 24 hours aren't exhausted.

    I know my system would only work, when the player is visiting the mart on that day, but that was the best solution i could think of was.

    Greets.

    Edit: In the case you don't know what i mean: I want create a system, where you get interesets every 24 hours (e.g 10% of the money you had discarded in the bank).
     
    Last edited:
    Hello everyone,

    I created a bank and it work's fine, but with a system of intereset it would be perfect. But i can't really implement this satisfactorily, so i need your help. The best solution (in my opinion) was to make an time delay event (https://pokemonessentials.wikia.com/wiki/Time-sensitive_events#Time_delay). I put the event in every Mart-Map (Where the banksystem was included), but the problem are the self switches. Each event has his own self switches and each event is on a different map. That means, only one self switch will be trigged to on, so when you going to an another mart, the system of interest will starts again (Because his self switch are not triggered yet), even the 24 hours aren't exhausted.

    I know my system would only work, when the player is visiting the mart on that day, but that was the best solution i could think of was.

    Greets.

    Edit: In the case you don't know what i mean: I want create a system, where you get interesets every 24 hours (e.g 10% of the money you had discarded in the bank).

    use:

    Code:
    $end_time=Time.now.to_i+(3600*24) # 1 day from now

    this will be the end time of the interest

    now check this in every mart:

    Code:
    if Time.now.to_i >= $end_time
    # function here
    end
     
    Pokémon with Pokérus have their infection time reduced by 1 day each day. You could use something similar to add your interest; it would be automatic and require nothing special in the bank events themselves.

    10% interest sounds like far too much.
     
    Thanks for the replies

    @maruno: I guess the supposed part is in Poke_Battle, but I'm actaully a totaly noob of Ruby, so i don't get how i can use this for the system. Can you please give me a step by step instruction? That would be very helpful for me.
     
    The code you want is in PokemonField, line 1417 or thereabouts. You'll want to copy it, and replace the code that checks through the player's party with multiplying the amount of banked money by 1.1 (for 10% interest). Presumably the amount of money banked is being saved in a Global Variable, so that's easy to play with.

    You may wish to change how it works a bit more, though.
     
    I guess you mean that code:
    Code:
      if !last || last.year!=now.year || last.month!=now.month || last.day!=now.day
        if $Trainer && $Trainer.party
          for i in $Trainer.party
            i.lowerPokerusCount
          end
          $PokemonGlobal.pokerusTime=now
        end
      end

    I don't really know how i must copy and adapt the code, to works. The code depends on the time a pokemon get a pokerus, so i must change this depend. When i use

    Code:
      if !last || last.year!=now.year || last.month!=now.month || last.day!=now.day
    $game_variables[40] *= 1.1
      end

    It don't work...

    Sorry that I'm so noobish, but I really can't imagine how i must change the code to fit it for my needs.
     
    You had it pretty much right, although maybe you hadn't copied the whole procedure. In fact, you can incorporate your interest system into the existing Pokérus check to make things even easier for you - just add the $game_variables[40]*=1.1 line in as follows:

    Code:
    Events.onMapUpdate+=proc {|sender,e|
      last=$PokemonGlobal.pokerusTime
      now=Time.now
      if !last || last.year!=now.year || last.month!=now.month || last.day!=now.day
        if $Trainer && $Trainer.party
          for i in $Trainer.party
            i.lowerPokerusCount
          end
          [COLOR=Red]$game_variables[40]*=1.1[/COLOR]
          $PokemonGlobal.pokerusTime=now
        end
      end
    }
    The only "drawback" with this is that interest will only be gained if the player and their party is defined at all, but that's bound to be the case anyway. Interest will be gained at midnight each day, or immediately upon starting the game again on a new day. Days in which the game is not played are ignored.
     
    Back
    Top