RPG maker VX


Unirse al foro, es rápido y fácil

RPG maker VX
RPG maker VX
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.
Últimos temas
» Script de menu
por maxi Jue 04 Dic 2014, 1:44 pm

» Ayuda intro animado!!!
por maxi Miér 03 Dic 2014, 9:41 pm

» ayuda con este engin
por maxi Miér 03 Dic 2014, 8:42 am

» Hud de Vida 100% Personalizable - Engine Sencillo! Sin Scripts :)
por davidaikago Jue 20 Nov 2014, 10:58 am

» Ultimate parallax control by:GDS [ace]
por arellano Miér 08 Oct 2014, 8:28 pm

» Script Touhou (animated) Map name (v1.4)
por davidaikago Miér 08 Oct 2014, 2:09 pm

» tutorial puerta nueva
por davidaikago Miér 08 Oct 2014, 9:08 am

» cámara de fotos
por davidaikago Miér 08 Oct 2014, 9:05 am

» Imperial Action System II Demo
por davidaikago Miér 08 Oct 2014, 8:47 am

» VE Batalla animada [ACE]
por FhierusIV Jue 18 Sep 2014, 10:57 am

» Nuevo Reglamento del Foro [Vigente desde Septiembre 2014]
por maxi Miér 17 Sep 2014, 8:37 am

» MOG|Animated Title
por Souta21 Mar 09 Sep 2014, 7:24 pm

» Tutorial Engine - Cambiar Character al Equipar Objeto
por maxi Lun 21 Jul 2014, 10:19 am

» Script de climas
por gambasoxd Sáb 19 Jul 2014, 8:58 am

» Script de contraseña(codigo) para abrir un cofre
por rpgame Jue 03 Jul 2014, 6:03 pm

¿Quién está en línea?
En total hay 1 usuario en línea: 0 Registrados, 0 Ocultos y 1 Invitado

Ninguno

[ Ver toda la lista ]


El record de usuarios en línea fue de 117 durante el Mar 09 Ago 2011, 3:39 pm

Antilag VX - RP Coders

2 participantes

Ir abajo

Antilag VX - RP Coders Empty Antilag VX - RP Coders

Mensaje por ClubIce Vie 01 Oct 2010, 2:56 pm

Antilag VX - RP Coders

Introducción:

Este script es tan basico que lo debe tener todo los juegos hechos con RPG Maker VX

Características: [/font]

  • Hace que el juego tarde menos en cargar.
  • Evita que el juego e vuelva lento, por haber muchos eventos en el Mapa.


Instalación:
Copiar y Pegar Sobre el Main

Instrucciones:
En la parte de arriba del Script, encotraran las opciones de personalizacion.

Compatibilidad:
Ninguna incompatibilidad Conocida.

Script:
Código:
###############################################################################
############################# PR Coders - AntiLag #############################
###############################################################################
#==============================================================================
# AntiLag del grupo PR Coders.
# Solamente copiar y usar
#==============================================================================

# Añade el script AntiLag a la base de datos de PR Coders
$PRCoders ||= {}
# Habilita o script, para desabilitar deixe false
$PRCoders["AntiLag"] = true

if $PRCoders["AntiLag"]

#==============================================================================
# AntiLag
#==============================================================================

module AntiLag
 
 SPC = Win32API.new("kernel32", "SetPriorityClass", "pi", "i")
 # ¿Ejecutar el juego en Prioridad Alta?
 @@high_priority = true
 # ¿Usar el AntiLag de eventos?
 @@event = true
 
 if @@high_priority
  SPC.call(-1, 0x80)
 else
  SPC.call(-1, 0x20)
 end
 @@cache = {}
 
 #--------------------------------------------------------------------------
 # ¿Prioridad Alta?
 #--------------------------------------------------------------------------
 
 def self.high_priority?
  return @@high_priority
 end
 
 #--------------------------------------------------------------------------
 # Prioridad Alta
 #--------------------------------------------------------------------------
 
 def self.high_priority
  return @@high_priority
 end
 
 #--------------------------------------------------------------------------
 # ¿AntiLag de Evento?
 #--------------------------------------------------------------------------
 
 def self.event?
  return @@event
 end
 
 #--------------------------------------------------------------------------
 # AntiLag de Evento
 #--------------------------------------------------------------------------
 
 def self.event
  return @@event
 end
 
 #--------------------------------------------------------------------------
 # AntiLag de Evento = (true / false)
 #--------------------------------------------------------------------------
 
 def self.event=(valor)
  if valor
    @@event = true
  else
    @@event = false
  end
 end
 
 #--------------------------------------------------------------------------
 # Prioridad Alta = (true / false)
 #--------------------------------------------------------------------------
 
 def self.high_priority=(valor)
  return if @@high_priority == valor
  if valor
    @@high_priority = true
    SPC.call(-1, 0x80)
    return
  end
  @@high_priority = false
  SPC.call(-1, 0x20)
 end
 
 #--------------------------------------------------------------------------
 # Largo de Bitmap
 #--------------------------------------------------------------------------
 
 def self.bitmap_width(character_name)
  if @@cache[character_name].nil?
    bitmap = Cache.character(character_name)
    sign = character_name[/^[\!\$]./]
    if sign != nil and sign.include?('$')
      cw = bitmap.width / 3
      ch = bitmap.height / 4
    else
      cw = bitmap.width / 12
      ch = bitmap.height / 8
    end
    @@cache[character_name] = [cw, ch]
  end
  return @@cache[character_name][0]
 end
 
 #--------------------------------------------------------------------------
 # Altura de Bitmap
 #--------------------------------------------------------------------------
 
 def self.bitmap_height(character_name)
  if @@cache[character_name].nil?
    bitmap = Cache.character(character_name)
    sign = character_name[/^[\!\$]./]
    if sign != nil and sign.include?('$')
      cw = bitmap.width / 3
      ch = bitmap.height / 4
    else
      cw = bitmap.width / 12
      ch = bitmap.height / 8
    end
    @@cache[character_name] = [cw, ch]
  end
  return @@cache[character_name][1]
 end
 
 
end

#==============================================================================
# Game_Character
#==============================================================================

class Game_Character
 
 #--------------------------------------------------------------------------
 # Verifica si está en pantalla (Coordenada X)?
 #--------------------------------------------------------------------------
 
 def in_screen_x?(add_x=0)
  ax = @x * 256
  min_ax = ax
  max_ax = ax
  if add_x > 0
    min_ax = ax - add_x / 2
    max_ax = ax + add_x / 2
  end
  if $game_map.loop_horizontal?
    if $game_map.display_x > ($game_map.width - 17) * 256
      w = ($game_map.width * 256)
      min_x = ($game_map.display_x - 2 * 256) % w
      max_x = ($game_map.display_x + 19 * 256) % w
      if max_x == 0
        max_x = w
      end
      if min_ax > min_x
        return true
      end
      if max_ax < max_x
        return true
      end
      return false
    end
  end
  return false if (min_ax < $game_map.display_x - 2 * 256)
  return false if (max_ax > $game_map.display_x + 19 * 256)
  return true
 end
 
 #--------------------------------------------------------------------------
 # Verifica si está en pantalla (Coordenada Y)?
 #--------------------------------------------------------------------------
 
 def in_screen_y?(add_y=0)
  ay = @y * 256
  min_ay = ay
  max_ay = ay
  if add_y > 0
    min_ay = ay - add_y
  end
  if $game_map.loop_vertical?
    if $game_map.display_y > ($game_map.height - 13) * 256
      h = ($game_map.height * 256)
      min_y = ($game_map.display_y - 2 * 256) % h
      max_y = ($game_map.display_y + 15 * 256) % h
      if max_y == 0
        max_y = h
      end
      if min_ay > min_y
        return true
      end
      if max_ay < max_y
        return true
      end
      return false
    end
  end
  return false if (min_ay < $game_map.display_y - 2 * 256)
  return false if (max_ay > $game_map.display_y + 15 * 256)
  return true
 end
 
 #--------------------------------------------------------------------------
 # ¿Está en pantalla?
 #--------------------------------------------------------------------------
 
 def in_screen?(add_x=0, add_y=0)
  return false unless in_screen_x?(add_x)
  return false unless in_screen_y?(add_y)
  return true
 end
 
 #--------------------------------------------------------------------------
 # Verifica si colisiona con algún evento
 #--------------------------------------------------------------------------
 
 def collide_with_screen_characters?(x, y)
  for event in $game_map.screen_events_xy(x, y)  # ??????????
    unless event.through                          # ???? OFF?
      return true if self.is_a?(Game_Event)      # ???????
      return true if event.priority_type == 1    # ????????
    end
  end
  if @priority_type == 1                          # ????????
    return true if $game_player.pos_nt?(x, y)    # ???????????
    return true if $game_map.boat.pos_nt?(x, y)  # ?????????
    return true if $game_map.ship.pos_nt?(x, y)  # ?????????
  end
  return false
 end
 
 #--------------------------------------------------------------------------
 # Verifica si es atravesable
 #--------------------------------------------------------------------------
 
 def passable?(x, y)
  x = $game_map.round_x(x)                   
  y = $game_map.round_y(y)                 
  return false unless $game_map.valid?(x, y)
  return true if @through or debug_through?
  return false unless map_passable?(x, y)
  if self.in_screen?
    return false if collide_with_screen_characters?(x, y)
  else
    return false if collide_with_characters?(x, y)
  end
  return true                                   
 end
 
end

#==============================================================================
# Game_Player
#==============================================================================

class Game_Player < Game_Character
 
 #--------------------------------------------------------------------------
 # Verifica si hay eventos en el héroe
 #--------------------------------------------------------------------------
 
 def check_event_trigger_here(triggers)
  return false if $game_map.interpreter.running?
  result = false
  for event in $game_map.screen_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
 
 #--------------------------------------------------------------------------
 # Verifica si hay eventon en frente del héroe
 #--------------------------------------------------------------------------
 
 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.screen_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.screen_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
 
 #--------------------------------------------------------------------------
 # Verifica si hay eventos en posición X, Y
 #--------------------------------------------------------------------------
 
 def check_event_trigger_touch(x, y)
  return false if $game_map.interpreter.running?
  result = false
  for event in $game_map.screen_events_xy(x, y)
    if [1,2].include?(event.trigger) and event.priority_type == 1
      event.start
      result = true
    end
  end
  return result
 end

end

#==============================================================================
# Game_Event
#==============================================================================

class Game_Event < Game_Character
 
 #--------------------------------------------------------------------------
 # alias
 #--------------------------------------------------------------------------
 
 alias pr_coders_antilag_game_event_setup setup
 
 #--------------------------------------------------------------------------
 # ¿En pantalla?
 #--------------------------------------------------------------------------
 
 def in_screen?(*args)
  return true if @antilag_always_update
  if @large_bitmap
    return super(AntiLag.bitmap_width(@character_name), AntiLag.bitmap_height(@character_name))
  end
  return super
 end
 
 #--------------------------------------------------------------------------
 # Define una nueva página de evento
 #--------------------------------------------------------------------------
 
 def setup(new_page)
  pr_coders_antilag_game_event_setup(new_page)
  @large_bitmap = false
  @antilag_always_update = false
  @antilag_always_update |= (not AntiLag.event?)
  @antilag_always_update |= [3, 4].include?(@trigger)
  return if @list.nil?
  for item in @list
    if item.code == 108 or item.code == 408
      case item.parameters[0].downcase
      when "always_update"
        @antilag_always_update |= true
      when "large_bitmap"
        @large_bitmap = true
      end
    end
  end
 end
 
end

#==============================================================================
# Game_Map
#==============================================================================

class Game_Map
 
 attr_reader :screen_events
 
 #--------------------------------------------------------------------------
 # alias
 #--------------------------------------------------------------------------
 
 alias pr_coders_antilag_game_map_setup_events setup_events
 
 #--------------------------------------------------------------------------
 # Crear los eventos
 #--------------------------------------------------------------------------
 
 def setup_events
  @screen_events = {}
  pr_coders_antilag_game_map_setup_events
 end
 
 #--------------------------------------------------------------------------
 # Verifica si es atravesable
 #--------------------------------------------------------------------------
 
 def passable?(x, y, flag = 0x01)
  for event in screen_events_xy(x, y)            # ???????????????
    next if event.tile_id == 0            # ??????????????
    next if event.priority_type > 0      # [???????] ????
    next if event.through                # ??????
    pass = @passages[event.tile_id]      # ???????
    next if pass & 0x10 == 0x10          # [?] : ????????
    return true if pass & flag == 0x00    # [?] : ???
    return false if pass & flag == flag  # [×] : ????
  end
  for i in [2, 1, 0]                      # ?????????????
    tile_id = @map.data[x, y, i]          # ??? ID ???
    return false if tile_id == nil        # ??? ID ???? : ????
    pass = @passages[tile_id]            # ???????
    next if pass & 0x10 == 0x10          # [?] : ????????
    return true if pass & flag == 0x00    # [?] : ???
    return false if pass & flag == flag  # [×] : ????
  end
  return false                            # ????
 end
 
 #--------------------------------------------------------------------------
 # Eventos en posición X e Y de la pantalla
 #--------------------------------------------------------------------------
 
 def screen_events_xy(x, y)
  result = []
  for event in @screen_events.values
    result.push(event) if event.pos?(x, y)
  end
  return result
 end
 
 #--------------------------------------------------------------------------
 # Actualiza los Eventos
 #--------------------------------------------------------------------------
 
 def update_events
  @screen_events.clear
  for k, event in @events
    next unless event.in_screen?
    @screen_events[k] = event
    event.update
  end
  for common_event in @common_events.values
    common_event.update
  end
 end
 
 #--------------------------------------------------------------------------
 # Actualiza los Vehículos
 #--------------------------------------------------------------------------
 
 def update_vehicles
  for vehicle in @vehicles
    next unless vehicle.in_screen?
    vehicle.update
  end
 end
 
end

#==============================================================================
# Spriteset_Map
#==============================================================================

class Spriteset_Map
 
 #--------------------------------------------------------------------------
 # Actualiza los Characters
 #--------------------------------------------------------------------------
 
 def update_characters
  for sprite in @character_sprites
    next if sprite.character.nil?
    next unless sprite.character.in_screen?
    sprite.update
  end
 end

end

end

Demo:
No es nesesario.

Créditos:
Autor: RP Coders.
Posteado originalmente por: [Tienes que estar registrado y conectado para ver este vínculo]
ClubIce
ClubIce
220
220

Masculino

Edad 27

Cantidad de envíos 253

Maker Cash 361

Reputación 38


Volver arriba Ir abajo

Antilag VX - RP Coders Empty Re: Antilag VX - RP Coders

Mensaje por Daniel46 Vie 01 Oct 2010, 3:26 pm

ohhh gracias por el codigo si aprendi bien como se dan puntos +1 :p
Daniel46
Daniel46
130
130

Masculino

Edad 26

Cantidad de envíos 215

Maker Cash 207

Reputación 9


Extras
Sobre mí:: Me gustan los rpg's y me encanta la saga de zelda :B

Volver arriba Ir abajo

Volver arriba

- Temas similares

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