Eventers Lab & G+ Games (ELG+)
Olá, se você já é cadastrado no nosso fórum, faça seu login, se ainda não é, não perca tempo! Cadastre-se já!

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

Eventers Lab & G+ Games (ELG+)
Olá, se você já é cadastrado no nosso fórum, faça seu login, se ainda não é, não perca tempo! Cadastre-se já!
Eventers Lab & G+ Games (ELG+)
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Entrar

Esqueci-me da senha

Últimos assuntos
» 2 Players no jogo (Backup RMB)
Chamar Bote EmptyDom Jul 31, 2011 5:39 pm por Rodrigo Vernaschi

» Chamar Bote
Chamar Bote EmptyDom Jul 31, 2011 5:16 pm por Rodrigo Vernaschi

» Caixa de Texto Acima do Personagem
Chamar Bote EmptyDom Jul 31, 2011 4:56 pm por Rodrigo Vernaschi

» Auto-Tile Speed
Chamar Bote EmptyDom Jul 31, 2011 4:49 pm por Rodrigo Vernaschi

» Apresentação Antes do Title
Chamar Bote EmptyDom Jul 31, 2011 4:35 pm por Rodrigo Vernaschi

» Anti-Hack System (Silver Link/Gold Link)
Chamar Bote EmptyDom Jul 31, 2011 4:26 pm por Rodrigo Vernaschi

» Anti Hack (AMIGO X)
Chamar Bote EmptyDom Jul 31, 2011 4:19 pm por Rodrigo Vernaschi

» Ajustar Volume Durante o Jogo
Chamar Bote EmptyDom Jul 31, 2011 3:58 pm por Rodrigo Vernaschi

» Músicas e poemas
Chamar Bote EmptyQua Out 20, 2010 8:19 pm por Memories


Chamar Bote

Ir para baixo

Chamar Bote Empty Chamar Bote

Mensagem por Rodrigo Vernaschi Dom Jul 31, 2011 5:16 pm

Boat Caller
por BigEd781

Características: Permite chamar o bote quando o personagem está próximo à água.

Instruções: Cole acima do main e utilize o comando chamar script com o seguinte código:
Código:
boat_call = Boat_Caller.new
boat_call.call_boat

Código:
Código:
# Como usar:
# para chamar o script, use o comando 'chamar script' no evento e coloque isso:
# boat_call = Boat_Caller.new
# boat_call.call_boat

class Boat_Caller
  def initialize
    @boat_loc = nil
    #A animação que aparece ao chamr o bote
    @boat_animation_id = 75
    #mude o texto para mudar a mensagem de erro
    @error_text =  ['','          Você precisa estar próximo a agua pa chamar o bote']
  end
 
  def call_boat 
    px = $game_player.x
    py = $game_player.y
 
    #if a tile is passable when the 0x02 flag is passed
    #to the function, the boat is passable.  If the boat
    #is passable, we can put it there. find a spot.
    if $game_map.passable?(px, py - 1, 0x02)    #up
      @boat_loc = [px, py - 1]   
    elsif $game_map.passable?(px + 1, py, 0x02)  #right
      @boat_loc = [px + 1, py]   
    elsif $game_map.passable?(px, py + 1, 0x02)  #down
      @boat_loc = [px, py + 1]   
    elsif $game_map.passable?(px - 1, py, 0x02)  #left
      @boat_loc = [px - 1, py]   
    else
      @boat_loc = nil
    end
 
    if @boat_loc != nil
      #Set the boat location
      $game_map.vehicles[0].set_location(
                                  $game_map.map_id, @boat_loc[0], @boat_loc[1])   
      $game_map.vehicles[0].animation_id = @boat_animation_id
    else
      #nowhere to put the boat, show a message
      unless $game_message.busy
        $game_message.position = 1
        $game_message.texts = @error_text     
        $game_message.visible = true
      end
    end
  end
end

Créditos:
BigEd781
DarkLich por Postar na JogosRPG
ELG+


FUI!!!
Rodrigo Vernaschi
Rodrigo Vernaschi
Administrador
Administrador

Número de Mensagens : 113
Idade : 31
Localização : Mauá-SP
Respeito às regras : Chamar Bote 111010
Premios : Chamar Bote Medal_gold_3: 0 Chamar Bote Medal_silver_3: 0 Chamar Bote Medal_bronze_3: 0
Reputação : 3
Pontos : 251
Data de inscrição : 27/02/2009

Ficha do personagem
Raça: Humano
Nível Maker: Experiente
Mensagem Pessoal: Leiam as regras!

https://eventerslab.forumakers.com

Ir para o topo Ir para baixo

Ir para o topo


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