Quedada del ChatBox
Conectarse

Recuperar mi contraseña

Estadísticas
Tenemos 2162 miembros registrados.
El último usuario registrado es chichox.

Nuestros miembros han publicado un total de 37850 mensajes en 4923 argumentos.
Últimos temas
» No tienes photoshop? - PIXLR
por Leaser Hoy a las 6:11 pm

» Relato de Seytan
por mrhawi Hoy a las 5:46 pm

» Pequeño tilemap de Pokemon
por Wecoc Hoy a las 5:39 pm

» Vehiculos por agua
por orochii Hoy a las 5:30 pm

» Denme su opinión sobre este sprite
por mrhawi Hoy a las 5:13 pm

» Saludos gente
por orochii Hoy a las 4:43 pm

» CONCURSO DE TROFEOS (Nº2)
por EdénTheGame Hoy a las 4:40 pm

» script Titulo animado -Modificacion-
por Felipe_9595 Hoy a las 4:27 pm

» Galeria de Dibujos
por Wecoc Hoy a las 3:32 pm

» D.R.E.A.M.S [RPGXP] [DEMO 2.0!]
por ZeroTwilight Hoy a las 3:05 pm

Afiliados
Temas importantes
----------------------------------------
Páginas con recursos RPG Maker
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
Topic de screens
----------------------------------------
Navega con Firefox
[DESCARGA]

[RPGVX] Anti-event Lag

 :: RPG Maker :: Scripts

Ver el tema anterior Ver el tema siguiente Ir abajo

[RPGVX] Anti-event Lag

Mensaje por Khaizen el Jue Ago 27, 2009 4:16 pm

Bueno, aqui publico este script anti-lag para RPGVX, aunque no se si habra otro por ahi igual, por si acaso.........

Este script reduce el lag que se produce cuando hay demasiados eventos en un mismo mapa.

Autor: sandgolem
Version: 2.00
Plataforma: RPG Maker VX

SCRIPT

Código:

#==========================================================================
# ** GameBaker Anti-Event Lag
#==========================================================================
# by sandgolem
#  Concept based on Near Fantastica's original RMXP script
#
# Version 2 [VX] - beta still
# February 2nd, 2008
#==========================================================================

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

#==========================================================================
#
# To check for updates or find more scripts, visit:
#      http://www.gamebaker.com/rmvx/scripts/
# Our RMXP scripts: http://www.gamebaker.com/rmxp/scripts/
#
# This script is not exclusive to our site!
# Feel free to pass around as long as you leave the links here.
# A license is required for commercial use, see instructions below.
#
# Instructions: http://www.gamebaker.com/rmvx/scripts/e/anti-event-lag.php
# Discussion/Help: http://forums.gamebaker.com/showthread.php?t=1242
#
#==========================================================================

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

#==========================================================================
# End of file! You can find more of our scripts at http://www.gamebaker.com
#==========================================================================


INSTRUCCIONES

Crea una nueva sección arriba de MAIN y llámala Anti-Event Lag y copia el script en ella.

Saludos makeros!!! Khaizen.

Khaizen
Principiante
Principiante

0/3

Créditos 1455


Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba


 :: RPG Maker :: Scripts

Permiso de este foro:
No puedes responder a temas en este foro.