Sign in to follow this  
Followers 0
KillerG

Anti-Lag Script

14 posts in this topic

Como el otro pero mas simple y segun lo q dice, hace q haya menos lag y no usa SDK ^^

Script:

En Game_Map en update method(def update) reemplazar estas lineas:
for event in @events.values
event.update
end
por:
CODE

for event in @events.values
     if in_range?(event) or event.trigger == 3 or event.trigger == 4
       event.update
     end
   end  

Al final de Game_Map agregar lo siguiente llamado "in_range"(def in_range)(asegurarse de agregar esto antes del ultimo def)

CODE
 #--------------------------------------------------------------------------
 # ● Check if events are in range (ANTI-LAG)
 #--------------------------------------------------------------------------
 def in_range?(object)
   
   diff_x = ($game_map.display_x - object.real_x).abs  # absolute value
   diff_y = ($game_map.display_x - object.real_x).abs  # absolute value
   
   width = 128 * 24   # size * tiles
   height = 128 * 19  # size * tiles
 
   return !((diff_x > width) or (diff_y > height))
   
 end  


Ahora ir a Spriteset_Map y cambiar lo siguiente:
for sprite in @character_sprites
sprite.update
end
Por:
CODE
   for sprite in @character_sprites
     if in_range?(sprite.character)
       sprite.update
     end
   end


Despues agregar lo siguiente al final de Spriteset_Map (asegurarse de agregar esto antes del ultimo def)
QUOTE
  #--------------------------------------------------------------------------
  # ● Check if events are in range (ANTI-LAG)
  #--------------------------------------------------------------------------
  def in_range?(object)
   
    diff_x = ($game_player.real_x - object.real_x).abs  # absolute value
    diff_y = ($game_player.real_y - object.real_y).abs  # absolute value
   
    width = 128 * 24  # size * tiles
    height = 128 * 19  # size * tiles
 
    return !((diff_x > width) or (diff_y > height))
   
  end


By:
lamchop
0

Share this post


Link to post
Share on other sites
me gustan los scripts que no requieren SDK! de rato calo este... pasara algo malo si pongo este y el de near fantastica en el mismo juego???
0

Share this post


Link to post
Share on other sites
solo prubalo y ya

si funciona mejor que le de Near Fantastica me dicen pa ponerlo xD.png
0

Share this post


Link to post
Share on other sites
Hmmm... hay que hacer mucha cosa pa' ponerlo. xD.png Me quedo con el de Near Fantastica. Pero buen aporte. icon13.gif
0

Share this post


Link to post
Share on other sites
Segun la creadora del script dice que tomo parte de los Script de Near y otro mas..
Dicen q es mejor..pero hay riesgo de que se ponga mal el script, lo q hace q el de Near sea mas facl
0

Share this post


Link to post
Share on other sites
Tengo una pequeñiiiiiiiisima duda: ¿Como es eso de ponerlo antes del ultimo def?, no entendi nada blink.gif

Saludos laugh.gif
0

Share this post


Link to post
Share on other sites
son demasiado cambios... asi que me dio flojera probarlo jaajjaa
0

Share this post


Link to post
Share on other sites
QUOTE(Goldknight @ Sep 23 2006, 02:36 AM)
Tengo una pequeñiiiiiiiisima duda: ¿Como es eso de ponerlo antes del ultimo def?, no entendi nada  blink.gif

Saludos laugh.gif
[right][snapback]5131[/snapback][/right]


En Spriteset_Map, Game_Map... hay varios 'def' seguidos del nombre del método. Ponlo antes del último de ellos. icon13.gif
0

Share this post


Link to post
Share on other sites
Ok, gracias Fegarur, con razon el script no hacia ningun efecto cheesy.gif

O sea que esto en Sprite_Map debe quedar asi:

CODE
   for sprite in @picture_sprites
     sprite.dispose
   end
   @timer_sprite.dispose
   @viewport1.dispose
   @viewport2.dispose
   @viewport3.dispose
 end
#--------------------------------------------------------------------------
# ● Check if events are in range (ANTI-LAG)
#--------------------------------------------------------------------------
 def in_range?(object)
 
   diff_x = ($game_player.real_x - object.real_x).abs  # absolute value
   diff_y = ($game_player.real_y - object.real_y).abs  # absolute value
 
   width = 128 * 24  # size * tiles
   height = 128 * 19  # size * tiles

   return !((diff_x > width) or (diff_y > height))
 
 end
 #--------------------------------------------------------------------------
 def update
   if @panorama_name != $game_map.panorama_name or
      @panorama_hue != $game_map.panorama_hue
     @panorama_name = $game_map.panorama_name
     @panorama_hue = $game_map.panorama_hue
     if @panorama.bitmap != nil
       @panorama.bitmap.dispose
       @panorama.bitmap = nil
     end
     if @panorama_name != ""
       @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)


Si hay algun error por favor notifiquenmelo laugh.gif, gracias de antemano laugh.gif

Saludos laugh.gif Edited by Goldknight
0

Share this post


Link to post
Share on other sites
Yo usé un script anti-event-lag pero lo tuve q sacar. Porq lo q en realidad hacía (no se si este funciona igual) era que los eventos que quedaban fuera de la pantalla no los cargue. Y en el Lowerland hice una especie de "sistema de carreras" y cuando te alejabas un poco de otro coche lo dejaba de cargar y entonces se quedaba quieto.
0

Share this post


Link to post
Share on other sites
pues la ultima version del anti lag del near fantastica a mi me funciono mejor.
0

Share this post


Link to post
Share on other sites
Esto de los anti-lag disculpen la suprema ignoransia pero tambien reduse el lagg creado por el exeso de cosas en un mapa por q en mi caso cuando creo un mapa de 30 x30 con muchos arboles y cosas asi saturando para q quede bien bonito mi mapa me da muchisimo lag al caminar y se detiene constantemente aveses hatsa me da error -.- y tengo 512 de ram dudo q sea por ello
0

Share this post


Link to post
Share on other sites
@necross: reduce el lag en mapas algo grandes que tienen muchos eventos, ya que lo que hace es dejar de actualizar ciertos eventos happy.gif

Y este script no se puede utilizar con el de Near, ya que es practicamente lo mismo. dry.gif
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0