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

Script Anti-lag RPGMAKER VX

Ir para baixo

Script Anti-lag RPGMAKER VX Empty Script Anti-lag RPGMAKER VX

Mensagem  niks Qui Jan 08, 2009 11:00 pm

Nome do Sistema: Anti-Lag script.

Agradecimentos:

-Autor: Drizz
-Tradução: LegendsX
-Retirado de: ReinoRPG

Versão: Versão Beta (Porém funciona muito bem)

Descrição: Todos sabem o que é um anti-lag, se alguém não souber diga que eu explico.

Utilização: Copie e Insira acima do MAIN.

script:

Código:

#==========================================================================
# Anti-Lag script
#==========================================================================
# Criado por: Drizz
# Baseado no script de RMXP original de Near Fantastica's
# Versão Beta
# Tradução e Divulgação: LegendsX
#==========================================================================

module GameBaker
AntiLagDisable = 0
AntiLagModifierX = 408
AntiLagModifierWidth = 272
AntiLagModifierY = 272
AntiLagModifierHeight = 408
AntiLagNeverEvent = '@'
end

class Game_CommonEvent
alias gamebaker_antilag_commonrefresh refresh
def refresh
gamebaker_antilag_commonrefresh
#if self.trigger == 1
# gamebaker_antilag_add if $game_switches[common_event.switch_id]
# gamebaker_antilag_remove if !$game_switches[common_event.switch_id]
#else
gamebaker_antilag_add if @interpreter
gamebaker_antilag_remove if !@interpreter
#end
end

def gamebaker_antilag_remove
return if !$game_map.gb_antilagcommons.include?(@common_event_id)
$game_map.gb_antilagcommons -= [@common_event_id]
end

def gamebaker_antilag_add
return if $game_map.gb_antilagcommons.include?(@common_event_id)
$game_map.gb_antilagcommons += [@common_event_id]
end
end

class Game_Event
alias gamebaker_antilag_init initialize
def initialize(map_id, event)
gamebaker_antilag_init(map_id, event)
if event.name.include?(GameBaker::AntiLagNeverEvent)
$game_map.gb_antilagnever += [@id]
end
end

alias gamebaker_antilag_evsetup setup
def setup(new_page)
gamebaker_antilag_evsetup(new_page)
if @trigger == 3 or @trigger == 4
if !$game_map.gb_antilagevents.include?(@id)
$game_map.gb_antilagevents += [@id]
end
else
if $game_map.gb_antilagevents.include?(@id)
$game_map.gb_antilagevents -= [@id]
end
end
if @character_name == "" && @tile_id == 0
if !$game_map.gb_antilagnever2.include?(@id)
$game_map.gb_antilagnever2 += [@id]
end
else
if $game_map.gb_antilagnever2.include?(@id)
$game_map.gb_antilagnever2 -= [@id]
end
end
end
end

class Game_Map
attr_accessor :gb_antilagcommons, :gb_antilagevents,
:gb_antilagnever, :gb_antilagnever2

def gamebaker_antilag?(sg)
return false if sg.real_x < @gb_antilagscreen_x or
sg.real_x > @gb_antilagscreen_width or
sg.real_y < @gb_antilagscreen_y or
sg.real_y > @gb_antilagscreen_height
return true
end

def gamebaker_antilag2?(sg)
return @gb_antilagevents.include?(sg.id)
end

alias gamebaker_antilag_setupev setup_events
def setup_events
gamebaker_antilag_getscreen
@gb_antilagevents = []
@gb_antilagnever = []
@gb_antilagnever2 = []
@gb_antilagcommons = [] if !@gb_antilagcommons
gamebaker_antilag_setupev
end

def gamebaker_antilag_getscreen
@gb_antilagscreen_x = @display_x - GameBaker::AntiLagModifierX
@gb_antilagscreen_y = @display_y - GameBaker::AntiLagModifierY
@gb_antilagscreen_width =
@display_x + (Graphics.width * 8) + GameBaker::AntiLagModifierWidth
@gb_antilagscreen_height =
@display_y + (Graphics.height * 8) + GameBaker::AntiLagModifierHeight
end

alias gamebaker_antilag_ue update_events
def update_events
return gamebaker_antilag_ue if $game_switches[GameBaker::AntiLagDisable]
gamebaker_antilag_getscreen
if @gb_antilagnever != []
for i in @events.values
next if @gb_antilagnever.include?(i.id)
i.update if gamebaker_antilag?(i) or @gb_antilagevents.include?(i.id)
end
else
for i in @events.values
i.update if gamebaker_antilag?(i) or @gb_antilagevents.include?(i.id)
end
end
for i in 0...@gb_antilagcommons.size
@common_events[@gb_antilagcommons[i]].update
end
end
end

class Spriteset_Map
alias gamebaker_antilag_uc update_characters
def update_characters
return gamebaker_antilag_uc if $game_switches[GameBaker::AntiLagDisable]
sg = $game_map.gb_antilagnever2
for sprite in @character_sprites
next if sg.include?(sprite.character.id)
if $game_map.gamebaker_antilag?(sprite.character) or
$game_map.gamebaker_antilag2?(sprite.character)
sprite.update
end
end
end
end
Screen: Não perceptível via screen.

niks

Mensagens : 5
Data de inscrição : 07/01/2009

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

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