RPG Maker Brasil
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Ir para baixo
Guloso's
Guloso's
Novo Membro
Novo Membro
Masculino Mensagens : 102
Reputação : 11

[RMVX] Banco Sistem Empty [RMVX] Banco Sistem

Sáb Jun 12, 2010 12:30 am
pessoal alguem ai sabe cria sistema de banco ?

quem solber posta aki!
umbala
umbala
Novato
Novato
Mensagens : 22
Reputação : 10

[RMVX] Banco Sistem Empty Re: [RMVX] Banco Sistem

Sáb Jun 12, 2010 1:37 pm
eu ja vi um pru rpg maker 2000 mas perdi
Lord Maker
Lord Maker
Novato
Novato
Masculino Mensagens : 16
Reputação : 11

[RMVX] Banco Sistem Empty Re: [RMVX] Banco Sistem

Seg Jun 14, 2010 11:06 am
Já tentou fazer fazer por eventos mesmo? Dava pra usar uma variável pra ser a conta do jogador e criar um evento comum onde ele pudesse mexer nessa conta depositando ou retirando valores dela. Se quiser tentar eu posso te ajudar, só postar as dúvidas, que de scripts eu não entendo nada, mas já criei um sistema de batalha no mapa com danos nesse mapa (Destruir casas, chão, essas coisas...), skills, até overdrive eu tava estudando como adicionar, ficou show de bola.
MestreJujuba
MestreJujuba
Membro
Membro
Masculino Mensagens : 413
Reputação : 66
http://www.lokosmaniacos.blogspot.com

[RMVX] Banco Sistem Empty Re: [RMVX] Banco Sistem

Qui Jul 08, 2010 10:34 pm
Reputação da mensagem: 100% (1 votos)
Desculpem se estiver trazendo esse tópico de volta a vida. (lê-se: ressussitando-o). É que estava fazendo um pouco de NADA como sempre e o vi.

Quanto a sua pergunta, bem, para isso eu usaria eventos como já foi dito, mas existe um script para isso:

Código:
# --------------------------------------------------------------------------------------
# TRADUÇÃO POR MESTREJUJUBA
# script de Banco para RMVX feito por RayRpg 
# Inspirado no script de banco de KGC  para RMXP
# Para chamar o script, use: $scene = Scene_Depository.new
#
#--------------------------------------------------------------------------------------

class Window_DepositoryCommand < Window_Selectable

# Nome dos comandos

DEPOSITORY_COMMAND = [
  "Depositar",      # depositar
  "Sacar",    # retirar
]

# Definição dos comandos

DEPOSITORY_HELP = [

  "Depositar Dinheiro",  # Depositar dinheiro

  "Retirar Dinheiro",    # Retirar o dinheiro

]

end

class Window_DepositoryGold < Window_Base

# Número máximo de digitos

GOLD_DIGITS = 7

end


class Scene_Depository

DEPOSIT_GOLD = "Indique quanto quer depositar"

WDEPOSIT_GOLD = "Indique quanto quer retirar"

end

#--------------------------------------------------------------------------

def call_depository

$game_player.straighten

$scene = Scene_Depository.new

end

#--------------------------------------------------------------------------------------
# Class Game_Party
#-------------------------------------------------------------------------------------

class Game_Party

alias initialize_Ray_Depository initialize

def initialize

  initialize_Ray_Depository

  @deposit_gold = 0

end

#--------------------------------------------------------------------------
# informacion de oro
#--------------------------------------------------------------------------

def deposit_gold

  @deposit_gold = 0 if @deposit_gold == nil

  return @deposit_gold

end

#--------------------------------------------------------------------------

# Recupere informacion del oro

#--------------------------------------------------------------------------

def gain_deposit_gold(number)

  @deposit_gold = 0 if @deposit_gold == nil

  @deposit_gold += number

end

def lose_deposit_gold(number)

  self.gain_deposit_gold(-number)

end
end


#---------------------------------------------------------------------------------
#  Window_DepositoryCommand
#---------------------------------------------------------------------------------


class Window_DepositoryCommand < Window_Selectable

def initialize

  super(0, 64, 545, 60)

  self.contents = Bitmap.new(width - 32, height - 32)

  @commands = DEPOSITORY_COMMAND

  @item_max = @commands.size

  @column_max = @commands.size

    @item_width = (width - 32) / @commands.size
 
    self.back_opacity = 160

  self.index = 0

  refresh

end

#--------------------------------------------------------------------------
# Atualização
#--------------------------------------------------------------------------

def refresh

  for i in 0...@commands.size

    rect = Rect.new(@item_width * i, 0, @item_width, 32)

    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))

    self.contents.font.color = system_color

    self.contents.draw_text(rect, @commands[i], 1)

  end

end

#-------------------------------------------------------------------------------- 
# Cursor
#---------------------------------------------------------------------------------

def update_cursor_rect

  if index != -1

    self.cursor_rect.set(@item_width * index, 0, @item_width, 32)

  end

end

def update_help

  @help_window.set_text(DEPOSITORY_HELP[self.index])

end

end

#--------------------------------------------------------------------------------
#  Window_DepositoryGold
#---------------------------------------------------------------------------------


class Window_DepositoryGold < Window_Base

def initialize

  super(0, 128, 545, 285)

  @digits_max = GOLD_DIGITS

  dummy_bitmap = Bitmap.new(32, 32)

  @cursor_width = dummy_bitmap.text_size("-").width + 8

  dummy_bitmap.dispose

  self.contents = Bitmap.new(width - 32, height - 32)

  self.back_opacity = 160

  self.active = false

  self.visible = false

  @cursor_position = 0

  @max = 0

  @price = 0

  @index = 0

end

def price

  return @price

end

def price=(np)

  @price = [[np, 0].max, @max].min

  redraw_price

end

def reset(type)

  @price = 0

  @index = @digits_max - 1

  refresh(type)

end

def refresh(type)

  self.contents.clear

  domination = $game_party.gold

  cx = contents.text_size(domination).width

  @cursor_position = 332 - cx - @cursor_width * @digits_max

  self.contents.font.color = system_color

  self.contents.draw_text(0, 0, 608, 32, "Dinheiro que tem:")

  self.contents.draw_text(0, 64, 608, 32, "Depositar:")

  if type == 0

    self.contents.draw_text(0, 128, 608, 32, "Quantidade:")

    @max = $game_party.gold

  else

    self.contents.draw_text(0, 128, 608, 32, "Retirar:")

    @max = [10 ** @digits_max - $game_party.gold - 1, $game_party.deposit_gold].min

  end

  self.contents.font.color = normal_color

  self.contents.draw_text(4, 32, 326 - cx, 32, $game_party.gold.to_s, 2)

  self.contents.font.color = system_color

  self.contents.draw_text(332 - cx, 32, cx, 32, domination, 2)

  self.contents.font.color = normal_color

  self.contents.draw_text(4, 96, 326 - cx, 32, $game_party.deposit_gold.to_s, 2)

  self.contents.font.color = system_color

  self.contents.draw_text(332 - cx, 96, cx, 32, domination, 2)

  redraw_price

end

def redraw_price

  domination = $game_party.gold

  cx = contents.text_size(domination).width

  self.contents.fill_rect(0, 160, 608, 32, Color.new(0, 0, 0, 0))

  self.contents.font.color = normal_color

  text = sprintf("%0#{@digits_max}d", self.price)

  for i in 0...text.length

    x = @cursor_position + (i - 1) * @cursor_width

    self.contents.draw_text(x, 160, 32, 32, text[i, 1], 2)

  end

  self.contents.font.color = system_color

  self.contents.draw_text(332 - cx, 160, cx, 32, domination, 2)

end

#--------------------------------------------------------------------------
# Atualização do cursor
#--------------------------------------------------------------------------

def update_cursor_rect

  x = @cursor_position + @index * @cursor_width

  self.cursor_rect.set(x, 160, @cursor_width, 32)

end

def update

  super

  return unless self.active

  if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)

    Sound.play_decision
    place = 10 ** (@digits_max - 1 - @index)

    n = self.price / place % 10

    self.price -= n * place

    n = (n + 1) % 10 if Input.repeat?(Input::UP)

    n = (n + 9) % 10 if Input.repeat?(Input::DOWN)

    self.price += n * place

  end

  if Input.repeat?(Input::RIGHT)

    if @digits_max >= 2

      Sound.play_decision     
      @index = (@index + 1) % @digits_max

    end

  end

  if Input.repeat?(Input::LEFT)

    if @digits_max >= 2

      Sound.play_decision
      @index = (@index + @digits_max - 1) % @digits_max

    end

  end

  update_cursor_rect

end

end

def item

  return @data[self.index]

end

#--------------------------------------------------------------------------------
#  Window_DepositoryNumber
#-------------------------------------------------------------------------------

class Window_DepositoryNumber < Window_Base

def initialize

  @digits_max = 2

  @number = 0

  dummy_bitmap = Bitmap.new(32, 32)

  @cursor_width = dummy_bitmap.text_size("0").width + 8

  dummy_bitmap.dispose

  @default_size = @cursor_width * @digits_max + 32

  super(0, 0, @default_size, 128)

  self.contents = Bitmap.new(width - 32, height - 32)

  self.z = 1000

  self.back_opacity = 160

  self.active = false

  self.visible = false

  @index = 0

  @item = nil

  refresh

  update_cursor_rect

end

#-------------------------------------------------------------------------
# Atualização do cursor
#--------------------------------------------------------------------------

def update_cursor_rect

  self.cursor_rect.set(@index * @cursor_width, 32, @cursor_width, 32)

end

def refresh

  self.contents.fill_rect(0, 32, width - 32, 32, Color.new(0, 0, 0, 0))

  self.contents.font.color = normal_color

  s = sprintf("%0*d", @digits_max, @number)

  for i in 0...@digits_max

    self.contents.draw_text(i * @cursor_width + 4, 32, 32, 32, s[i,1])

  end

end

def set_text(string = " ")

  self.resize(self.contents.text_size(string).width + 40)

  self.contents.fill_rect(0, 0, width - 32, 32, Color.new(0, 0, 0, 0))

  self.contents.font.color = normal_color

  self.contents.draw_text(0, 0, width - 32, 32, string, 1)

  refresh

  centering

end

def resize(nw)

  self.width = nw

  buf = self.contents.dup

  self.contents.dispose

  self.contents = Bitmap.new(nw - 32, 96)

  self.contents.blt(0, 0, buf, buf.rect)

  buf.dispose

end

#-------------------------------------------------------------------------
# Movimiento central
#--------------------------------------------------------------------------

def centering

  self.x = 320 - self.width / 2

  self.y = 240 - self.height / 2

end

#-------------------------------------------------------------------------
# Atualização
#--------------------------------------------------------------------------

def update

  super

  return unless self.active

  if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)

    $game_system.se_play($data_system.cursor_se)

    place = 10 ** (@digits_max - 1 - @index)

    n = self.number / place % 10

    self.number -= n * place

    n = (n + 1) % 10 if Input.repeat?(Input::UP)

    n = (n + 9) % 10 if Input.repeat?(Input::DOWN)

    self.number += n * place

    refresh

  end

  if Input.repeat?(Input::RIGHT)

    if @digits_max >= 2

      $game_system.se_play($data_system.cursor_se)

      @index = (@index + 1) % @digits_max

    end

  end

  if Input.repeat?(Input::LEFT)

    if @digits_max >= 2

        Sound.play_decision

      @index = (@index + @digits_max - 1) % @digits_max

    end

  end

  update_cursor_rect

end

end

#---------------------------------------------------------------------------------
#  Scene_Depository
#---------------------------------------------------------------------------------

class Scene_Depository

def main

  @spriteset = Spriteset_Map.new

  @dummy_window = Window_Base.new(0, 60, 545, 352)

  @help_window = Window_Help.new

  @dummy_window.back_opacity = 160

  @help_window.back_opacity = 160

  @command_window = Window_DepositoryCommand.new

  @gold_window = Window_DepositoryGold.new

  @number_window = Window_DepositoryNumber.new

  @command_window.help_window = @help_window

  Graphics.transition

  loop do

    Graphics.update

    Input.update

    update

    if $scene != self

      break

    end

  end

  Graphics.freeze

  @spriteset.dispose

  @dummy_window.dispose

  @help_window.dispose

  @command_window.dispose

  @gold_window.dispose

  @number_window.dispose

end

#------------------------------------------------------------------------
# Atualização
#--------------------------------------------------------------------------

def update

  @dummy_window.update

  @help_window.update

  @command_window.update

  @gold_window.update

  @number_window.update

  if @command_window.active

    update_command

    return

  end

  if @gold_window.active

    update_gold

    return

  end

  if @number_window.active

    update_number

    return

  end

end

def update_command

  if Input.trigger?(Input::B)

  Sound.play_decision

    $scene = Scene_Map.new

    return

  end

  if Input.trigger?(Input::C)

    Sound.play_decision
    case @command_window.index

    when 0

      @gold_window.active = true

      @gold_window.visible = true

      @gold_window.reset(0)

      @help_window.set_text(DEPOSIT_GOLD)

    when 1

      @gold_window.active = true

      @gold_window.visible = true

      @gold_window.reset(1)

      @help_window.set_text(WDEPOSIT_GOLD)

    when 2

      @item_window.active = true

      @item_window.visible = true

      @item_window.refresh(0)

    when 3

      @item_window.active = true

      @item_window.visible = true

      @item_window.refresh(1)

    end

    @command_window.active = false

    @dummy_window.visible = false

    return

  end

end

def update_gold

  if Input.trigger?(Input::B)

    Sound.play_decision

    @command_window.active = true

    @gold_window.active = false

    @gold_window.visible = false

    @dummy_window.visible = true

    return

  end

  if Input.trigger?(Input::C)

    price = @gold_window.price

    if price == 0

      Sound.play_decision
      @command_window.active = true

      @gold_window.active = false

      @gold_window.visible = false

      @dummy_window.visible = true

      return

    end

    Sound.play_decision
    case @command_window.index

    when 0

      $game_party.lose_gold(price)

      $game_party.gain_deposit_gold(price)

    when 1

      $game_party.gain_gold(price)

      $game_party.lose_deposit_gold(price)

    end

    @gold_window.reset(@command_window.index)

    return

  end

end

def update_number

  if Input.trigger?(Input::B)

  Sound.play_decision

    @number_window.active = false

    @number_window.visible = false

    return

  end

    @number_window.active = false

    @number_window.visible = false

    return

  end

end

Dica: não faça com script o que você sabe fazer por evento. ^^
allzero
allzero
Novo Membro
Novo Membro
Masculino Mensagens : 198
Reputação : 16

[RMVX] Banco Sistem Empty Re: [RMVX] Banco Sistem

Ter Jul 13, 2010 1:34 pm
futuramente provsvelmente usarei esse script, =
SteveTheCreeper
SteveTheCreeper
Membro
Membro
Masculino Mensagens : 476
Reputação : 24

[RMVX] Banco Sistem Empty Re: [RMVX] Banco Sistem

Qui Ago 12, 2010 6:20 pm
Pedido atendido topico fechado
Conteúdo patrocinado

[RMVX] Banco Sistem Empty Re: [RMVX] Banco Sistem

Ir para o topo
Permissões neste sub-fórum
Não podes responder a tópicos