Seja bem-vindos ao MUNDO RPG MAKER VX (word rpg maker vx)

Scripts

[2.0] Dinamic Sound Areas :: modern algebra

.Introdução

Este script permite que você defina um BGM, BGS, SE e ME para áreas ou eventos, ele também irá dinâmicamente ajustar o volume dependendo da distância do personagem para esta área ou evento. Criando assim a impressão de que aquele som está sendo emitido daquela área ou evento.

.Instrucoes

Coloque este script entre "Scripts Adicionais" e "Principal".

Para configurar um evento, tudo que você precisa é colocar um comentário na primeira linha de uma página com qualquer um dos códigos abaixo:

\SNDEMIT[parâmetro = valor]

Os possíveis parâmetros são:

bgm_name = Nome do BGM que você deseja emitir (Padrão = '')
bgm_pitch = O pitch do BGM, de 50 a 150 (Padrão = 100)
bgm_radius = O raio, em quadrados, da escala do BGM (Padrão = 10)
bgm_max_volume = O volume máximo do BGM (Padrão = 100)
bgs_name = Nome do BGS que você deseja emitir (Padrão = '')
bgs_pitch = O pitch do BGS, de 50 a 150 (Padrão = 100)
bgs_radius = O raio, em quadrados, da escala do BGS (Padrão = 10)
bgs_max_volume = O volume máximo do BGS (Padrão = 100)
se_name = Nome do SE que deseja emitir para esta área (Padrão = '')
se_pitch = O pitch do SE, de 50 a 150 (Padrão = 100)
se_radius = O raio, em quadrados, da escala do SE (Padrão = 10)
se_max_volume = O volume máximo do SE (Padrão = 100)
se_frames = O número de frames enquanto toca o SE (Padrão = 20)
se_frame_variance = A variação dos se_frames (Padrão = 0)
me_name = Nome do ME que deseja emitir para esta área (Padrão = '')
me_pitch = O pitch do ME, de 50 a 150 (Padrão = 100)
me_radius = O raio, em quadrados, da escala do ME (Padrão = 10)
me_max_volume = O volume máximo do ME (Padrão = 100)
me_frames = O número de frames enquanto toca o ME (Padrão = 20)
me_frame_variance = A variação dos me_frames (Padrão = 0)

EXEMPLO:
Configure isso no comentário de um evento:

\sndemit[se_name = 'Chicken']
\SndEmit[se_max_volume = 80]
\sNdeMit[se_frames = 440]
\SNDEMIT[se_frame_variance = 60]

E o evento irá tocar o efeito sonoro 'Chicken' com o volume máximo de 80, em uma escala de 10. Ele irá repetir esse SE entre 380 - 500 frames.

Para saber como configurar as áreas para emitir sons, veja a parte: REGIÃO CONFIGURÁVEL no script.

.Script



#==============================================================================
# Dynamic Sound Emitting Areas (VX)
# Versão 2.0
# Autor: modern algebra
# Data: 9 de Agosto, 2008
# Tradução: Bennamy :: Amy Productions
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Descrição:
# Este script permite que você defina um bgm, bgs, se e me para áreas ou
# eventos, e ele irá dinâmicamente ajustar o volume dependendo da distância
# do personagem para esta área ou evento. Criando assim a impressão de que
# aquele som está sendo emitido daquela área ou evento.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Instruções:
#
# Para configurar um evento, tudo que você precisa é colocar um comentário na
# primeira linha de uma página com qualquer um dos códigos abaixo:
#
# \SNDEMIT[parâmetro = valor]
#
# Os possíveis parâmetros são:
#
# bgm_name = Nome do BGM que você deseja emitir (Padrão = '')
# bgm_pitch = O pitch do BGM, de 50 a 150 (Padrão = 100)
# bgm_radius = O raio, em quadrados, da escala do BGM (Padrão = 10)
# bgm_max_volume = O volume máximo do BGM (Padrão = 100)
# bgs_name = Nome do BGS que você deseja emitir (Padrão = '')
# bgs_pitch = O pitch do BGS, de 50 a 150 (Padrão = 100)
# bgs_radius = O raio, em quadrados, da escala do BGS (Padrão = 10)
# bgs_max_volume = O volume máximo do BGS (Padrão = 100)
# se_name = Nome do SE que deseja emitir para esta área (Padrão = '')
# se_pitch = O pitch do SE, de 50 a 150 (Padrão = 100)
# se_radius = O raio, em quadrados, da escala do SE (Padrão = 10)
# se_max_volume = O volume máximo do SE (Padrão = 100)
# se_frames = O número de frames enquanto toca o SE (Padrão = 20)
# se_frame_variance = A variação dos se_frames (Padrão = 0)
# me_name = Nome do ME que deseja emitir para esta área (Padrão = '')
# me_pitch = O pitch do ME, de 50 a 150 (Padrão = 100)
# me_radius = O raio, em quadrados, da escala do ME (Padrão = 10)
# me_max_volume = O volume máximo do ME (Padrão = 100)
# me_frames = O número de frames enquanto toca o ME (Padrão = 20)
# me_frame_variance = A variação dos me_frames (Padrão = 0)
#
# EXEMPLO:
# Configure isso no comentário de um evento:
#
# \sndemit[se_name = 'Chicken']
# \SndEmit[se_max_volume = 80]
# \sNdeMit[se_frames = 440]
# \SNDEMIT[se_frame_variance = 60]
#
# E o evento irá tocar o efeito sonoro 'Chicken' com o volume máximo de 80,
# em uma escala de 10. Ele irá repetir esse SE entre 380 - 500 frames
#==============================================================================

#==============================================================================
# ** RPG::Area
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# new instance variables - se_frames, se_frame_variance, me_frames,
# me_frame_variance
# new methods - setup_sound_emissions, bgm, bgs, me, se, bgm?, bgs?, se?,
# me?, volume, update_se, update_me
#==============================================================================

class RPG::Area
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :sound_emission
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Setup Sound Emissions
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def setup_sound_emissions
s = @sound_emission = RPG::Sound_Emission.new
case @id
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# !*!*! REGIÃO CONFIGURÁVEL
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Configurar esta região desta maneira:
#
# when id_área
# s.parâmetro = valor
#
# Os parâmetros e possíveis valores são gravados no início.
# Você pode configurar quantos você desejar.
#
# EXEMPLO:
# when 1 # Cachoeira (Nesta demo)
# # BGS
# s.bgs_name = 'River'
# s.bgs_radius = 15
# s.bgs_max_volume = 110
#
# Isso irá fazer a Area de ID 1 emitir o BGS 'River' no volume máximo de
# 110 dentro de um raio de 15 quadrados
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
when 1 # Área 1
s.bgs_name = 'River' # Nome do BGS que irá emitir
s.bgs_radius = 15 # O raio em que o BGS será emitido
s.bgs_max_volume = 110 # O volume máximo do BGS
when 4 # Área 4
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# !*!*! FIM DA REGIÃO CONFIGURÁVEL
#////////////////////////////////////////////////////////////////////////
end
@sound_emission.rect = self.rect
@sound_emission.initialize_frame_counts
end
end

#==============================================================================
# ** RPG::Sound_Emission
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This class holds data relating to a sound emitting area
#==============================================================================

class RPG::Sound_Emission
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :rect
attr_accessor :bgs_name
attr_accessor :bgs_pitch
attr_accessor :bgs_radius
attr_accessor :bgs_max_volume
attr_accessor :bgm_name
attr_accessor :bgm_pitch
attr_accessor :bgm_radius
attr_accessor :bgm_max_volume
attr_accessor :se_name
attr_accessor :se_pitch
attr_accessor :se_radius
attr_accessor :se_max_volume
attr_accessor :se_frames
attr_accessor :se_frame_variance
attr_accessor :me_name
attr_accessor :me_pitch
attr_accessor :me_radius
attr_accessor :me_max_volume
attr_accessor :me_frames
attr_accessor :me_frame_variance
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Setup Sound Emissions
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize
# Set Default Values
@rect = Rect.new (0, 0, 0, 0)
# Default values
@bgs_name, @bgs_pitch, @bgs_radius, @bgs_max_volume, @bgm_name, @bgm_pitch,
@bgm_radius, @bgm_max_volume, @se_name, @se_pitch, @se_radius,
@se_max_volume, @me_name, @me_pitch, @me_radius, @me_max_volume,
@se_frames, @se_frame_variance, @me_frames, @me_frame_variance = '', 100,
10, 100, '', 100, 10, 100, '', 100, 10, 100 , '', 100, 10, 100, 20, 0, 20, 0
initialize_frame_counts
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Initialize Frame Counts
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize_frame_counts
@se_frame_count = @se_frames + rand (2*@se_frame_variance).floor - @se_frame_variance
@me_frame_count = @me_frames + rand (2*@me_frame_variance).floor - @me_frame_variance
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Sound
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def update
@stopped = false
bgm.play if @bgm_name != ''
bgs.play if @bgs_name != ''
update_se if @se_name != ''
update_me if @me_name != ''
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Stop Sound
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def stop
return if @stopped
RPG::BGM.stop if @bgm_name != ''
RPG::BGS.stop if @bgs_name != ''
@stopped = true
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * BGM
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def bgm
@bgm = RPG::BGM.new (@bgm_name, 0, @bgm_pitch) if @bgm == nil
@bgm.volume = volume (@bgm_radius, @bgm_max_volume)
return @bgm
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * BGS
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def bgs
@bgs = RPG::BGS.new (@bgs_name, 0, @bgs_pitch) if @bgs == nil
@bgs.volume = volume (@bgs_radius, @bgs_max_volume)
return @bgs
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * SE
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def se
@se = RPG::SE.new (@se_name, 0, @se_pitch) if @se == nil
@se.volume = volume (@se_radius, @se_max_volume)
return @se
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * SE Update
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def update_se
if @se_frame_count == 0
se.play
@se_frame_count = @se_frames + rand (2*@se_frame_variance).floor - @se_frame_variance
else
@se_frame_count -= 1
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * ME
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def me
@me = RPG::ME.new (@me_name, 0, @me_pitch) if @me == nil
@me.volume = volume (@me_radius, @me_max_volume)
return @me
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * ME Update
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def update_me
if @me_frame_count == 0
me.play
@me_frame_count = @me_frames + rand (2*@me_frame_variance).floor - @me_frame_variance
else
@me_frame_count -= 1
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Volume
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def volume (radius, max_volume)
x, y = $game_player.x, $game_player.y
# Determine distance between position and the sound emitting object
xd, yd = x - @rect.x, y - @rect.y
# Evaluate X distance
xd > 0 ? xd = x.between? (@rect.x, @rect.x + @rect.width) ? 0 : xd - @rect.width : xd *= -1
# Evaluate Y distance
yd > 0 ? yd = y.between? (@rect.y, @rect.y + @rect.height) ? 0 :yd - @rect.height : yd *= -1
# Calculate the total distance
total_distance = Math.sqrt(xd*xd + yd*yd).ceil.to_i
# Get the percentage of max volume
percent = (total_distance.to_f / radius.to_f)*100
percent = (100 - [percent, 100].min).to_f / 100.0
return (percent*max_volume.to_f).to_i
end
end

#==============================================================================
# ** Game_Event
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# aliased method - setup, update
#==============================================================================

class Game_Event
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Setup
# page : the new page
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias ma_sound_emit_obj_stp_event_pg_85nd setup
def setup (new_page)
# Run Original Method
ma_sound_emit_obj_stp_event_pg_85nd (new_page)
@sound_emission.stop unless @sound_emission.nil?
# If page is legitimate
unless @page == nil
s = @sound_emission = RPG::Sound_Emission.new
@sound_emission.rect = Rect.new (@x, @y, 1, 1)
# Evaluate comments
comments = []
@page.list.each { |i| i.code == 108 || i.code == 408 ? comments.push (i) : break }
# Evaluate comments for \SNDEMIT codes
comments.each { |i|
text = i.parameters[0].dup
while text.sub! (/\\SNDEMIT\[(.+)\]/i) { '' } != nil
eval ("@sound_emission." + $1.to_s)
end
}
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Frame Update
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_snd_emssn_script_upd_evnt_4n2 update
def update
# Run Original Event
modalg_snd_emssn_script_upd_evnt_4n2
@sound_emission.rect.x, @sound_emission.rect.y = @x, @y
@sound_emission.update
end
end

#==============================================================================
# ** Game_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# aliased method - update, setup
#==============================================================================

class Game_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Setup
# map_id : the ID of the map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_dynamic_snd_emit_stup_rn4 setup
def setup(map_id)
@areas.each { |area| area.sound_emission.stop } unless @areas.nil?
# Run Original Method
modalg_dynamic_snd_emit_stup_rn4 (map_id)
# Get all areas that belong to this map
@areas = []
$data_areas.values.each { |area| @areas.push (area) if map_id == area.map_id }
# Ensure Area Sound Effects are setup
@areas.each { |i| i.setup_sound_emissions if i.sound_emission == nil }
@advanced_areas = false
begin
# Test for exception thrown on .active?
$data_areas[1].active?
@advanced_areas = true
rescue
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_dyn_sound_emitting_objects_upd_4h3 update
def update
# Run Original Map
modalg_dyn_sound_emitting_objects_upd_4h3
# For all area
@areas.each { |area|
@advanced_areas && !area.active? ? area.sound_emission.stop : area.sound_emission.update
}
end
end


.Demo
http://www.4shared.com/file/67932400/9f9dfe33/demo_dinamicsoundareas.html%3Cbr%20/%3E.html

Compatibilidade

Deve ser compatível com qualquer coisa.

.Notas

Traduzido parcialmente por Bennamy :: Amy Productions.
E postado na Reino RPG também por Bennamy

.Créditos
Felyp Henrique dono do word.

ctor Battler Graphics - Battler do Char na Batalha


Actor Battler Graphics
Créditos: Felyp Henrique dono word.



É um script que faz o battler aparecer na batalha, ficando parecida com a normal do RMXP.
Vale a pena conferir!
Tamanho 272 Kb
script na demo.
Capturas de tela


Download

http://www.4shared.com/file/47643629/6e1cfea6/Actor_Battler_Graphics.html




Script de 2 play
Atenção galera tenho um script de 2 players para rmvx
Eis um script de 2 players tive ajuda...
Introdução
Esse script serve para criar um segundo jogador na tela, movimentado pelas teclas W, A, S e D respectivamente cima, esquerda, baixo e direita.

Instruções
Adicione o script no script adicionais.
scripts:

#================================================
# [VX] 2 Players Engine
#------------------------------------------------
# By Woratana [woratana@hotmail.com]
# Version: 1.1
# Date: 14/03/2008
#
# CREDITOS: Original XP Version by Hima
# EXTRA: Tradução Portugues: [c.o.e]Articos (Tradusi apenas o basico =D)
=begin

+[FEATURES]+
- Este script permitirá que você crie um 2 Player que você pode controlar,
interagir com outros eventos no mapa, igualmente como o Player Principal.

- O jogador pode interagir com acontecimentos no mapa.

- o 2º Jogador pode andar em 8 direções e correr (Shift).

+[Como Usar]+
Para Chamar o 2º Player, chame o Script:
$game_player2 = Game_Player2.new
$game_player2.create(x, y, actor id, follow?)

x e y = X e Y para saber onde o player vai aparecer (coordenadas)

actor id = Id do Heroi que você vai chamar (exemplo: "4" chamara a Sara)
(ID no Database)

follow? = true (Segir o player principal), false (não seguir o player)
*NÃO É RECOMENDADO COLOCAR TRUE*

Para deletar Player 2, use Chamar script:
$game_player2.delete

=end
#==============================================================================

class Game_Player2 < Game_Character #-------------------------------------------------------------------------- # START SETUP SCRIPT PART # * Constants: INPUT BUTTONS FOR Game_Player 2 #-------------------------------------------------------------------------- BAIXO = Input::Y # S in Keyboard ESQUERDA = Input::X # A in Keyboard DIREITA = Input::Z # D in Keyboard CIMA = Input::R # W in Keyboard ENTER = Input::L # Q in Keyboard CORRER = Input::A # Shift in Keyboard #-------------------------------------------------------------------------- # END SETUP SCRIPT PART #-------------------------------------------------------------------------- CENTER_X = (544 / 2 - 16) * 8 # Screen center X coordinate * 8 CENTER_Y = (416 / 2 - 16) * 8 # Screen center Y coordinate * 8 #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :vehicle_type # type of vehicle currenting being ridden attr_accessor :character_name #-------------------------------------------------------------------------- # * Create and Set Player 2 Location #-------------------------------------------------------------------------- def create(x,y,id,need_center = false) @actor_id = id moveto(x,y) @need_center = need_center refresh end #-------------------------------------------------------------------------- # * Clear Player 2 #-------------------------------------------------------------------------- def delete @actor_id = nil refresh $game_player2 = nil end #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super @vehicle_type = -1 @vehicle_getting_on = false # Boarding vehicle flag @vehicle_getting_off = false # Getting off vehicle flag @transferring = false # Player transfer flag @new_map_id = 0 # Destination map ID @new_x = 0 # Destination X coordinate @new_y = 0 # Destination Y coordinate @new_direction = 0 # Post-movement direction @walking_bgm = nil # For walking BGM memory end #-------------------------------------------------------------------------- # * Determine if Stopping #-------------------------------------------------------------------------- def stopping? return false if @vehicle_getting_on return false if @vehicle_getting_off return super end #-------------------------------------------------------------------------- # * Player Transfer Reservation # map_id : Map ID # x : x-coordinate # y : y coordinate # direction : post-movement direction #-------------------------------------------------------------------------- def reserve_transfer(map_id, x, y, direction) @transferring = true @new_map_id = map_id @new_x = x @new_y = y @new_direction = direction end #-------------------------------------------------------------------------- # * Determine if Player Transfer is Reserved #-------------------------------------------------------------------------- def transfer? return @transferring end #-------------------------------------------------------------------------- # * Execute Player Transfer #-------------------------------------------------------------------------- def perform_transfer return unless @transferring @transferring = false set_direction(@new_direction) if $game_map.map_id != @new_map_id $game_map.setup(@new_map_id) # Move to other map end moveto(@new_x, @new_y) end #-------------------------------------------------------------------------- # * Determine if Map is Passable # x : x-coordinate # y : y-coordinate #-------------------------------------------------------------------------- def map_passable?(x, y) case @vehicle_type when 0 # Boat return $game_map.boat_passable?(x, y) when 1 # Ship return $game_map.ship_passable?(x, y) when 2 # Airship return true else # Walking return $game_map.passable?(x, y) end end #-------------------------------------------------------------------------- # * Determine if Walking is Possible # x : x-coordinate # y : y-coordinate #-------------------------------------------------------------------------- def can_walk?(x, y) last_vehicle_type = @vehicle_type # Remove vehicle type @vehicle_type = -1 # Temporarily set to walking result = passable?(x, y) # Determine if passable @vehicle_type = last_vehicle_type # Restore vehicle type return result end #-------------------------------------------------------------------------- # * Determine if Airship can Land # x : x-coordinate # y : y-coordinate #-------------------------------------------------------------------------- def airship_land_ok?(x, y) unless $game_map.airship_land_ok?(x, y) return false # The tile passable attribute is unlandable end unless $game_map.events_xy(x, y).empty? return false # Cannot land where there is an event end return true # Can land end #-------------------------------------------------------------------------- # * Determine if Riding in Some Kind of Vehicle #-------------------------------------------------------------------------- def in_vehicle? return @vehicle_type >= 0
end
#--------------------------------------------------------------------------
# * Determine if Riding in Airship
#--------------------------------------------------------------------------
def in_airship?
return @vehicle_type == 2
end
#--------------------------------------------------------------------------
# * Determine if Dashing
#--------------------------------------------------------------------------
def dash?
return false if @move_route_forcing
return false if $game_map.disable_dash?
return false if in_vehicle?
return Input.press?(CORRER)
end
#--------------------------------------------------------------------------
# * Determine if Debug Pass-through State
#--------------------------------------------------------------------------
def debug_through?
return false unless $TEST
return Input.press?(Input::CTRL)
end
#--------------------------------------------------------------------------
# * Set Map Display Position to Center of Screen
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
def center(x, y)
display_x = x * 256 - CENTER_X # Calculate coordinates
unless $game_map.loop_horizontal? # No loop horizontally?
max_x = ($game_map.width - 17) * 256 # Calculate max value
display_x = [0, [display_x, max_x].min].max # Adjust coordinates
end
display_y = y * 256 - CENTER_Y # Calculate coordinates
unless $game_map.loop_vertical? # No loop vertically?
max_y = ($game_map.height - 13) * 256 # Calculate max value
display_y = [0, [display_y, max_y].min].max # Adjust coordinates
end
$game_map.set_display_pos(display_x, display_y) # Change map location
end
#--------------------------------------------------------------------------
# * Move to Designated Position
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
def moveto(x, y)
super
# center(x, y)
make_encounter_count # Initialize encounter
if in_vehicle? # Riding in vehicle
vehicle = $game_map.vehicles[@vehicle_type] # Get vehicle
vehicle.refresh # Refresh
end
end
#--------------------------------------------------------------------------
# * Increase Steps
#--------------------------------------------------------------------------
def increase_steps
super
return if @move_route_forcing
return if in_vehicle?
$game_party.increase_steps
$game_party.on_player_walk
end
#--------------------------------------------------------------------------
# * Get Encounter Count
#--------------------------------------------------------------------------
def encounter_count
return @encounter_count
end
#--------------------------------------------------------------------------
# * Make Encounter Count
#--------------------------------------------------------------------------
def make_encounter_count
if $game_map.map_id != 0
n = $game_map.encounter_step
@encounter_count = rand(n) + rand(n) + 1 # As if rolling 2 dice
end
end
#--------------------------------------------------------------------------
# * Determine if in Area
# area : Area data (RPG::Area)
#--------------------------------------------------------------------------
def in_area?(area)
return false if area == nil
return false if $game_map.map_id != area.map_id
return false if @x < area.rect.x return false if @y < area.rect.y return false if @x >= area.rect.x + area.rect.width
return false if @y >= area.rect.y + area.rect.height
return true
end
#--------------------------------------------------------------------------
# * Create Group ID for Troop Encountered
#--------------------------------------------------------------------------
def make_encounter_troop_id
encounter_list = $game_map.encounter_list.clone
for area in $data_areas.values
encounter_list += area.encounter_list if in_area?(area)
end
if encounter_list.empty?
make_encounter_count
return 0
end
return encounter_list[rand(encounter_list.size)]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if @actor_id != nil and $game_actors[@actor_id] != nil
actor = $game_actors[@actor_id] # Get front actor
@character_name = actor.character_name
@character_index = actor.character_index
else
@character_name = ""
end
end
#--------------------------------------------------------------------------
# * Determine if Same Position Event is Triggered
# triggers : Trigger array
#--------------------------------------------------------------------------
def check_event_trigger_here(triggers)
return false if $game_map.interpreter.running?
result = false
for event in $game_map.events_xy(@x, @y)
if triggers.include?(event.trigger) and event.priority_type != 1
event.start
result = true if event.starting
end
end
return result
end
#--------------------------------------------------------------------------
# * Determine if Front Event is Triggered
# triggers : Trigger array
#--------------------------------------------------------------------------
def check_event_trigger_there(triggers)
return false if $game_map.interpreter.running?
result = false
front_x = $game_map.x_with_direction(@x, @direction)
front_y = $game_map.y_with_direction(@y, @direction)
for event in $game_map.events_xy(front_x, front_y)
if triggers.include?(event.trigger) and event.priority_type == 1
event.start
result = true
end
end
if result == false and $game_map.counter?(front_x, front_y)
front_x = $game_map.x_with_direction(front_x, @direction)
front_y = $game_map.y_with_direction(front_y, @direction)
for event in $game_map.events_xy(front_x, front_y)
if triggers.include?(event.trigger) and event.priority_type == 1
event.start
result = true
end
end
end
return result
end
#--------------------------------------------------------------------------
# * Determine if Touch Event is Triggered
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
return false if $game_map.interpreter.running?
result = false
for event in $game_map.events_xy(x, y)
if [1,2].include?(event.trigger) and event.priority_type == 1
event.start
result = true
end
end
return result
end
#--------------------------------------------------------------------------
# * Processing of Movement via input from the Directional Buttons
#--------------------------------------------------------------------------
def move_by_input
return unless movable?
return if $game_map.interpreter.running?
if Input.press?(BAIXO)
move_down
end
if Input.press?(ESQUERDA)
move_left
end
if Input.press?(DIREITA)
move_right
end
if Input.press?(CIMA)
move_up
end
end
#--------------------------------------------------------------------------
# * Determine if Movement is Possible
#--------------------------------------------------------------------------
def movable?
return false if moving? # Moving
return false if @move_route_forcing # On forced move route
return false if @vehicle_getting_on # Boarding vehicle
return false if @vehicle_getting_off # Getting off vehicle
return false if $game_message.visible # Displaying a message
return false if in_airship? and not $game_map.airship.movable?
return true
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
last_real_x = @real_x
last_real_y = @real_y
last_moving = moving?
move_by_input
super
update_scroll(last_real_x, last_real_y) if @need_center
update_vehicle
update_nonmoving(last_moving)
end
#--------------------------------------------------------------------------
# * Update Scroll
#--------------------------------------------------------------------------
def update_scroll(last_real_x, last_real_y)
ax1 = $game_map.adjust_x(last_real_x)
ay1 = $game_map.adjust_y(last_real_y)
ax2 = $game_map.adjust_x(@real_x)
ay2 = $game_map.adjust_y(@real_y)
if ay2 > ay1 and ay2 > CENTER_Y
$game_map.scroll_down(ay2 - ay1)
end
if ax2 < ax1 and ax2 < CENTER_X $game_map.scroll_left(ax1 - ax2) end if ax2 > ax1 and ax2 > CENTER_X
$game_map.scroll_right(ax2 - ax1)
end
if ay2 < ay1 and ay2 < CENTER_Y $game_map.scroll_up(ay1 - ay2) end end #-------------------------------------------------------------------------- # * Update Vehicle #-------------------------------------------------------------------------- def update_vehicle return unless in_vehicle? vehicle = $game_map.vehicles[@vehicle_type] if @vehicle_getting_on # Boarding? if not moving? @direction = vehicle.direction # Change direction @move_speed = vehicle.speed # Change movement speed @vehicle_getting_on = false # Finish boarding operation @transparent = true # Transparency end elsif @vehicle_getting_off # Getting off? if not moving? and vehicle.altitude == 0 @vehicle_getting_off = false # Finish getting off operation @vehicle_type = -1 # Erase vehicle type @transparent = false # Remove transparency end else # Riding in vehicle vehicle.sync_with_player # Move at the same time as player end end #-------------------------------------------------------------------------- # * Processing when not moving # last_moving : Was it moving previously? #-------------------------------------------------------------------------- def update_nonmoving(last_moving) return if $game_map.interpreter.running? return if moving? return if check_touch_event if last_moving if not $game_message.visible and Input.trigger?(ENTER) return if get_on_off_vehicle return if check_action_event end update_encounter if last_moving end #-------------------------------------------------------------------------- # * Update Encounter #-------------------------------------------------------------------------- def update_encounter return if $TEST and Input.press?(Input::CTRL) # During test play? return if in_vehicle? # Riding in vehicle? if $game_map.bush?(@x, @y) # If in bush @encounter_count -= 2 # Reduce encounters by 2 else # If not in bush @encounter_count -= 1 # Reduce encounters by 1 end end #-------------------------------------------------------------------------- # * Determine Event Start Caused by Touch (overlap) #-------------------------------------------------------------------------- def check_touch_event return false if in_airship? return check_event_trigger_here([1,2]) end #-------------------------------------------------------------------------- # * Determine Event Start Caused by [OK] Button #-------------------------------------------------------------------------- def check_action_event return false if in_airship? return true if check_event_trigger_here([0]) return check_event_trigger_there([0,1,2]) end #-------------------------------------------------------------------------- # * Getting On and Off Vehicles #-------------------------------------------------------------------------- def get_on_off_vehicle return false unless movable? if in_vehicle? return get_off_vehicle else return get_on_vehicle end end #-------------------------------------------------------------------------- # * Board Vehicle # Assumes that the player is not currently in a vehicle. #-------------------------------------------------------------------------- def get_on_vehicle front_x = $game_map.x_with_direction(@x, @direction) front_y = $game_map.y_with_direction(@y, @direction) if $game_map.airship.pos?(@x, @y) # Is it overlapping with airship? get_on_airship return true elsif $game_map.ship.pos?(front_x, front_y) # Is there a ship in front? get_on_ship return true elsif $game_map.boat.pos?(front_x, front_y) # Is there a boat in front? get_on_boat return true end return false end #-------------------------------------------------------------------------- # * Board Boat #-------------------------------------------------------------------------- def get_on_boat @vehicle_getting_on = true # Boarding flag @vehicle_type = 0 # Set vehicle type force_move_forward # Move one step forward @walking_bgm = RPG::BGM::last # Memorize walking BGM $game_map.boat.get_on # Boarding processing end #-------------------------------------------------------------------------- # * Board Ship #-------------------------------------------------------------------------- def get_on_ship @vehicle_getting_on = true # Board @vehicle_type = 1 # Set vehicle type force_move_forward # Move one step forward @walking_bgm = RPG::BGM::last # Memorize walking BGM $game_map.ship.get_on # Boarding processing end #-------------------------------------------------------------------------- # * Board Airship #-------------------------------------------------------------------------- def get_on_airship @vehicle_getting_on = true # Start boarding operation @vehicle_type = 2 # Set vehicle type @through = true # Passage ON @walking_bgm = RPG::BGM::last # Memorize walking BGM $game_map.airship.get_on # Boarding processing end #-------------------------------------------------------------------------- # * Get Off Vehicle # Assumes that the player is currently riding in a vehicle. #-------------------------------------------------------------------------- def get_off_vehicle if in_airship? # Airship return unless airship_land_ok?(@x, @y) # Can't land? else # Boat/ship front_x = $game_map.x_with_direction(@x, @direction) front_y = $game_map.y_with_direction(@y, @direction) return unless can_walk?(front_x, front_y) # Can't touch land? end $game_map.vehicles[@vehicle_type].get_off # Get off processing if in_airship? # Airship @direction = 2 # Face down else # Boat/ship force_move_forward # Move one step forward @transparent = false # Remove transparency end @vehicle_getting_off = true # Start getting off operation @move_speed = 4 # Return move speed @through = false # Passage OFF @walking_bgm.play # Restore walking BGM make_encounter_count # Initialize encounter end #-------------------------------------------------------------------------- # * Force One Step Forward #-------------------------------------------------------------------------- def force_move_forward @through = true # Passage ON move_forward # Move one step forward @through = false # Passage OFF end end class Scene_Title < Scene_Base alias wor_twopla_scetit_cregam create_game_objects def create_game_objects wor_twopla_scetit_cregam $game_player2 = nil end end class Scene_Map < Scene_Base alias wor_twopla_scemap_upd update def update wor_twopla_scemap_upd $game_player2.update if $game_player2 != nil end end class Spriteset_Map alias wor_twopla_sprmap_crecha create_characters alias wor_twopla_sprmap_updcha update_characters def create_characters wor_twopla_sprmap_crecha @character_sprites.push(Sprite_Character.new(@viewport1, $game_player)) @chara_two_pushed = false end def update_characters if !(@chara_two_pushed) and $game_player2 != nil @character_sprites.push(Sprite_Character.new(@viewport1, $game_player2)) @chara_two_pushed = true elsif @chara_two_pushed and $game_player2 == nil for i in 0..@character_sprites.size if @character_sprites[i].character.is_a?(Game_Player2) @character_sprites[i].character.character_name = "" @character_sprites[i].update @character_sprites.delete_at(i) break end end @chara_two_pushed = false end wor_twopla_sprmap_updcha end end class Game_Map alias wor_twopla_gammap_passable passable? def passable?(x, y, flag = 0x01) if $game_player2 != nil and flag return false if $game_player2.x == x and $game_player2.y == y end wor_twopla_gammap_passable(x, y, flag) end end Esse script abaixo cole acima do Main. Para chamar o 2º Player, chame o script: [Selecionar]$game_player2 = Game_Player2.new $game_player2.create(x,y,actor ID,follow?) Sendo "x" e "y" as coordenadas dele no mapa, "actor ID" o ID do herói que você quer chamar e "follow?" coloque "true"(verdadeiro) ou "false"(falso) para seguir o Heroi principal Para deletar o 2º Player, chame o script: crie um evento va colocar script e coloque esse codigo abaixo: [Selecionar]$game_player2.delete Anti-Lag VX versão 1.2h Descrisão: Esse script serve para evitar lags como a lentidão do jogo quando voce põe muitos eventos em uma mapa ele foi testedo com 624 eventos no mapa! Script: #============================================================================== # A N T I L A G V X #------------------------------------------------------------------------------ # Author: Andrew McKellar (Anaryu) (anmckell@gmail.com) # # Version: 1.2h # # 1.2 March 5th 4:15pm EST: Implemented feedback from (Zeriab) and other ideas # for updating sprites/events that are off-screen/parallel also added # off-screen updating for events that are set with a specific move route. # 1.2a March 6th 5:09am EST: Changed on_screen to use Graphics module instead # of static values. (Zeriab) # 1.2b March 7th 12:36am EST: Changed Game_Player to use standard functions # instead of special ones. Changed empty array check to use proper empty? # 1.2c March 10th 10:13pm EST: Updated events that used a tile and a character # on multiple pages to be drawn as a sprite correctly. (eugene) # 1.2d March 14th 4:12am EST: Fixed errors with vehicles, passability, # and airship landing. # 1.2e March 18th 1:47am EST: Fixed errors with passability and tileset # graphics in multi-page events. # 1.2f June 9th 4:34pm EST: Fixed errors with diagonal movement having the # turn_ok setting passed in while the original functions didn't use it. # 1.2g June 20th 7:49pm EST: Fixed bugs regarding diagonal movement for # events (last update was just player!) and fixed bug with jump function # not updating location. # 1.2h September 20th 10:35am EST: Added a check so changing graphics on a blank # event from another event, or using Show Animation or Show Bubble will # activate the event automatically and set it to be in use. Also added two # new globals to allow you to choose how far off-screen updates will still # be performed (see below.) Also fixed efficiency loss by having several # math functions in the on_screen function (called constantly) and moved # those to initialize function instead. # 1.2i November 29th 6:14pm EST: Fixed issue with balloon use over non-event # characters. # 1.2j December 22nd 3:59am EST: Fixed issues when 'moveto' or Move Event # commands were used. # # This script modifies background functions, only other low-level or map # modification scripts should conflict. # # Please credit if used, no need to ask for permission for commercial use. #============================================================================== # If true this will allow the system to ignore all events that are off screen # unless you add "DOUPDATE" to their name. (DOUPDATE events will always update) # # If false this will means the system will ALWAYS update EVERY EVENT on the map # - this should only be used if you experience weird compatability issues due # to some custom scripts, it's better to try putting the DOUPDATE flag on events # that do special things or have special settings that don't work when this # flag is set to true. # # X_OFFSCREEN_SQUARES and Y_OFFSCREEN_SQUARES are how many squares in the X and Y # direction we should update events. Default of 1 means any event one square # off-screen will still be updated. The larger this value, the less efficiency # you will see from the anti-lag system, however it can be used to make large # events update instead of hang on screen. ALLOW_SCREEN_IGNORE = true X_OFFSCREEN_SQUARES = 1 Y_OFFSCREEN_SQUARES = 1 #============================================================================== # ** Game_Map #------------------------------------------------------------------------------ # This class handles maps. It includes scrolling and passage determination # functions. The instance of this class is referenced by $game_map. #============================================================================== class Game_Map #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :pmap attr_reader :emap attr_accessor :etilemap #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias :pre_antilag_setup :setup def setup(map_id) # Run normal initialize pre_antilag_setup(map_id) # Add events to emap @emap = {} for event in @events.values if not event.ignore_location loc = event.x.to_s + "_" + event.y.to_s @emap[loc] = [] if @emap[loc] == nil @emap[loc].push(event.id) end end # Create the passability map @pmap = Table.new($game_map.width, $game_map.height) for i in 0...$game_map.width for j in 0...$game_map.height passable?(i,j) ? pass = 1 : pass = 0 @pmap[i,j] = pass end end end #-------------------------------------------------------------------------- # * Clear Event location #-------------------------------------------------------------------------- def clear_event_loc(event) # Add the event into the @emap hash loc = event.x.to_s + "_" + event.y.to_s if @emap[loc] != nil @emap[loc].delete(event.id) # Clean up after ourselves @emap.delete(loc) if @emap[loc].empty? end end #-------------------------------------------------------------------------- # * Set Event location #-------------------------------------------------------------------------- def set_event_loc(event) # Add the event into the @emap hash loc = event.x.to_s + "_" + event.y.to_s @emap[loc] = [] if @emap[loc] == nil @emap[loc].push(event.id) end #-------------------------------------------------------------------------- # * Get array of event at designated coordinates # x : x-coordinate # y : y-coordinate #-------------------------------------------------------------------------- alias :pre_antilag_events_xy :events_xy def events_xy(x, y) # Grab the events from the hash loc = x.to_s + "_" + y.to_s event_ids = @emap[loc] # Use the IDs to build an array of events events = [] if event_ids != nil for id in event_ids if id == 0 events.push($game_player) else events.push(@events[id]) end end end # Return this array for the passability to use return events end #-------------------------------------------------------------------------- # * Determine if Passable # x : x coordinate # y : y coordinate # flag : The impassable bit to be looked up # (normally 0x01, only changed for vehicles) #-------------------------------------------------------------------------- alias :pre_antilag_passable? :passable? def passable?(x, y, flag = 0x01) for event in events_xy(x, y) # events with matching coordinates next if event.tile_id == 0 # graphics are not tiled next if event.priority_type > 0 # not [Below characters]
next if event.through # pass-through state
pass = @passages[event.tile_id] # get passable attribute
next if pass & 0x10 == 0x10 # *: Does not affect passage
return true if pass & flag == 0x00 # o: Passable
return false if pass & flag == flag # x: Impassable
end
for i in [2, 1, 0] # in order from on top of layer
tile_id = @map.data[x, y, i] # get tile ID
return false if tile_id == nil # failed to get tile: Impassable
pass = @passages[tile_id] # get passable attribute
next if pass & 0x10 == 0x10 # *: Does not affect passage
return true if pass & flag == 0x00 # o: Passable
return false if pass & flag == flag # x: Impassable
end
if @etilemap != nil
for i in [2, 1, 0] # in order from on top of layer
tile_id = @etilemap[x, y, i] # get tile ID
return false if tile_id == nil # failed to get tile: Impassable
pass = @passages[tile_id] # get passable attribute
next if pass & 0x10 == 0x10 # *: Does not affect passage
return true if pass & flag == 0x00 # o: Passable
return false if pass & flag == flag # x: Impassable
end
end
return false # Impassable
end
end

#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass of the
# Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :ignore_update
attr_reader :ignore_sprite
attr_reader :ignore_location
attr_reader :force_update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias :pre_antilag_initialize :initialize
def initialize
# Run normal initialize
pre_antilag_initialize
# Set our ignore flag based on our event name
@ignore_update = false
@ignore_sprite = false
@ignore_location = false
@force_update = false
@x_offscreen_value = (Graphics.width + (X_OFFSCREEN_SQUARES * 32)) * 8
@y_offscreen_value = (Graphics.height + (Y_OFFSCREEN_SQUARES * 32)) * 8
@x_offscreen_squares = X_OFFSCREEN_SQUARES * 32 * 8
@y_offscreen_squares = Y_OFFSCREEN_SQUARES * 32 * 8
end
#--------------------------------------------------------------------------
# * On Screen
#--------------------------------------------------------------------------
def on_screen
x_range = ((@real_x <= ($game_map.display_x + @x_offscreen_value)) and (@real_x >= ($game_map.display_x - @x_offscreen_squares)))
y_range = ((@real_y <= ($game_map.display_y + @y_offscreen_value)) and (@real_y >= ($game_map.display_y - @y_offscreen_squares)))
if x_range and y_range
return true
end
return false
end
#--------------------------------------------------------------------------
# * Jump
# x_plus : x-coordinate plus value
# y_plus : y-coordinate plus value
#--------------------------------------------------------------------------
alias :pre_antilag_jump :jump
def jump(x_plus, y_plus)
$game_map.clear_event_loc(self)
pre_antilag_jump(x_plus, y_plus)
$game_map.set_event_loc(self)
end
#--------------------------------------------------------------------------
# * Move to Designated Position
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
alias :pre_antilag_moveto :moveto
def moveto(x, y)
$game_map.clear_event_loc(self) if $game_map.emap != nil
pre_antilag_moveto(x, y)
$game_map.set_event_loc(self) if $game_map.emap != nil
end
#--------------------------------------------------------------------------
# * Clear anti-lag flags
#--------------------------------------------------------------------------
def clear_antilag_flags
# Turn all the ignore values to false for one reason or another
@ignore_sprite = false
@ignore_location = false
@ignore_update = false
end
end

#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
# This class deals with events. It handles functions including event page
# switching via condition determinants, and running parallel process events.
# It's used within the Game_Map class.
#==============================================================================

class Game_Event < Game_Character #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :id attr_reader :original_forced_update #-------------------------------------------------------------------------- # * Object Initialization # map_id : map ID # event : event (RPG::Event) #-------------------------------------------------------------------------- alias :pre_antilag_event_initialize :initialize def initialize(map_id, event) # Run normal initialize pre_antilag_event_initialize(map_id, event) # Set our ignore flag based on our event name decide_ignore @allow_screen_ignore = ALLOW_SCREEN_IGNORE end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- alias :pre_antilag_update :update def update # Only run update if @ignore_update is false if update? pre_antilag_update end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update? # Check our logic and return if we should update ignore = ((not @ignore_update) and (on_screen and @allow_screen_ignore)) return (@force_update or ignore or @move_route_forcing) end #-------------------------------------------------------------------------- # * Event page setup #-------------------------------------------------------------------------- alias :pre_antilag_setup :setup def setup(new_page) # Run normal setup pre_antilag_setup(new_page) # Set our forced flag if we're running as a parallel process now # if not, set it to our "default" set during the decide_ignore function if @trigger == 4 or @trigger == 3 @force_update = true else @force_update = @original_force_update end end #-------------------------------------------------------------------------- # * Move Type : Custom #-------------------------------------------------------------------------- alias :pre_antilag_move_type_custom :move_type_custom def move_type_custom # Ensure the sprite has been created if it's a blank event # with no code on itself but someone else set a graphic on it if @ignore_sprite command = @move_route.list[@move_route_index] # Get movement command case command.code when 41 # Change Graphic create_sprite if @ignore_sprite end end # Run the original move type custom command pre_antilag_move_type_custom end #-------------------------------------------------------------------------- # * Create Sprite # Create a sprite for this poor event if one hasn't been made #-------------------------------------------------------------------------- def create_sprite # Ensure ignore sprite value is set to false @ignore_sprite = false @ignore_location = false @ignore_update = false # Try to add a new sprite to the map if $scene.is_a?(Scene_Map) $scene.create_event_sprite(self) end end #-------------------------------------------------------------------------- # * Decide if Ignorable for Updates or Sprites #-------------------------------------------------------------------------- def decide_ignore # Not ignore by default @ignore_location = true @ignore_sprite = true @ignore_update = false @original_force_update = false # Decide if we should ignore ourselves or not if @event.name == "IGNORE" @ignore_update = true elsif @event.pages.size == 1 if @list != nil if @list.size == 1 if @character_name == "" or @tile_id != 0 @ignore_update = true end end end end # Check if we'll ever need a sprite tiles = [] for page in @event.pages # Check for single-tile events if page.graphic.tile_id != 0 tiles.push(page.graphic.tile_id) if not tiles.include?(page.graphic.tile_id) if page.priority_type == 2 or tiles.size > 1 or @event.pages.size > 1
@ignore_sprite = false
@ignore_location = false
end
end
# Check for character graphic instead
if page.graphic.character_name != ""
@ignore_sprite = false
@ignore_location = false
end
# Check all pages for code to run
if page.list.size > 1
for item in page.list
if item.code != 108
@ignore_location = false
end
end
end
end
# Check to see if we have any tiles and a no initial page
if @list == nil and tiles.size > 0
@ignore_sprite = false
@ignore_location = false
end
# Force tags
if @event.name.include?("DOSPRITE")
@ignore_sprite = false
end
if @event.name.include?("DOLOC")
@ignore_location = false
end
if @event.name.include?("DOUPDATE")
@ignore_update = false
@force_update = true
@original_force_update = true
end
end
#--------------------------------------------------------------------------
# * Move Functions
#--------------------------------------------------------------------------
alias :pre_antilag_move_down :move_down
def move_down(turn_ok = true)
$game_map.clear_event_loc(self)
pre_antilag_move_down(turn_ok)
$game_map.set_event_loc(self)
end
alias :pre_antilag_move_left :move_left
def move_left(turn_ok = true)
$game_map.clear_event_loc(self)
pre_antilag_move_left(turn_ok)
$game_map.set_event_loc(self)
end
alias :pre_antilag_move_right :move_right
def move_right(turn_ok = true)
$game_map.clear_event_loc(self)
pre_antilag_move_right(turn_ok)
$game_map.set_event_loc(self)
end
alias :pre_antilag_move_up :move_up
def move_up(turn_ok = true)
$game_map.clear_event_loc(self)
pre_antilag_move_up(turn_ok)
$game_map.set_event_loc(self)
end
alias :pre_antilag_move_lower_left :move_lower_left
def move_lower_left(turn_ok = true)
$game_map.clear_event_loc(self)
pre_antilag_move_lower_left
$game_map.set_event_loc(self)
end
alias :pre_antilag_move_upper_left :move_upper_left
def move_upper_left(turn_ok = true)
$game_map.clear_event_loc(self)
pre_antilag_move_upper_left
$game_map.set_event_loc(self)
end
alias :pre_antilag_move_lower_right :move_lower_right
def move_lower_right(turn_ok = true)
$game_map.clear_event_loc(self)
pre_antilag_move_lower_right
$game_map.set_event_loc(self)
end
alias :pre_antilag_move_upper_right :move_upper_right
def move_upper_right(turn_ok = true)
$game_map.clear_event_loc(self)
pre_antilag_move_upper_right
$game_map.set_event_loc(self)
end
end


#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles maps. It includes event starting determinants and map
# scrolling functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Priority Type #-------------------------------------------------------------------------- def priority_type return 1 end #-------------------------------------------------------------------------- # * Triggers #-------------------------------------------------------------------------- def trigger return -1 end #-------------------------------------------------------------------------- # * Triggers #-------------------------------------------------------------------------- def triggers return [] end #-------------------------------------------------------------------------- # * Triggers #-------------------------------------------------------------------------- def id return 0 end #-------------------------------------------------------------------------- # * Triggers #-------------------------------------------------------------------------- def tile_id return 0 end #-------------------------------------------------------------------------- # * Determine if Airship can Land # x : x-coordinate # y : y-coordinate #-------------------------------------------------------------------------- alias :pre_antilag_airship_land_ok? :airship_land_ok? def airship_land_ok?(x, y) unless $game_map.airship_land_ok?(x, y) return false # The tile passable attribute is unlandable end # Check all events to ensure only the player is there for event in $game_map.events_xy(x, y) if event != $game_player return false end end return true # Can land end #-------------------------------------------------------------------------- # * Move Functions #-------------------------------------------------------------------------- alias :pre_antilag_move_down :move_down def move_down(turn_ok = true) $game_map.clear_event_loc(self) pre_antilag_move_down(turn_ok) $game_map.set_event_loc(self) end alias :pre_antilag_move_left :move_left def move_left(turn_ok = true) $game_map.clear_event_loc(self) pre_antilag_move_left(turn_ok) $game_map.set_event_loc(self) end alias :pre_antilag_move_right :move_right def move_right(turn_ok = true) $game_map.clear_event_loc(self) pre_antilag_move_right(turn_ok) $game_map.set_event_loc(self) end alias :pre_antilag_move_up :move_up def move_up(turn_ok = true) $game_map.clear_event_loc(self) pre_antilag_move_up(turn_ok) $game_map.set_event_loc(self) end alias :pre_antilag_move_lower_left :move_lower_left def move_lower_left $game_map.clear_event_loc(self) pre_antilag_move_lower_left $game_map.set_event_loc(self) end alias :pre_antilag_move_upper_left :move_upper_left def move_upper_left $game_map.clear_event_loc(self) pre_antilag_move_upper_left $game_map.set_event_loc(self) end alias :pre_antilag_move_lower_right :move_lower_right def move_lower_right $game_map.clear_event_loc(self) pre_antilag_move_lower_right $game_map.set_event_loc(self) end alias :pre_antilag_move_upper_right :move_upper_right def move_upper_right $game_map.clear_event_loc(self) pre_antilag_move_upper_right $game_map.set_event_loc(self) end end #============================================================================== # ** Scene_Map #------------------------------------------------------------------------------ # This class performs the map screen processing. #============================================================================== class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # * Create Sprite # :event - The event to give to the spriteset to make a sprite for #-------------------------------------------------------------------------- def create_event_sprite(event) # Tell the spriteset to make the sprite for the event @spriteset.create_event_sprite(event) end end #============================================================================== # ** Spriteset_Map #------------------------------------------------------------------------------ # This class brings together map screen sprites, tilemaps, etc. It's used # within the Scene_Map class. #============================================================================== class Spriteset_Map #-------------------------------------------------------------------------- # * Create Character Sprite #-------------------------------------------------------------------------- alias :pre_antilag_create_characters :create_characters def create_characters @character_sprites = [] for i in $game_map.events.keys.sort unless $game_map.events[i].ignore_sprite sprite = Sprite_Character.new(@viewport1, $game_map.events[i]) @character_sprites.push(sprite) end end for vehicle in $game_map.vehicles sprite = Sprite_Character.new(@viewport1, vehicle) @character_sprites.push(sprite) end @character_sprites.push(Sprite_Character.new(@viewport1, $game_player)) end #-------------------------------------------------------------------------- # * Create Character Sprite #-------------------------------------------------------------------------- def create_event_sprite(event) # Check if we can find a sprite already created for the event found = false for sprite in @character_sprites found = true if sprite.character == event end # If we didn't find one create it if not found @character_sprites.push(Sprite_Character.new(@viewport1, event)) end end #-------------------------------------------------------------------------- # * Create Tilemap #-------------------------------------------------------------------------- alias :pre_antilag_create_tilemap :create_tilemap def create_tilemap # Normal tilemap creation pre_antilag_create_tilemap # Add the new tilemap! @etilemap = Tilemap.new(@viewport1) @etilemap.bitmaps[0] = Cache.system("TileA1") @etilemap.bitmaps[1] = Cache.system("TileA2") @etilemap.bitmaps[2] = Cache.system("TileA3") @etilemap.bitmaps[3] = Cache.system("TileA4") @etilemap.bitmaps[4] = Cache.system("TileA5") @etilemap.bitmaps[5] = Cache.system("TileB") @etilemap.bitmaps[6] = Cache.system("TileC") @etilemap.bitmaps[7] = Cache.system("TileD") @etilemap.bitmaps[8] = Cache.system("TileE") emap = Table.new($game_map.data.xsize, $game_map.data.ysize, 3) # Add only events that are not "above" character for event in $game_map.events.values if event.tile_id > 0 and event.priority_type < 2 and event.ignore_sprite emap[event.x, event.y, 1] = event.tile_id end end @etilemap.map_data = emap $game_map.etilemap = emap end #-------------------------------------------------------------------------- # * Dispose of Tilemap #-------------------------------------------------------------------------- alias :pre_antilag_dispose_tilemap :dispose_tilemap def dispose_tilemap # Normal dispose pre_antilag_dispose_tilemap # Dispose of new event tilemap @etilemap.dispose end #-------------------------------------------------------------------------- # * Update Tilemap #-------------------------------------------------------------------------- alias :pre_antilag_update_tilemap :update_tilemap def update_tilemap # Normal update pre_antilag_update_tilemap # Work with new event tilemap @etilemap.ox = $game_map.display_x / 8 @etilemap.oy = $game_map.display_y / 8 @etilemap.update end #-------------------------------------------------------------------------- # * Update Character Sprite #-------------------------------------------------------------------------- alias :pre_antilag_update_characters :update_characters def update_characters for sprite in @character_sprites sprite.update if sprite.character.on_screen end end end #============================================================================== # ** Game_Interpreter #------------------------------------------------------------------------------ # An interpreter for executing event commands. This class is used within the # Game_Map, Game_Troop, and Game_Event classes. #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # * Show Animation #-------------------------------------------------------------------------- alias :pre_antilag_command_212 :command_212 def command_212 character = get_character(@params[0]) if character != nil character.create_sprite if character.ignore_sprite character.clear_antilag_flags end pre_antilag_command_212 end #-------------------------------------------------------------------------- # * Show Balloon Icon #-------------------------------------------------------------------------- alias :pre_antilag_command_213 :command_213 def command_213 character = get_character(@params[0]) if character != nil character.create_sprite if character.ignore_sprite character.clear_antilag_flags end pre_antilag_command_213 end end Link para download da demo: http://anamei.net/files/AntiLag.zip ABS God of War sistema abs parecido com o 9. Feito por: ??? ainda não foi descobrido o genio. Maker Utilizado: RMVX |Versão: 1.32| Descrição: Um abs que lembra muito God of War. Funções: Cria armas com animações. Instruções Baixe o Script, sou mais download do que code. os scripts tem que ficar no mesmo lugar que mostra na demo pra quem não sabe Download: http://www.mediafire.com/?chgwq58pcjdmcm8 Crissaegrim ABS 2.0.5 Descrisão: Um ABS adorado por muitos.ainda mais por min é!!! Download: http://rapidshare.com/files/205674606/Crissaegrim_ABS_2.0.5_2.rar Instruções de Uso: Criando um Inimigo: Crie no mapa, um evento com os seguintes comentários: * Enemy ID (mude ID pelo id de um inimigo no database); * Die Erase: Apaga o evento inimigo apóes ele morrer; * Die Switch Local A: Ativa a Switch Local A o o inimigo morrer; * Die Switch Local B: Ativa a Switch Local B quando o inimigo morrer; * Die Switch Local C: Ativa a Switch Local C quando o inimigo morrer; * Die Switch Local D: Ativa a Switch Local D quando o inimigo morrer; * Die Switch X: Ativa a Switch X quando o inimigo morrer; * Die Variable X: Soma +1 à Variaável X quando o inimigo morrer; * Follow X (mude X pela distância da visao do inimigo, para ele seguir o herói automaticamente, se ele estiver dentro do seu campo de visao); * Kill Weapon ID (mude ID para o id de uma arma, assim o inimigo irá morrer, apenas se a arma determinada for usada contra ele); * Kill Skill ID (mude ID para o id de uma skill, assim o inimigo irá morrer, apenas se a skill determinada for usada contra ele); * Kill Item ID (mude ID para o ide de um item, assim o inimigo irá morrer, apenas se o item determinado for usado contra ele); Colocando o comentário Boss, a barra de HP do inimigo aparece no centro da tela. ___________________________________________________________________ Configurando o Script: Para mudar a tecla de ataque, procure no script esta linha: Right_Attack_Button = Input::Letters["A"] e mude "Letters["A"]" para a tecla que você quiser. Para mudar a tecla de ataque com a mão esquerda e a tecla do escudo, procure no script esta linha: Left_Attack_and_Shield_Button = Input::Letters["S"] e mude "Letters["A"]" para a tecla que você quiser. Para criar uma arma,skill ou itens com animação, copie: Animate_Weapons[X] = ["Y", Z] e mude X para o id da arma no database, o Y para o prefixo do nome do char atacando, e o Z para o Index do Char. Por exemplos: Animate_Weapons[0] = ["_Attacking", 0] Animate_Skills[0] = ["_Casting", 0] Animate_Items[0] = ["_UsingItem", 0] Para criar uma arma de distância, copie: Distance_Weapons = [T, U, V, W, X, Y, Z] e mude: S:ID da Arma, T:Char, U:Index do Char, V:Velocidade, W:Distância, X:Tempo de espera para atacar novamente, Y:Munição 1, Z:Munição 2. Por Exemplo: Distance_Weapons[4] = ["$Arrow", 0, 6, 5, 30, 21, 22] Para criar uma skill de distância, copie: Distance_Skills = [V, W, X, Y, Z] e mude: U:ID da skill, V:Char, W:Index do Char, X:Velocidade, Y:Distância, Z:Tempo de espera para atacar novamente. Por exemplo: Distance_Skills[59] = ["Energy Ball", 0, 4, 5, 60] Para criar um ítem de distância, copie: Distance_Items = [V, W, X, Y, Z] e mude: U:ID do item, V:Char, W:Index do Char, X:Velocidade, Y:Distância, Z:Tempo de espera para atacar novamente. Exemplo: Distance_Items[16] = ["Energy Ball", 0, 6, 5, 30] Para criar um escudo, copie: Shields[X] = ["Y", Z] e mude X para o id do escudo no database e Y para o prefixo do char usando o escudo, e Z para o index do char. Por Exemplo: Shields[16] = ["_Shield", 0] Para mudar as animações dos inimigos, copie Enemy_animations[X] = [Y,Z] e mude X para o ID do inimigo, e Y para o ID da animação quando ele morrer e Z para a animação do ataque do inimigo. Por Exemplo: Enemy_animations[2] = [13,0] Sistema de banco de dinheiro bom pra criar um jogo de empresas. Descrição: Esse script adiciona a opção de criar um banco para depositar e retirar dinheiro. Funções: .Depositar e retirar dinheiro. Instruções: Copie e cole o script acima do main. Para chamar crie um evento e digite o seguinte código na opção chamar scripts : $scene = Scene_Depository.new download da demo: http://www.4shared.com/file/104593840/12c658d0/Banco.html script: # -------------------------------------------------------------------------------------- # Script de Banco para RMVX hecho por RayRpg # tomando como base script de banco de KGC # para RMXP # para llamar script:$scene = Scene_Depository.new #-------------------------------------------------------------------------------------- class Window_DepositoryCommand < Window_Selectable # Nombre de los comandos DEPOSITORY_COMMAND = [ "Depositar", # depósito ouro "Retirar", # retirar ouro ] # Defina los comandos DEPOSITORY_HELP = [ "Depositar ", # Depositar oro "Retirar ", # Retirarlo ] end class Window_DepositoryGold < Window_Base # Numero de 0 maximos GOLD_DIGITS = 7 end class Scene_Depository DEPOSIT_GOLD = "Insira a quantidade que será depositada" WDEPOSIT_GOLD = "Insira a quantidade que será retirada" 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 #-------------------------------------------------------------------------- # Actulizacion #-------------------------------------------------------------------------- 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("0").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 possui:") self.contents.draw_text(0, 64, 608, 32, "Depósito:") 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, "Retirada:") @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 #-------------------------------------------------------------------------- # Actualizacion del 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 #------------------------------------------------------------------------- # Actualizacion del 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 #------------------------------------------------------------------------- # Actualizacion #-------------------------------------------------------------------------- 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

#------------------------------------------------------------------------
# Actualizacion
#--------------------------------------------------------------------------

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



Sistema de renicia batalha.
Introdução

Faz com que o personagem possa "re-batalhar" a batalha perdida.


Imagens



Como usar


•Ponha acima do main

•Edite no Battle_Retry Module

Script



#==========================================================================
# * Battle Retry
#==========================================================================
# by sandgolem
# Tradução by:NaRuToMaKeR
# www.reinorpg.com
# Versão 1 [VX]
# Janeiro 26th, 2008
#==========================================================================
# INSTRUÇÕES:
#
# 1- Ponha acima do main
# 2- Edite no Battle_Retry Module
#==========================================================================

#==========================================================================
# Battle_Retry Module
#==========================================================================

module GameBaker
BattleRetryCommands = ['Reiniciar Batalha','tela de Título'] # As frases que irão aparecer.
BattleRetryDisableSwitch = 0 #Switch que desativa o battle retry. 0 para nenhuma
end

#==========================================================================
# Game Interpreter
#==========================================================================

class Game_Interpreter
alias_method :gamebaker_battleretry_interp601, :command_601
def command_601
if $gamebaker_retrywon
@branch[@list[@index].indent] = 0
$gamebaker_retrywon = nil
end
return gamebaker_battleretry_interp601
end

alias_method :gamebaker_battleretry_interp602, :command_602
def command_602
if $gamebaker_retryescaped
@branch[@list[@index].indent] = 1
$gamebaker_retryescaped = nil
end
return gamebaker_battleretry_interp602
end
end

class Scene_File
def gamebaker_write_retrysave_data
file = File.open('Data/retry.gb', 'wb')
write_save_data(file)
file.close
end

def gamebaker_read_retrysave_data
file = File.open('Data/retry.gb', 'rb')
read_save_data(file)
file.close
end
end

class Scene_Battle
alias_method :gamebaker_battleretry_main, :main
def main
$gamebaker_retryescaped = nil
$gamebaker_retrywon = nil
if !$game_switches[GameBaker::BattleRetryDisableSwitch]
if !$gamebaker_battleretry_inbattle & !$game_troop.can_lose
$gamebaker_battleretry_inbattle = $game_troop
gamebaker_scene_save_temp = Scene_File.new(true,true,true)
gamebaker_scene_save_temp.gamebaker_write_retrysave_data
gamebaker_scene_save_temp = nil
end
end
gamebaker_battleretry_main
if !$scene.is_a?(Scene_Gameover)
File.delete('Data/retry.gb') if FileTest.exist?('Data/retry.gb')
$gamebaker_battleretry_inbattle = nil
end
end

alias_method :gamebaker_battleretry_battleend, :battle_end
def battle_end(result)
$gamebaker_retrywon = true if result == 0
$gamebaker_retryescaped = true if result == 1
gamebaker_battleretry_battleend(result)
end
end

class Scene_Gameover
alias_method :gamebaker_battleretry_gameovermain, :main
def main
if $gamebaker_battleretry_inbattle
$data_system.gameover_me.play
@sprite = Sprite.new
@sprite.bitmap = Cache.system("GameOver")
Graphics.transition(60)
@command_window = Window_Command.new(192,GameBaker::BattleRetryCommands)
@command_window.back_opacity = 160
@command_window.x = 260 - @command_window.width / 2
@command_window.y = 248
loop do
Graphics.update
Input.update
gamebaker_retry_update
break if $scene != self
end
@command_window.dispose
Graphics.freeze
@sprite.bitmap.dispose
@sprite.dispose
Graphics.transition(30)
Graphics.freeze
else
gamebaker_battleretry_gameovermain
end
end

def gamebaker_retry_update
@command_window.update
if Input.trigger?(Input::C)
case @command_window.index
when 0
$game_system.battle_bgm.play
gamebaker_scene_save_temp = Scene_File.new(true,true,true)
gamebaker_scene_save_temp.gamebaker_read_retrysave_data
gamebaker_scene_save_temp = nil
$game_troop = $gamebaker_battleretry_inbattle
$scene = Scene_Battle.new
when 1
File.delete('Data/retry.gb') if FileTest.exist?('Data/retry.gb')
$gamebaker_battleretry_inbattle = nil
$scene = Scene_Title.new
end
end
end
end


download:

não pressisa é uma mão no mamão .




O mais pedido compartibilida de xp para vx.

Descrição:

Fas com que elguns scripts do Xp peguem no VX.

instruções: no script.
Script:


#==========================================================================
# Script de compatiblidade (XP para VX)
#==========================================================================
# Criado por sandgolem & Solstice para gamebaker.com
# Versão 3 [VX]
# 9 de Março de 2008
#==========================================================================

module GameBaker
BattleCompatibilityType = 2
end


$DEBUG = $TEST

module Cache
def self.battleback(filename); Cache.system(filename); end
def self.fog(filename); Cache.system(filename); end
def self.gameover(filename); Cache.system(filename); end
def self.icon(filename); Cache.system(filename); end
def self.panorama(filename); Cache.parallax(filename); end
end

module RPG
class Armor
def guard_element_set; return @element_set; end
end

class System
def cursor_se; return @sounds[0]; end
def decision_se; return @sounds[1]; end
def cancel_se; return @sounds[2]; end
def buzzer_se; return @sounds[3]; end
def equip_se; return @sounds[4]; end
def shop_se; return @sounds[17]; end
def save_se; return @sounds[5]; end
def load_se; return @sounds[6]; end
def battle_start_se; return @sounds[7]; end
def escape_se; return @sounds[8]; end
def enemy_collapse_se; return @sounds[11]; end
def actor_collapse_se; return @sounds[13]; end
def windowskin_name; return 'Window'; end
end
end

class Game_Actor
def equip(type,id,test = false); change_equip_by_id(type,id,test); end
end

class Game_Battler
attr_accessor :animation_hit, :critical, :damage, :damage_pop

def current_action; return @action; end
def sp; return @mp; end
def sp=(num); mp = num; end
end

class Game_Character
attr_accessor :character_hue
end

class Game_Interpreter
def command_106; command_230; end
def command_207; command_212; end
def command_208; command_211; end
def command_209; command_205; end
end

class Game_Map
attr_accessor :autotile_names, :battleback_name, :priorities, :tileset_name
attr_accessor :fog_blend_type, :fog_hue, :fog_opacity, :fog_ox, :fog_oy,
:fog_name, :fog_sx, :fog_sy, :fog_tone, :fog_zoom
attr_accessor :panorama_hue, :terrain_tags

def panorama_name; return parallax_name; end
def panorama_name=(num); @parallax_name = num; end
end

class Game_Party
def actors; members; end
def gain_armor(id,num); gain_item($data_armors[id],num); end
def gain_weapon(id,num); gain_item($data_weapons[id],num); end

def gain_item(id,num,something = false)
id = $data_items[id] if id.is_a?(Integer)
gain_item(id,num,something)
end
end

class Game_Player
attr_accessor :transferring, :new_map_id, :new_x, :new_y, :new_direction
end

class Game_System
attr_accessor :magic_number, :message_frame

def battle_interpreter; return $game_troop.interpreter; end
def bgm_play(name); gamebaker_compatibility_sound(name,'RPG::BGM'); end
def bgs_play(name); gamebaker_compatibility_sound(name,'RPG::BGS',80); end
def map_interpreter; return $game_map.interpreter; end
def me_play(name); gamebaker_compatibility_sound(name,'RPG::ME'); end
def message_position; return $game_message.position; end
def message_position=(num); $game_message.position = num; end
def se_play(name); gamebaker_compatibility_sound(name,'RPG::SE',80); end

def gamebaker_compatibility_sound(name,type,vol = 100)
begin
name.play
rescue
pitch = 100
if name.is_a?(RPG::AudioFile)
vol = name.volume
pitch = name.pitch
name = name.name
end
temp = eval(type + '.new(name,' + vol.to_s + ',' + pitch.to_s + ')')
temp.play
end
end
end

class Game_Temp
attr_accessor :gamebaker_compat_gameover2, :battle_main_phase,
:transition_name, :transition_processing, :battleback_name

def gameover; return @gamebaker_compat_gameover2; end
def gameover=(num)
if num == true
if @in_battle
$scene.call_gameover
else
@next_scene = 'gameover'
end
return
end
@gamebaker_compat_gameover2 = nil
@next_scene = nil if @next_scene == 'gameover'
end

def gamebaker_compat_scenecall(num,name)
if num == true
@next_scene = name
elsif @next_scene == name
@next_scene = nil
end
end

def battle_calling; return @next_scene == 'battle'; end
def battle_calling=(num); gamebaker_compat_scenecall(num,'battle'); end
def debug_calling; return @next_scene == 'debug'; end
def debug_calling=(num); gamebaker_compat_scenecall(num,'debug'); end
def menu_calling; return @next_scene == 'menu'; end
def menu_calling=(num); gamebaker_compat_scenecall(num,'menu'); end
def name_calling; return @next_scene == 'name'; end
def name_calling=(num); gamebaker_compat_scenecall(num,'name'); end
def save_calling; return @next_scene == 'save'; end
def save_calling=(num); gamebaker_compat_scenecall(num,'save'); end
def shop_calling; return @next_scene == 'shop'; end
def shop_calling=(num); gamebaker_compat_scenecall(num,'shop'); end
def to_title; return @next_scene == 'title'; end
def to_title=(num); gamebaker_compat_scenecall(num,'title'); end

def battle_abort; return @next_scene == 'map'; end
def battle_abort=(num); $game_temp.next_scene = "map" if num == true; end
def battle_can_escape; return $game_troop.can_escape; end
def battle_can_escape=(num); $game_troop.can_escape = num; end
def battle_can_lose; return $game_troop.can_lose; end
def battle_can_lose=(num); $game_troop.can_lose = num; end
def battle_event_flags; return $game_troop.event_flags; end
def battle_event_flags=(num); $game_troop.event_flags = num; end
def battle_forcing_battler; return $game_troop.forcing_battler; end
def battle_forcing_battler=(num); $game_troop.forcing_battler = num; end
def battle_troop_id; return $game_troop.troop_id; end
def battle_troop_id=(num); $game_troop.gamebaker_compat_id = num; end
def battle_turn; return $game_troop.turn_count; end
def battle_turn=(num); $game_troop.turn_count = num; end

def choice_cancel_type; return $game_message.choice_cancel_type; end
def choice_cancel_type=(num); $game_message.choice_cancel_type = num; end
def choice_max; return $game_message.choice_max; end
def choice_max=(num); $game_message.choice_max = num; end
def choice_proc; return $game_message.choice_proc; end
def choice_proc=(num); $game_message.choice_proc = num; end
def choice_start; return $game_message.choice_start; end
def choice_start=(num); $game_message.choice_start = num; end
def message_proc; return $game_message.main_proc; end
def message_proc=(num); $game_message.main_proc = num; end
def message_text; return $game_message.texts.to_s; end
def message_text=(num); $game_message.texts = num.to_a; end
def message_window_showing; return $game_message.visible; end
def message_window_showing=(num); $game_message.visible = num; end
def num_input_digits_max; return $game_message.num_input_digits_max; end
def num_input_digits_max=(num); $game_message.num_input_digits_max = num; end
def num_input_variable_id; return $game_message.num_input_variable_id; end
def num_input_variable_id=(num); $game_message.num_input_variable_id = num; end

def player_new_direction; return $game_player.new_direction; end
def player_new_direction=(num); $game_player.new_direction = num; end
def player_new_map_id; return $game_player.new_map_id; end
def player_new_map_id=(num); $game_player.new_map_id = num; end
def player_new_x; return $game_player.new_x; end
def player_new_x=(num); $game_player.new_x = num; end
def player_new_y; return $game_player.new_y; end
def player_new_y=(num); $game_player.new_y = num; end
def player_transferring; return $game_player.transferring; end
def player_transferring=(num); $game_player.transferring = num; end
end

class Game_Troop
attr_accessor :event_flags, :gamebaker_compat_id, :troop_id, :turn_count

alias_method :gamebaker_compatibility_setup, :setup
def setup(troop_id)
if @gamebaker_compat_id
troop_id = @gamebaker_compat_id
@gamebaker_compat_id = nil
end
gamebaker_compatibility_setup(troop_id)
end
end

class Scene_Battle
alias_method :gamebaker_compatibility_gameoverjudge, :judge_win_loss
def judge_win_loss
if $game_temp.in_battle && $game_party.all_dead?
$game_temp.gamebaker_compat_gameover2 = true
else
$game_temp.gamebaker_compat_gameover2 = nil
end
return gamebaker_compatibility_gameoverjudge
end


def update_phase4_step3; end
def update_phase4_step4; end
def update_phase4_step5; end

alias_method :gamebaker_compatibility_dispaction, :display_action_effects
def display_action_effects(target, action = nil)
gamebaker_compatibility_dispaction(target, action)
update_phase4_step5
end

alias_method :gamebaker_compatibility_displayanim, :display_animation
def display_animation(targets, animation_id)
update_phase4_step3
gamebaker_compatibility_displayanim(targets, animation_id)
update_phase4_step4
end

if GameBaker::BattleCompatibilityType == 1

def end_actor_select; end_target_actor_selection; end
def end_enemy_select; end_target_enemy_selection; end
def end_item_select; end_item_selection; end
def end_skill_select; end_skill_selection; end
def judge; return judge_win_loss; end
def make_item_action_result; execute_action_item; end
def make_skill_action_result; execute_action_skill; end
def phase3_next_actor; next_actor; end
def phase3_prior_actor; prior_actor; end
def phase3_setup_command_window; start_actor_command_selection; end
def start_actor_select; start_target_actor_selection; end
def start_enemy_select; start_target_enemy_selection; end
def start_item_select; start_item_selection; end
def start_phase2; start_party_command_selection; end
def start_phase4; start_main; end
def start_phase5; process_victory; end
def start_skill_select; start_skill_selection; end
def update_phase2; update_party_command_selection; end
def update_phase2_escape; process_escape; end
def update_phase3; update_actor_command_selection; end
def update_phase3_actor_select; update_target_actor_selection; end
def update_phase3_basic_command; update_actor_command_selection; end
def update_phase3_enemy_select; update_target_enemy_selection; end
def update_phase3_item_select; update_item_selection; end
def update_phase3_skill_select; update_skill_selection; end
def update_phase4_step1; process_action; end
def update_phase4_step2; execute_action; end
def update_phase4_step6; process_action; end

elsif GameBaker::BattleCompatibilityType == 2

def end_actor_select; end
def end_enemy_select; end
def end_item_select; end
def end_skill_select; end
def make_item_action_result; end
def make_skill_action_result; end
def phase3_next_actor; end
def phase3_prior_actor; end
def phase3_setup_command_window; end
def start_actor_select; end
def start_enemy_select; end
def start_item_select; end
def start_phase2; end
def start_phase4; end
def start_phase5; end
def start_skill_select; end
def update_phase2; end
def update_phase2_escape; end
def update_phase3; end
def update_phase3_actor_select; end
def update_phase3_basic_command; end
def update_phase3_enemy_select; end
def update_phase3_item_select; end
def update_phase3_skill_select; end
def update_phase4_step1; end
def update_phase4_step2; end
def update_phase4_step6; end

alias_method :gamebaker_compatibility_endactor, :end_target_actor_selection
def end_target_actor_selection
gamebaker_compatibility_endactor
end_actor_select
end

alias_method :gamebaker_compatibility_endenemy, :end_target_enemy_selection
def end_target_enemy_selection
gamebaker_compatibility_endenemy
end_enemy_select
end

alias_method :gamebaker_compatibility_enditem, :end_item_selection
def end_item_selection
gamebaker_compatibility_enditem
end_item_select
end

alias_method :gamebaker_compatibility_endskill, :end_skill_selection
def end_skill_selection
gamebaker_compatibility_endskill
end_skill_select
end

alias_method :gamebaker_compatibility_judge, :judge_win_loss
def judge; return gamebaker_compatibility_judge; end
def judge_win_loss; return judge; end

alias_method :gamebaker_compatibility_execitem, :execute_action_item
def execute_action_item
gamebaker_compatibility_execitem
make_item_action_result
end

alias_method :gamebaker_compatibility_execskill, :execute_action_skill
def execute_action_skill
gamebaker_compatibility_execskill
make_skill_action_result
end

alias_method :gamebaker_compatibility_nextactor, :next_actor
def next_actor
gamebaker_compatibility_nextactor
phase3_next_actor
end

alias_method :gamebaker_compatibility_prioractor, :prior_actor
def prior_actor
gamebaker_compatibility_prioractor
phase3_prior_actor
end

alias_method :gamebaker_compatibility_startactorc, :start_actor_command_selection
def start_actor_command_selection
gamebaker_compatibility_startactorc
phase3_setup_command_window
end

alias_method :gamebaker_compatibility_startactor, :start_target_actor_selection
def start_target_actor_selection
gamebaker_compatibility_startactor
start_actor_select
end

alias_method :gamebaker_compatibility_startenemy, :start_target_enemy_selection
def start_target_enemy_selection
gamebaker_compatibility_startenemy
start_enemy_select
end

alias_method :gamebaker_compatibility_startitem, :start_item_selection
def start_item_selection
gamebaker_compatibility_startitem
start_item_select
end

alias_method :gamebaker_compatibility_startskill, :start_skill_selection
def start_skill_selection
gamebaker_compatibility_startskill
start_skill_select
end

alias_method :gamebaker_compatibility_startparty, :start_party_command_selection
def start_party_command_selection
gamebaker_compatibility_startparty
start_phase2
end

alias_method :gamebaker_compatibility_startmain, :start_main
def start_main
gamebaker_compatibility_startmain
start_phase4
end

alias_method :gamebaker_compatibility_procvictory, :process_victory
def process_victory
gamebaker_compatibility_procvictory
start_phase5
end

alias_method :gamebaker_compatibility_partycom, :update_party_command_selection
def update_party_command_selection
gamebaker_compatibility_partycom
update_phase2
end

alias_method :gamebaker_compatibility_procescape, :process_escape
def process_escape
gamebaker_compatibility_procescape
update_phase2_escape
end

alias_method :gamebaker_compatibility_procaction, :process_action
def process_action
update_phase4_step6
gamebaker_compatibility_procaction
update_phase4_step1
end

alias_method :gamebaker_compatibility_execaction, :execute_action
def execute_action
gamebaker_compatibility_execaction
update_phase4_step2
end

alias_method :gamebaker_compatibility_updactor, :update_actor_command_selection
def update_actor_command_selection
gamebaker_compatibility_updactor
update_phase3
update_phase3_basic_command
end

alias_method :gamebaker_compatibility_updtactor, :update_target_actor_selection
def update_target_actor_selection
gamebaker_compatibility_updtactor
update_phase3_actor_select
end

alias_method :gamebaker_compatibility_updenemy, :update_target_enemy_selection
def update_target_enemy_selection
gamebaker_compatibility_updenemy
update_phase3_enemy_select
end

alias_method :gamebaker_compatibility_upditem, :update_item_selection
def update_item_selection
gamebaker_compatibility_upditem
update_phase3_item_select
end

alias_method :gamebaker_compatibility_updskill, :update_skill_selection
def update_skill_selection
gamebaker_compatibility_updskill
update_phase3_skill_select
end

elsif GameBaker::BattleCompatibilityType == 3

def end_actor_select; gamebaker_compatibility_endactor; end
def end_enemy_select; gamebaker_compatibility_endenemy; end
def end_item_select; gamebaker_compatibility_enditem; end
def end_skill_select; gamebaker_compatibility_endskill; end
def make_item_action_result; gamebaker_compatibility_execitem; end
def make_skill_action_result; gamebaker_compatibility_execskill; end
def phase3_next_actor; gamebaker_compatibility_nextactor; end
def phase3_prior_actor; gamebaker_compatibility_prioractor; end
def phase3_setup_command_window; gamebaker_compatibility_startactorc; end
def start_actor_select; gamebaker_compatibility_startactor; end
def start_enemy_select; gamebaker_compatibility_startenemy; end
def start_item_select; gamebaker_compatibility_startitem; end
def start_phase2; gamebaker_compatibility_startparty; end
def start_phase4; gamebaker_compatibility_startmain; end
def start_phase5; gamebaker_compatibility_procvictory; end
def start_skill_select; gamebaker_compatibility_startskill; end
def update_phase2; gamebaker_compatibility_partycom; end
def update_phase2_escape; gamebaker_compatibility_procescape; end
def update_phase3; gamebaker_compatibility_updactor; end
def update_phase3_actor_select; gamebaker_compatibility_updtactor; end
def update_phase3_basic_command; end
def update_phase3_enemy_select; gamebaker_compatibility_updenemy; end
def update_phase3_item_select; gamebaker_compatibility_upditem; end
def update_phase3_skill_select; gamebaker_compatibility_updskill; end
def update_phase4_step1; gamebaker_compatibility_procaction; end
def update_phase4_step2; gamebaker_compatibility_execaction; end
def update_phase4_step6; end

alias_method :gamebaker_compatibility_endactor, :end_target_actor_selection
def end_target_actor_selection
end_actor_select
end

alias_method :gamebaker_compatibility_endenemy, :end_target_enemy_selection
def end_target_enemy_selection
end_enemy_select
end

alias_method :gamebaker_compatibility_enditem, :end_item_selection
def end_item_selection
end_item_select
end

alias_method :gamebaker_compatibility_endskill, :end_skill_selection
def end_skill_selection
end_skill_select
end

alias_method :gamebaker_compatibility_judge, :judge_win_loss
def judge; return gamebaker_compatibility_judge; end
def judge_win_loss; return judge; end

alias_method :gamebaker_compatibility_execitem, :execute_action_item
def execute_action_item
make_item_action_result
end

alias_method :gamebaker_compatibility_execskill, :execute_action_skill
def execute_action_skill
make_skill_action_result
end

alias_method :gamebaker_compatibility_nextactor, :next_actor
def next_actor
phase3_next_actor
end

alias_method :gamebaker_compatibility_prioractor, :prior_actor
def prior_actor
phase3_prior_actor
end

alias_method :gamebaker_compatibility_startactorc, :start_actor_command_selection
def start_actor_command_selection
phase3_setup_command_window
end

alias_method :gamebaker_compatibility_startactor, :start_target_actor_selection
def start_target_actor_selection
start_actor_select
end

alias_method :gamebaker_compatibility_startenemy, :start_target_enemy_selection
def start_target_enemy_selection
start_enemy_select
end

alias_method :gamebaker_compatibility_startitem, :start_item_selection
def start_item_selection
start_item_select
end

alias_method :gamebaker_compatibility_startskill, :start_skill_selection
def start_skill_selection
start_skill_select
end

alias_method :gamebaker_compatibility_startparty, :start_party_command_selection
def start_party_command_selection
start_phase2
end

alias_method :gamebaker_compatibility_startmain, :start_main
def start_main
start_phase4
end

alias_method :gamebaker_compatibility_procvictory, :process_victory
def process_victory
start_phase5
end

alias_method :gamebaker_compatibility_partycom, :update_party_command_selection
def update_party_command_selection
update_phase2
end

alias_method :gamebaker_compatibility_procescape, :process_escape
def process_escape
update_phase2_escape
end

alias_method :gamebaker_compatibility_procaction, :process_action
def process_action
update_phase4_step6
update_phase4_step1
end

alias_method :gamebaker_compatibility_execaction, :execute_action
def execute_action
update_phase4_step2
end

alias_method :gamebaker_compatibility_updactor, :update_actor_command_selection
def update_actor_command_selection
update_phase3
update_phase3_basic_command
end

alias_method :gamebaker_compatibility_updtactor, :update_target_actor_selection
def update_target_actor_selection
update_phase3_actor_select
end

alias_method :gamebaker_compatibility_updenemy, :update_target_enemy_selection
def update_target_enemy_selection
update_phase3_enemy_select
end

alias_method :gamebaker_compatibility_upditem, :update_item_selection
def update_item_selection
update_phase3_item_select
end

alias_method :gamebaker_compatibility_updskill, :update_skill_selection
def update_skill_selection
update_phase3_skill_select
end
end
end

class Scene_Equip
alias_method :gamebaker_compatibility_init, :initialize
def initialize
gamebaker_compatibility_init
@right_window = @equip_window
end
end

class Scene_Load
def initialize; $scene = Scene_File.new(false,true,false); end
end

class Scene_Save
def initialize; $scene = Scene_File.new(true,false,false); end
end

class Spriteset_Battle
attr_reader :viewport1, :viewport2
end

class Window_InputNumber < Window_NumberInput end class Window_Selectable attr_accessor :column_max, :item_max end creditos: felyp henrique dono do word. download: não pressisa. Game Filme creditos: nã reparen estou esquessendo de colocar creditos. felyp henrique dono do word Esse Script permite que você possa colocar Videos em seu game, acho que ele aceita apena extensões .AVI Mais informações no proprio Script! #========================================================= # # - Game_Film - # Rgss 1 & 2 #-------------------------------------------------------- # Por berka # baseado no de Corwin # Traduzido por Sephirot # #-------------------------------------------------------- # -> utilizaçao:
# -1-Crie uma pasta com nome de "Films" na pasta do seu projeto
# -2-Ponha seus videos na pasta
# -3-Para chamar o script em um evento use:
# $game_film = Game_Film.new("Test.avi")
# ou $game_film = Game_Film.new(""Test.avi" pos x, y pos, largura, altura)
# ou $game_film = Game_Film.new("Test.avi", pos x, pos y) ....etc....
#Lembrando que onde esta escrito "Test.avi" e o nome do video que você deseja ver!
#se o nome do video for "ABCD" deve fikar assim:
#$game_film = Game_Film.new("ABCD.avi")
#===========================================
class Game_Film

Volume = 500 #entre 0 et 1000

def initialize(film, x = 0, y= 0, w= 544, h= 416)
@x= x.to_s+" " #Posiçao Horizital
@y= y.to_s+" " #Posiçao Vertical
@w= w.to_s+" "#Largura
@h= h.to_s+" " #Altura
@nom = Dir.getwd()+"\\Films\\"+film # recherche de l'adresse de la video
@readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', '%w(p p p p l p)', 'l') #pour lire le fichier Game.ini
@film= Win32API.new('winmm','mciSendString','%w(p,p,l,l)','V') #gestion du media
@handle = Win32API.new('user32','FindWindowEx','%w(l,l,p,p)','L') #pour recuperer le handle de la fenetre
@message = Win32API.new('user32','SendMessage','%w(l,l,l,l)','V') #pour envoyer des infos
charge
end

def charge
jeu = "\0" * 256
@readini.call('Game','Title','',jeu,255,".\\Game.ini")#on lit le game.ini jusqu'au string Title, on inscrit le titre dans jeu
jeu.delete!("\0") #on enleve tous les \0 du string
@temp = @handle.call(0,0,nil,jeu).to_s #on recupere la fenetre
@film.call("open \""+@nom+"\" alias FILE style 1073741824 parent " + @temp.to_s,0,0,0) #on ouvre le media
@status = " " * 255
lecture
end

def lecture
pause = false
@film.call("put FILE window at "+@x+@y+@w+@h, @status,0,0) #on positionne la fenetre du media
@film.call("setaudio MediaFile volume to "+Volume.to_s, @status,0,0) #on regle le volume
@film.call("play FILE from 0",@status,0,0) #et on lit le media
loop do
sleep(0.1) #on raffraichit
@message.call(@temp.to_i,11,0,0) #on envoie l'info de lecture
Graphics.update #mise a jour graphique
@message.call(@temp.to_i,11,1,0) #on envoie l'info de lecture
Input.update #mise a jour des touches
@film.call("status FILE mode",@status,255,0) #on recupere l'etat du media
true_status = @status.unpack("aaaa") #que l'on insere dans un tableau
break if true_status == "stop".split(//) #sort de la boucle si en stop
if Input.trigger?(Input::B) #quitte si on presse X
Input.update
break
end
if Input.trigger?(Input::C) #pause si on presse Espace
Input.update
if pause == false
@film.call("pause FILE",@status,0,0)
pause = true
else
@film.call("play FILE",@status,0,0)
pause = false
end
end
end
@film.call("close FILE",0,0,0) #et on ferme le fichier
end
end
Presente pra você pscot de 132 script leia tudo logo abaixo
para colocar os scripts no lugar serto.
Descrição:
Contem 132 Scripts com diferentes funções!


Funções:
Sistemas de batalhas, HUD's, ADDON's e etc..

Instruções
Apenas baixe a demo e cole os scripts acima do main.

download deles:

http://www.4shared.com/file/gR2-X3P1/PScript__Kauzz.html

mais script no pacote outros scripts em breve.