Life RPG Maker 2.0
Bem vindo a LRM, forum de ajuda Maker
Registre-se em nosso forum e aproveite Very Happy
esperamos que você seja ajudado e esperamos que nos ajude Very Happy

Participe do fórum, é rápido e fácil

Life RPG Maker 2.0
Bem vindo a LRM, forum de ajuda Maker
Registre-se em nosso forum e aproveite Very Happy
esperamos que você seja ajudado e esperamos que nos ajude Very Happy
Life RPG Maker 2.0
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Life RPG Maker 2.0

2ª versão do forum life rpg maker

Os membros mais ativos do mês
Nenhum usuário

Últimos assuntos
» Kingdon 1.6
Sistema de Natação EmptyTer Jun 09, 2015 3:02 pm por MasterKill

» Tempo dinâmico e Hora do Sistema
Sistema de Natação EmptySeg Dez 09, 2013 5:42 pm por jonathas

» Sistema de Natação
Sistema de Natação EmptySáb Dez 07, 2013 5:14 pm por jonathas

» Classificar Inventario
Sistema de Natação EmptySáb Dez 07, 2013 12:07 pm por Samuka_Adm

» VOLTEI ALELUIA :D
Sistema de Natação EmptySáb Dez 07, 2013 10:35 am por Samuka_Adm

» Netplay Master v4.0.7
Sistema de Natação EmptyQua Jun 26, 2013 1:32 pm por xdario

» The League Of War [Season 1]
Sistema de Natação EmptySex Jan 18, 2013 6:02 pm por Warrior

» Meu primeiro desenho que posto :D
Sistema de Natação EmptyQua Jan 09, 2013 1:37 pm por PedroMatoso

» Window Configurações
Sistema de Natação EmptyQua Jan 09, 2013 1:36 pm por PedroMatoso

Parceiros
Fórum grátis

Fórum grátis


Mundo RPG Maker
MMORPG BRASIL

Você não está conectado. Conecte-se ou registre-se

Sistema de Natação

4 participantes

Ir para baixo  Mensagem [Página 1 de 1]

1Sistema de Natação Empty Sistema de Natação Dom Out 21, 2012 7:53 pm

leandroteix

leandroteix
Moderador G
Moderador G

Natação
Versão: 1,7

Introdução
Parece-me que a maioria natação é feito através de sistemas de eventos ou script Seph do veículo que é bom se você quiser pegar um pingüim para atravessar um rio, mas todos nós sabemos que a natação não é o mesmo que andar de bicicleta. Eu vi um monte de pedidos de um script de natação, então eu pensei que eu ia fazer um. Este é o meu primeiro script que faz algo mais interessante do que exibir uma janela XD.

-O script irá causar o seguinte, quando o jogador se aproxima de água:
-O jogador irá mudar para um gráfico de mergulho (opcional)
-O jogador vai pular em um corpo de água (pelo menos 2 peças de largura)
-É reproduzido um som (opcional e personalizável)
-O jogador irá mudar para um gráfico de natação
-A velocidade irá mudar
-O jogador vai saltar para fora da água para a terra que é pelo menos duas telhas de largura e andar em terra que é uma telha de largura
-A natação pode ser, mas não tem de ser, controlado por um interruptor
-Se a natação não está disponível (interruptor estiver desligado, não tem um item / armadura / arma), a água vai ser intransponível ou o jogador pode se afogar

Atualizações
-Adicionado mais condições de disponibilidade
-Corrigido o problema que a natação desativação realmente não fazer nada XD
-Removido correndo personalizado e sneaking sufixos de animação. Eles não trabalham. Desculpe!
-Corrigido o erro onde o jogador vai pular certas peças de água não se houver apenas uma água e por trás dele
-Adicionado nivelando-se, você pode nadar mais rápido se você nadar mais
-Mudou na velocidade da água arrojado e opção de disponibilidade
-Adicionado opção de mudança de mergulho gráfico
-Efeito adicionado "água pisando '
-Swim toque adicionado
-Adicionado arrojado e sneaking capacidade
-Corrigido o erro onde o personagem fica preso em um ladrilho intransponível depois de sair da água

Modelos
Modelo de mergulho: Editado a partir de macho Mack
Sistema de Natação Template_dive-1
Ele só precisa de 4 quadros, porque é visível apenas por um segundo.
Natação Modelo: Novamente a partir de Mack masculino
Sistema de Natação Template_swim

Screens
antes
Sistema de Natação Swim_Screenie1
Mergulho (eu pensei em mostrar o lado vista Smile)
Sistema de Natação Swim_Screenie2
Na água
Sistema de Natação Swim_Screenie3

Script
Código:
#==============================================================================#
#  Swimming!  v 1.8                                                          #
#  By: ToriVerly @ hbgames.org                                                    #
#==============================================================================#
#  Intructions:                                                                #
#------------------------------------------------------------------------------#
=begin
 Paste this script above Main and below everything else.
 For each character you will have swimming, make a swimming sprite that has the
 same name as the character but ending with "_swim" and another with "_dive" if
 DIVE_GRAPHIC is true.
    Example: "001-Fighter01_swim.png"
 
 If TREAD_ANI = true, the character will be animated while in water when they are
 not moving.  Hence a treading water effect.  Set it to false if you don't want
 the effect.
 
 Set the WATER constant to the terrain tag ID of your water tiles or whatever tile
 you want to swim through.  When you place non water tiles over water tiles (in
 a higher layer), the non water tiles will need to have a terrain tag that is
 different than WATER and not 0 or else the characters is swim through it.
 
    IMPORTANT--->make sure your water tile is passable.
 
 If you want the ability to swim to depend on a switch, set SWIM_SWITCH to the ID
 of the game switch you're using. If you don't want to use a switch, set it to nil.
 Similarily, set SWIM_ITEM, SWIM_ARMOR or SWIM_WEAPON to the ID of the item, armor
 or weapon required for swimming and nil if there is none.  You can even set more
 than one condition!
 
 The SWIM_SE will play every time you jump into water.  If you don't want a sound,
 set DIVE_SOUND_OFF to true.
 
 The SNEAK_KEY and DASH_KEY functions can be set for Mr.Mo's ABS or an input
 letters script.  If you don't have such an input system but have another dashing
 and/or sneaking system/script, change them to Input::YourKey.
    Example: Input::X
              Input::Y
 If you don't have dashing or sneaking at all, set them to nil.
 WATER_DASHING is self explanitory.  If you want to dash in water, set it to true.
 If DROWNING is on, the player will have about three seconds to get out of water
 before they die (if swimming isn't available). If it is off, water will just be
 impassable.
 Enjoy!
=end
#------------------------------------------------------------------------------#
WATER = 1
SWIM_SWITCH = 1
SWIM_ITEM = nil
SWIM_ARMOR = nil
SWIM_WEAPON = nil
SNEAK_KEY = nil #Input::Letterres["Z"] for Mr.Mo's ABS or input letters script
DASH_KEY = nil #Input::Letters["X"] for Mr.Mo's ABS or input letters script
SWIM_SE = "022-Dive02"
DROWN_SE = "021-Dive01"
DROWNING = true
WATER_DASHING = false
DIVE_SOUND_OFF = false
DIVE_GRAPHIC = true
TREAD_ANI = true
#------------------------------------------------------------------------------#

#==============================================================================#
# Game_Player                                                                  #
#------------------------------------------------------------------------------#
# Modifies the Game_Player class initialization and updating                  #
#==============================================================================#
class Game_Player < Game_Character
  attr_reader  :swim
  attr_reader  :swimming?
  attr_reader  :swim_count
  alias swim_init initialize
  def initialize
    @swim = false
    @drown_count = 0
    @swim_count = 0
    swim_init
  end
  alias swim_update update
  def update

    # Checks if swimming is triggered
    if DROWNING == true
    return jump_in if facing?(WATER, 'any', 1) and !@swim and moving?
    # Drowns if it is not available
    drown if !swim_available? and on?(WATER)
    elsif DROWNING == false
    return jump_in if facing?(WATER, 'any', 1) and !@swim and moving? and swim_available?
    end
   
    # Jumps out of water at shore
    jump_forward if !on?(WATER) and !facing?(WATER, 'any', 1) and !facing?(WATER, 'any', 2) and @swim and moving?
    # Returns original settings when out of water
    revert if @swim and !on?(WATER)
   
    # Refreshes swimming state
    swim_refresh if swimming?
  swim_update
end

    # Makes water impassable when swimming isn't available
  alias mrmo_swim_game_player_passable passable?
  def passable?(x, y, d)
    # Get new coordinates
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    # Check if it water tag
    return false if $game_map.terrain_tag(new_x,new_y) == WATER and !swim_available? and DROWNING == false
    # Old Method
    mrmo_swim_game_player_passable(x,y,d)
  end
#------------------------------------------------------------------------------#
# Custom Methods                                                              #
#------------------------------------------------------------------------------#
  # Checks swimming availability
  def swim_available?
    if SWIM_SWITCH != nil
      return true if $game_switches[SWIM_SWITCH]
      return false if !$game_switches[SWIM_SWITCH]
    end
    if SWIM_ITEM != nil
      return true if $game_party.item_number(SWIM_ITEM) != 0
      return false if $game_party.item_number(SWIM_ITEM) == 0
    end
    if SWIM_ARMOR != nil
      return true if $game_party.actors[0].armor1_id == SWIM_ARMOR
      return true if $game_party.actors[0].armor2_id == SWIM_ARMOR
      return true if $game_party.actors[0].armor3_id == SWIM_ARMOR
      return true if $game_party.actors[0].armor4_id == SWIM_ARMOR
      return false
    end
    if SWIM_WEAPON != nil
      return true if $game_party.actors[0].weapon_id == SWIM_WEAPON
      return false
    end
    return true
  end
   
  # Jumps in the water if swimming is triggered
  def jump_in
    @swim = true
    unless DIVE_SOUND_OFF
    @play_sound = true
    end
  if DIVE_GRAPHIC == true
    @character_name = $game_party.actors[0].character_name
    @character_name = $game_party.actors[0].character_name + "_dive"
  end
  jump_forward if facing?(WATER, 'any', 1)
  end
 
  # Swimming setup
  def swim_refresh
      get_speed if moving?
      if !moving?
        @character_name = $game_party.actors[0].character_name
        @character_name = $game_party.actors[0].character_name + "_swim"
      end
      if @play_sound and !moving?
        Audio.se_play("Audio/SE/" + SWIM_SE , 80, 100)
        @play_sound = false
      end
        @swim = true
      if TREAD_ANI == true
        @step_anime = true
      end
    end
   
  # Drowning
  def drown
    @move_speed = 0.1
    if @drown_count <= 120
      #jump_in if !@swim
      @drown_count += 1
        if @drown_count %40 == 0
          Audio.se_play("Audio/SE/" + DROWN_SE, 80, 100)
        end
      elsif @drown_count >= 120
      @character_name = ""
      @drown_count = 0
      Audio.se_play("Audio/SE/" + SWIM_SE, 80, 100)
    $scene = Scene_Gameover.new
    end
  end
 
  # Reverts original settings when out of water
  def revert
      @character_name = $game_party.actors[0].character_name
      @swim = false
      @drown_count = 0
        unless dashing? or sneaking?
        @move_speed = 4
        @move_frequency = 6
        end
      if TREAD_ANI == true
      @step_anime = false
    end
  end
 
  # Determines Speed (Swim Leveling)
  def get_speed
    # Gets Swim Count
      @swim_count += 0.05
    case @swim_count
    when 0.05
      @swim_speed = 1
      @move_frequency = 1
    when 100
      @swim_speed =  2
      @move_frequency = 1
    when 250
      @swim_speed = 3
      @move_frequency = 1
    when 750
      @swim_speed = 4
      @move_frequency = 1
    when 2000
      @swim_speed = 5
      @move_frequency = 1
    end
    @move_speed = @swim_speed
      if WATER_DASHING == true
          if DASH_KEY != nil and Input.press?(DASH_KEY) and !sneaking?
          @move_speed = @swim_speed + 1
          @move_frequency = 6
          end
          if SNEAK_KEY != nil and Input.press?(SNEAK_KEY) and !dashing?
          @move_speed = @swim_speed -1
          @move_frequency = 2
        end
      end
    end
 
# Jumps forward
  def jump_forward
  case @direction
      when 2
        jump(0, 1)
      when 4
        jump(-1, 0)
      when 6
        jump(1, 0)
      when 8
        jump(0, -1)
      end
    end
  # Jumps backward
  def jump_backward
    case @direction
      when 2
        jump(0, -1)
      when 4
        jump(1, 0)
      when 6
        jump(-1, 0)
      when 8
        jump(0, 1)
      end
    end

  # Checks if dashing
  def dashing?
    return true if DASH_KEY != nil and Input.press?(DASH_KEY)
    return false if SNEAK_KEY != nil and Input.press?(SNEAK_KEY)
  end
  # Checks if sneaking
  def sneaking?
    return true if SNEAK_KEY != nil and Input.press?(SNEAK_KEY)
    return false if DASH_KEY != nil and Input.press?(DASH_KEY)
  end
  # Checks if swimming
  def swimming?
    return true if on?(WATER) and @swim
  end
  # Checks if player is on a terrain tag
  def on?(tag)
    return true if $game_map.terrain_tag($game_player.x, $game_player.y) == tag
  end
  # Checks if player is facing a terrain tag
  def facing?(tag, dir, dist)
    case dir
    when 2
      if $game_player.direction == 2
        tag_x = $game_player.x
        tag_y = $game_player.y + dist
      end
    when 4
      if $game_player.direction == 4
        tag_x = $game_player.x - dist
        tag_y = $game_player.y
      end
    when 6
      if $game_player.direction == 6
        tag_x = $game_player.x + dist
        tag_y = $game_player.y
      end
    when 8
      if $game_player.direction == 8
        tag_x = $game_player.x
        tag_y = $game_player.y - dist
      end
    when 'any'
      if $game_player.direction == 2
        tag_x = $game_player.x
        tag_y = $game_player.y + dist
      end
      if $game_player.direction == 4
        tag_x = $game_player.x - dist
        tag_y = $game_player.y
      end
      if $game_player.direction == 6
        tag_x = $game_player.x + dist
        tag_y = $game_player.y
      end
      if $game_player.direction == 8
        tag_x = $game_player.x
        tag_y = $game_player.y - dist
      end
    end
  return false if tag_x == nil or tag_y == nil
  return true if $game_map.terrain_tag(tag_x, tag_y) == tag
 end
end
#------------------------------------------------------------------------------#
# By ToriVerly
# Thanks to Mr.Mo for help with my passability issues and to Chaosg1 for my intro
# into scripting
#------------------------------------------------------------------------------#

Instruções
No Script - Em Inglês

Compatibilidade
De acordo com um usuário do SDK, este script é compatível.
Até agora os scripts que mudam gráficos ator são buggy com isso. Ele pode ser facilmente corrigido se você sabe o que está fazendo ....:
Se estiver usando outro sistema / script que muda ator gráfico
[Indent] Encontre a linha que muda o gráfico e adicionar as condições:
Código:
and if $game_player.terrain_tag != WATER
Certifique-se de que no início do seu script, fora e antes de comentar qualquer coisa que começa com "classe", colocou
Código:
WATER = 1
[ou alterar um terreno para qualquer marca que você está usando para a água.]
Se nada disso fazia sentido, então por agora a sua não compatível com qualquer script de mudança de gráficos.

Eu traduzi o tópico:
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]

Se quiserem posso traduzir o script.

2Sistema de Natação Empty Re: Sistema de Natação Dom Out 21, 2012 8:00 pm

Samuka_Adm

Samuka_Adm
Admin
Admin

lol, talves eu use o script e deixo o mesmo global para usalo em meu netplay (se é ke ja nao é)
@edti:
ele é global sim pois apenas muda o char kkkkkkk
vlw por compartilher amigo

https://liferpgmakerv2.forumeiros.com

3Sistema de Natação Empty Re: Sistema de Natação Dom Out 21, 2012 9:35 pm

Warrior

Warrior
Moderador
Moderador

Muito bom esse script ja fiz um por evento mas não fico tao bom quanto esse não parabéns esta nos ajudando bastante +1

4Sistema de Natação Empty Re: Sistema de Natação Sáb Dez 07, 2013 5:14 pm

jonathas

jonathas
Aprendiz
Aprendiz

belo sistema e.e porém não sei configurar para que pegue no meu Sad sou péssimo em scripts

Conteúdo patrocinado



Ir para o topo  Mensagem [Página 1 de 1]

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