RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Anti-Lag Script

0 Members and 1 Guest are viewing this topic.

****
Rep:
Level 89
========================================================
This script sole purpose is to kill any lag that may be generated by events on your maps. It works great and can only be used with SDK. ALL the credit is to given to Near Fantastica
========================================================

All you need to do to install this script is add a new command above main. Call it "Anti-Event Lag Script"

Code: [Select]

#==============================================================================
# ** Anti Event Lag Script
#==============================================================================
# Near Fantastica
# Version 3
# 29.11.05
#==============================================================================
# The Anti Event Lag Script reduces the Lag in RMXP cause by events dramatically
# It dose this by limiting process updating and graphic updating for events
# outside the view of the screen. Events that are parallel process or auto-start
# are not effected by this script.
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Anti Lag Script", "Near Fantastica", 3, "29.11.05")

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Anti Lag Script") == true
 
  #============================================================================
  # ** Game_Map
  #============================================================================
 
  class Game_Map
    #--------------------------------------------------------------------------
    def in_range?(object)
      screne_x = $game_map.display_x
      screne_x -= 256
      screne_y = $game_map.display_y
      screne_y -= 256
      screne_width = $game_map.display_x
      screne_width += 2816
      screne_height = $game_map.display_y
      screne_height += 2176
      return false if object.real_x <= screne_x
      return false if object.real_x >= screne_width
      return false if object.real_y <= screne_y
      return false if object.real_y >= screne_height
      return true
    end
    #--------------------------------------------------------------------------
    def update_events
      for event in @events.values
        if in_range?(event) or event.trigger == 3 or event.trigger == 4
          event.update
        end
      end
    end
  end
 
  #============================================================================
  # ** Spriteset_Map
  #============================================================================
 
  class Spriteset_Map
    #--------------------------------------------------------------------------
    def in_range?(object)
      screne_x = $game_map.display_x
      screne_x -= 256
      screne_y = $game_map.display_y
      screne_y -= 256
      screne_width = $game_map.display_x
      screne_width += 2816
      screne_height = $game_map.display_y
      screne_height += 2176
      return false if object.real_x <= screne_x
      return false if object.real_x >= screne_width
      return false if object.real_y <= screne_y
      return false if object.real_y >= screne_height
      return true
    end
    #--------------------------------------------------------------------------
    def update_character_sprites
      for sprite in @character_sprites
        if sprite.character.is_a?(Game_Event)
          if in_range?(sprite.character) or sprite.character.trigger == 3 or sprite.character.trigger == 4
            sprite.update
          end
        else
          sprite.update
        end
      end
    end
  end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end

**
Rep: +0/-0Level 89
didn't Near take away this script because of some bug issues that were found? Or did he finally fix it all up?  :?
Co-Webmaster of The Gaming Alliance

Thanks to TheRaven off of The Players Guild.
R.P.G. Fan Game Status
[--TLOZ: Fierce Entity--]|||||||||||||||||||| - 3%

****
Rep:
Level 89
Oh I didn't see this post. No he actually has it inserted with his Test bed now so I guess he just fixed the bugs in it. It works beautifully.  8)

********
Sailor Man
Rep:
Level 95
So about that money...
Neat. I may use that script eventually.