Guest Access
Go to page : 1, 2
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
I put this together, it has parts form a bunch of other anti lag scripts and such, it does a good job at reducing lag, credit those who are in the header of the script.
- Spoiler:
- Code:
#===============================================================================
# ** AntiLag script
#-------------------------------------------------------------------------------
# Credits to: Zeriab, f0tz!baerchen, NearFantastica
#===============================================================================
# Settings:
#===============================================================================
module Anti_Lag
#-------------------------------------------------------------------------------
# Truns Anti lag on. Can be toggled by calling "$antilag.reduce_lag = VALUE".
REDUCE_LAG = true
# DEFAULT = true
#-------------------------------------------------------------------------------
# You can increase or decrease the buffer size by altering this value.
# The greater this value the greater area around the visible area is updated
# at the price of potential more lag.
# The lower this value the smaller area around the visible area is update
# with the potential of less lag.
# Can be changed in game by calling "$antilag.buffer_size = VALUE".
BUFFER_SIZE = 2
# DEFAULT = 2
#-------------------------------------------------------------------------------
# Specifies how many tiles there are vertical
# I included the option to change this value if you want to alter
# the size of the game window.
# If you for example want 800x600 I suggest changing this value to 20
TILES_VERTICAL = 15
# DEFAULT = 15
#-------------------------------------------------------------------------------
# Specifies how many tiles there are horizontal
# I included the option to change this value if you want to alter
# the size of the game window.
# If you for example want 800x600 I suggest changing this value to 27
TILES_HORIZONTAL = 20
# DEFAULT = 20
#-------------------------------------------------------------------------------
# You can see this to false if you want all common events updated.
# This constant only has an effect during the upstart of the program. Changing
# it during the game will have no effect.
# If it is set to false you can safely ignore the following three constants
LIMIT_COMMON_EVENTS = false
# DEFAULT = true
#-------------------------------------------------------------------------------
# Specifies whether you want to enter which common events should be updated
# manually. If this is set to false you can safely ignore
# COMMON_EVENTS_TO_UPDATE while COMMON_EVENT_FILEPATH is of importance.
# Vice-versa is COMMON_EVENTS_TO_UPDATE important and COMMON_EVENT_FILEPATH
# safe to ignore if SPECIFY_COMMON_EVENTS_MANUALLY is set to true.
# If this is set to false which common events to update will be atomatically
# detected.
# As a general rule of thumb: Only change this to true if you have problems
# with the automatic detection or you want to prevent certain common events
# with autorun or parallel process as trigger.
SPECIFY_COMMON_EVENTS_MANUALLY = false
# DEFAULT = false
#-------------------------------------------------------------------------------
# This constant is an array of common event ids. Only the common events with
# the ids specified in the array will be updated. The ids are the numbers
# shown in the database with any leading 0s removed. In general only common
# events which have autorun or parallel process needs to be updated.
# It will have no effect if SPECIFY_COMMON_EVENTS_MANUALLY is false
# Let's say we want the common events 005, 009 and 020 to be updated. First we
# will remove the leading 0s and get 5, 9 and 20. Next we will put them in the
# array and get as end result:
#
# COMMON_EVENTS_TO_UPDATE = [5, 9, 20]
#
# If we had put [005, 009, 020] as the array we would have gotten an error
# when starting the game.
# If we now want to update common event 045 we would add 45 to the array:
#
# COMMON_EVENTS_TO_UPDATE = [5, 9, 20, 45]
COMMON_EVENTS_TO_UPDATE = []
#-------------------------------------------------------------------------------
# Specifies the relative file path (To the directory of where the Game.exe is)
# to where the common events are stored.
# Only change this if you have changed the name or place of the
# CommonEvents.rxdata file.
# It will have no effect if SPECIFY_COMMON_EVENTS_MANUALLY is true
COMMON_EVENT_FILEPATH = 'Data/CommonEvents.rxdata'
# DEFAULT = 'Data/CommonEvents.rxdata'
#-------------------------------------------------------------------------------
# This constant contains a hash where you can specify how specific events
# should be updated. Special update ids has priority over name patterns.
# The keys are all a 2-elements array. [Map_ID, Event_ID]
# The value is either an 'A' for always update or 'N' for never update.
# Here is an example:
#
# SPECIAL_UPDATE_IDS = {[1,1]=>'A',
# [1,2]=>'N'}
#
# Notice the first line [1,1]=>'A'
# It means that the event with id 1 on map 1 will always be updated.
#
# Notice the first line [1,2]=>'N'
# It means that the event with id 2 on map 1 will never be updated.
# Let's say we wanted the event with id 5 on map 3 to always be updated.
# This can be achieved by adding [5,3]=>'A' to the hash:
#
# SPECIAL_UPDATE_IDS = {[1,1]=>'A',
# [1,2]=>'N',
# [5,3]=>'A'}
SPECIAL_UPDATE_IDS = {}
#-------------------------------------------------------------------------------
# Here you can specify any number of patterns which will be checked when a
# new map is loaded. Any events which matches at least one of the patterns
# given here will never be updated.
# A pattern is assumed to be either a String or a RegExp. In the case of a
# String name.include?(string) is used. Otherwise the =~ operator is used
# Note: The never_update feature has higher priority than the always_update.
# If an event's name matches both a always update pattern and a never_update
# pattern it will never update.
NEVER_UPDATE_NAME_PATTERNS = ['[N]'] # [N] in the event name => not updated
#-------------------------------------------------------------------------------
# Here you can specify any number of patterns which will be checked when a
# new map is loaded. Any events which matches at least one of the patterns
# given here will always be updated.
# Note: The always_update feature has lower priority than the never_update.
# If an event's name matches both a always update pattern and a never_update
# pattern it will never update.
ALWAYS_UPDATE_NAME_PATTERNS = ['[A]'] # [A] in the event name => always updated
#-------------------------------------------------------------------------------
end
#===============================================================================
# ** Antilag_Settings by f0tz!baerchen
#===============================================================================
class Antilag_Settings
attr_accessor :reduce_lag
attr_accessor :buffer_size
#-----------------------------------------------------------------------------
# initializes default settings
#-----------------------------------------------------------------------------
def initialize
@reduce_lag = Anti_Lag::REDUCE_LAG
@buffer_size = Anti_Lag::BUFFER_SIZE
@SetPriorityClass = Win32API.new('kernel32','SetPriorityClass',['p', 'i'], 'i')
@SetPriorityClass.call(-1, 0x00000080) # High Priority
end
end
#==============================================================================
# Creates the Antilag_Settings object
#==============================================================================
class Scene_Title
$antilag = Antilag_Settings.new
end
#==============================================================================
# ** Game_Event by Zeriab
#==============================================================================
class Game_Event
# The method to alias and overwrite
AX = [:jump, :moveto, :move_down, :move_left, :move_right, :move_up,
:move_lower_left, :move_lower_right, :move_upper_left, :move_upper_right]
for method in AX
# Aliases the old method
new_method_as_string = 'zeriab_antilag_gmtev_' + method.to_s
new_method = new_method_as_string
alias_method(new_method, method)
# Overwrites the old method
PROG = <<FIN
def #{method}(*args)
old_x = @x
old_y = @y
#{new_method}(*args)
unless old_x == @x && old_y == @y
$game_map.move_event(old_x, old_y, self)
end
end
FIN
# Evaluates the method definition
eval(PROG)
end
#--------------------------------------------------------------------------
# * Always_update property (is false by default) priority under never_update
#--------------------------------------------------------------------------
attr_writer :always_update
def always_update
@always_update = false if @always_update.nil?
return @always_update
end
#--------------------------------------------------------------------------
# * Never_update property (is false by default) priority over always_update
#--------------------------------------------------------------------------
attr_writer :never_update
def never_update
@never_update = false if @never_update.nil?
return @never_update
end
#--------------------------------------------------------------------------
# * Need Update method. Fast checks here.
#--------------------------------------------------------------------------
def need_update?
return false if never_update
return true if always_update
return true if @id > 999
return true if @trigger == 3 || @trigger == 4
#return true if @move_type == 3
return true if $game_map.visible?(x, y)
return false
end
#--------------------------------------------------------------------------
# * Checks how the event should be updated.
#--------------------------------------------------------------------------
def check_update
name = @event.name
# Checks if the event is never to be updated. (For decoration)
for pattern in Anti_Lag::NEVER_UPDATE_NAME_PATTERNS
if (pattern.is_a?(String) && name.include?(pattern)) ||
!(pattern =~ name).nil?
self.never_update = true
end
end
# Checks if the event is to be always updated.
for pattern in Anti_Lag::ALWAYS_UPDATE_NAME_PATTERNS
if (pattern.is_a?(String) && name.include?(pattern)) ||
!(pattern =~ name).nil?
self.always_update = true
end
end
# Checks for special update for the particular id (overrules the patterns)
special_update = Anti_Lag::SPECIAL_UPDATE_IDS[[@map_id,@id]]
unless special_update.nil?
# Checks if it never should be updated
if special_update.downcase == 'n'
self.never_update = true
self.always_update = false
# Checks if it always should be updated
elsif special_update.downcase == 'a'
self.always_update = true
self.never_update = false
end
end
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias antilag_event_update update
def update
return if !need_update?
antilag_event_update
end
end
#==============================================================================
# ** Game_Character by Zeriab
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Determine if Passable (Overwrite)
# x : x-coordinate
# y : y-coordinate
# d : direction (0,2,4,6,8)
# * 0 = Determines if all directions are impassable (for jumping)
#--------------------------------------------------------------------------
def passable?(x, y, d)
# Get new coordinates
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
# If coordinates are outside of map
unless $game_map.valid?(new_x, new_y)
# impassable
return false
end
# If through is ON
if @through
# passable
return true
end
# If unable to leave first move tile in designated direction
unless $game_map.passable?(x, y, d, self)
# impassable
return false
end
# If unable to enter move tile in designated direction
unless $game_map.passable?(new_x, new_y, 10 - d)
# impassable
return false
end
# If player coordinates are consistent with move destination
if $game_player.x == new_x and $game_player.y == new_y
# If through is OFF
unless $game_player.through
# If your own graphic is the character
if @character_name != ""
# impassable
return false
end
end
end
# Checks for events on the new position
events = $game_map.event_map[[new_x,new_y]]
if events.nil?
# passable
return true
end
# Loop all events on the tile
for event in events
# If event coordinates are consistent with move destination
if event.x == new_x and event.y == new_y
# If through is OFF
unless event.through
# If self is event
if self != $game_player
# impassable
return false
end
# With self as the player and partner graphic as character
if event.character_name != ""
# impassable
return false
end
end
end
end
# passable
return true
end
#--------------------------------------------------------------------------
# * Checks if the character is visible.
#--------------------------------------------------------------------------
def in_range?
min_x = $game_map.display_x / 128
min_y = $game_map.display_y / 128
screen_x = Anti_Lag::TILES_HORIZONTAL
screen_y = Anti_Lag::TILES_VERTICAL
buffer = $antilag.buffer_size
if @x >= min_x - buffer && @x <= min_x + buffer + screen_x &&
@y >= min_y - buffer && @y <= min_y + buffer + screen_y
return true
end
return false
end
end
#==============================================================================
# ** Game_Player
#==============================================================================
class Game_Player
#--------------------------------------------------------------------------
# * Same Position Starting Determinant
#--------------------------------------------------------------------------
def check_event_trigger_here(triggers)
result = false
# If event is running
if $game_system.map_interpreter.running?
return result
end
# Retrives the events on the specified tile
events = $game_map.event_map[[@x,@y]]
unless events.nil?
# Loop through events on tile
for event in events
# If event triggers are consistent
if triggers.include?(event.trigger)
# If starting determinant is same position event (other than jumping)
if not event.jumping? and event.over_trigger?
event.start
result = true
end
end
end
end
return result
end
#--------------------------------------------------------------------------
# * Front Event Starting Determinant
#--------------------------------------------------------------------------
def check_event_trigger_there(triggers)
result = false
# If event is running
if $game_system.map_interpreter.running?
return result
end
# Calculate front event coordinates
new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
# Retrives the events on the specified tile
events = $game_map.event_map[[new_x,new_y]]
unless events.nil?
# Loop through events on tile
for event in events
# If event triggers are consistent
if triggers.include?(event.trigger)
# If starting determinant is front event (other than jumping)
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
end
# If fitting event is not found
if result == false
# If front tile is a counter
if $game_map.counter?(new_x, new_y)
# Calculate 1 tile inside coordinates
new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
# Retrives the events on the specified tile
events = $game_map.event_map[[new_x,new_y]]
unless events.nil?
# Loop through events on tile
for event in events
# If event triggers are consistent
if triggers.include?(event.trigger)
# If starting determinant is front event (other than jumping)
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
end
end
end
return result
end
#--------------------------------------------------------------------------
# * Touch Event Starting Determinant
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
result = false
# If event is running
if $game_system.map_interpreter.running?
return result
end
# Retrives the events on the specified tile
events = $game_map.event_map[[x,y]]
unless events.nil?
# Loop through events on tile
for event in events
# If event coordinates and triggers are consistent
if [1,2].include?(event.trigger)
# If starting determinant is front event (other than jumping)
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
end
return result
end
end
#==============================================================================
# ** Game_Map by Zeriab
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :event_map
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :antilag_gmmap_setup, :setup
#--------------------------------------------------------------------------
# * Setup
#--------------------------------------------------------------------------
def setup(*args)
# Makes an event map as a hash
@event_map = {}
# Original Setup
antilag_gmmap_setup(*args)
# Go through each event
for event in @events.values
# Check how the event should be updated
event.check_update
end
end
#--------------------------------------------------------------------------
# * Update Events ~ Overwritten to only updating visible and special events
#--------------------------------------------------------------------------
def update_events
# Runs through the events
for event in @events.values
# checks if the event is visible or needs to be updated
if ($antilag.reduce_lag == true and event.need_update?)
event.update
elsif $antilag.reduce_lag == false
event.update
end
end
end
# Only overwrite this method if common events should be limited
if Anti_Lag::LIMIT_COMMON_EVENTS
#--------------------------------------------------------------------------
# * Update Common Events ~ Updates only the necessary common events
#--------------------------------------------------------------------------
def update_common_events
for i in Anti_Lag::COMMON_EVENTS_TO_UPDATE
@common_events[i].update
end
end
end
#--------------------------------------------------------------------------
# * Called when an event has been moved with it's old x and y coordinate
# Used to update its position in the event_map
#--------------------------------------------------------------------------
def move_event(old_x,old_y,event)
# Checks if the event has moved to a new position.
return if old_x == event.x && old_y == event.y
# Removes the event from its old position
remove_event(old_x, old_y, event)
# Adds the event to its new position
add_event(event.x,event.y,event)
# Gets the spriteset from Scene_Map
spriteset = $scene.instance_eval('@spriteset')
# Checks that it actually is a Spriteset_Map.
if spriteset.is_a?(Spriteset_Map) && spriteset.respond_to?(:update_event)
# Tells the spriteset to update the event to its new position
spriteset.update_event(old_x,old_y,event)
end
end
#--------------------------------------------------------------------------
# * Adds an event to the event_map at the given x and y coordinate
#--------------------------------------------------------------------------
def add_event(x,y,event)
# Checks if there are not any events on the specific tile
if @event_map[[x,y]].nil?
# Sets the position on the map to be an array containing the given
# event. (In case there are placed additional events on this tile)
@event_map[[x,y]] = [event]
else
# Adds the event to the array of events on the specific tile
@event_map[[x,y]] << event
end
end
#--------------------------------------------------------------------------
# * Removes an event from the event_map with the given x and y coordinate
#--------------------------------------------------------------------------
def remove_event(x,y,event)
# Checks if there actually are an event on the given coordinates
return if @event_map[[x,y]].nil?
# Checks whether or not there are more events than the given event on
# with the given coordinates
if @event_map[[x,y]].size > 1
# Deletes the events from the array of events
@event_map[[x,y]].delete(event)
else
# Deletes the key along with the corresponding value from the hashmap
# since there are no other events on the tile.
@event_map.delete([x,y])
end
end
#--------------------------------------------------------------------------
# * Gets min_x, max_x, min_y and max_y including the buffer-size
# Returns min_x, max_x, min_y, max_y (tile-coordinates)
# Returns a Rect if 'true' is given as the argument
#--------------------------------------------------------------------------
def get_tile_area(rect = false)
# Gets the upper left x and y tile-coordinate
x = $game_map.display_x / 128
y = $game_map.display_y / 128
# Computes the min and max coordinates when considering the buffer-size
min_x = x - Anti_Lag::BUFFER_SIZE
min_y = y - Anti_Lag::BUFFER_SIZE
max_x = x + Anti_Lag::TILES_HORIZONTAL + Anti_Lag::BUFFER_SIZE
max_y = y + Anti_Lag::TILES_VERTICAL + Anti_Lag::BUFFER_SIZE
# Makes sure the min and max coordinates are within the map
if min_x < 0
min_x = 0
end
if max_x >= $game_map.width
max_x = $game_map.width - 1
end
if min_y < 0
min_y = 0
end
if max_y >= $game_map.height
max_y = $game_map.height - 1
end
# Checks if the return should be a Rect
if rect
# Returns the result as a Rect
return Rect.new(min_x, min_y, max_x - min_x, max_y - min_y)
else
# Returns the result as the min and max coordinates
return min_x, max_x, min_y, max_y
end
end
#--------------------------------------------------------------------------
# * Checks if the tile with the given x and y coordinate is visible.
# Takes the buffer size into account.
#--------------------------------------------------------------------------
def visible?(x,y)
min_x = $game_map.display_x / 128
min_y = $game_map.display_y / 128
screen_x = Anti_Lag::TILES_HORIZONTAL
screen_y = Anti_Lag::TILES_VERTICAL
buffer = $antilag.buffer_size
if x >= min_x - buffer && x <= min_x + buffer + screen_x &&
y >= min_y - buffer && y <= min_y + buffer + screen_y
return true
end
return false
end
#--------------------------------------------------------------------------
# * Get Designated Position Event ID
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
def check_event(x, y)
# Retrives the events on the specified tile
events = event_map[[x,y]]
unless events.nil?
# Loop through events on tile
for event in events
if event.x == x and event.y == y
return event.id
end
end
end
end
#--------------------------------------------------------------------------
# * Determine if Passable
# x : x-coordinate
# y : y-coordinate
# d : direction (0,2,4,6,8,10)
# * 0,10 = determine if all directions are impassable
# self_event : Self (If event is determined passable)
#--------------------------------------------------------------------------
def passable?(x, y, d, self_event = nil)
# If coordinates given are outside of the map
unless valid?(x, y)
# impassable
return false
end
# Change direction (0,2,4,6,8,10) to obstacle bit (0,1,2,4,8,0)
bit = (1 << (d / 2 - 1)) & 0x0f
# Retrives the events on the specified tile
events = event_map[[x,y]]
unless events.nil?
# Loop through events on tile
for event in events
# If tiles other than self are consistent with coordinates
if event.tile_id >= 0 and event != self_event and not event.through
# If obstacle bit is set
if @passages[event.tile_id] & bit != 0
# impassable
return false
# If obstacle bit is set in all directions
elsif @passages[event.tile_id] & 0x0f == 0x0f
# impassable
return false
# If priorities other than that are 0
elsif @priorities[event.tile_id] == 0
# passable
return true
end
end
end
end
# Loop searches in order from top of layer
for i in [2, 1, 0]
# Get tile ID
tile_id = data[x, y, i]
# Tile ID acquistion failure
if tile_id == nil
# impassable
return false
# If obstacle bit is set
elsif @passages[tile_id] & bit != 0
# impassable
return false
# If obstacle bit is set in all directions
elsif @passages[tile_id] & 0x0f == 0x0f
# impassable
return false
# If priorities other than that are 0
elsif @priorities[tile_id] == 0
# passable
return true
end
end
# passable
return true
end
end
#============================================================================
# ** Spriteset_Map by NearFantastica
#============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
def in_range?(object)
return true if $antilag.reduce_lag == false
min_x = $game_map.display_x / 128
min_y = $game_map.display_y / 128
screen_x = Anti_Lag::TILES_HORIZONTAL
screen_y = Anti_Lag::TILES_VERTICAL
buffer = $antilag.buffer_size
if x >= min_x - buffer && x <= min_x + buffer + screen_x &&
y >= min_y - buffer && y <= min_y + buffer + screen_y
return true
end
return false
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
#===============================================================================
# Sprite_Character Class by NearFantastica
#===============================================================================
class Sprite_Character < RPG::Sprite
#-----------------------------------------------------------------------------
# update method, parameters added for Loop_Map, rebuild for 8dirs
#-----------------------------------------------------------------------------
alias antilag_sprite_char_update update
def update
if @character.is_a?(Game_Event) and !@character.in_range? and $antilag.reduce_lag
return
end
antilag_sprite_char_update
end
end
EVENTALIST
Show Signature
EVENTALIST
ACTIVATED
ACTIVATED
ACTIVATED
profile
DontSay
profile
Hi Mr_Wiggles...
I tried your anti lag script a minute ago but for me it lags very much using this one.. -.-
I use the one from Near Fantastica and it works with XAS very well... maybe it works for you too??? ^^
Here it is:
I tried your anti lag script a minute ago but for me it lags very much using this one.. -.-
I use the one from Near Fantastica and it works with XAS very well... maybe it works for you too??? ^^
Here it is:
- Spoiler:
- #==============================================================================
# ** Anti Event Lag script V3
# AntiEventLagscript.rb von Near Fantastica, Rabu (28.07.2008)
#------------------------------------------------------------------------------
# http://www.rpg-studio.de/scriptdb/node/4
# http://www.rpg-studio.de/forum/index.php?page=Thread&threadID=31196
#==============================================================================
#======================================
# * Anti Event Lag script
#======================================
# By: Near Fantastica
# Date: 12.06.05
# Version: 3
# Addon by Rabu
#======================================
# Addon: Auch Events werden upgedatet die ausserhalb des range?-Bereichs
# liegen, aber als erste Event-Zeile einen "comment"-Befehl beinhalten.
# Also Events will be updated, that have a "Comment"-command
# in the first line of the event - (inspired by Rataime)
#======================================
# * 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
if $game_map.need_refresh
refresh
end
if @scroll_rest > 0
distance = 2 ** @scroll_speed
case @scroll_direction
when 2
scroll_down(distance)
when 4
scroll_left(distance)
when 6
scroll_right(distance)
when 8
scroll_up(distance)
end
@scroll_rest -= distance
end
for event in @events.values
#===== Änderung / Modification- Rabu ==========
if in_range?(event) or event.trigger == 3 or event.trigger == 4 or (event.list!=nil and event.list[0].code == 108)
#==============================================
event.update
end
end
for common_event in @common_events.values
common_event.update
end
@fog_ox -= @fog_sx / 8.0
@fog_oy -= @fog_sy / 8.0
if @fog_tone_duration >= 1
d = @fog_tone_duration
target = @fog_tone_target
@fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
@fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
@fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
@fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
@fog_tone_duration -= 1
end
if @fog_opacity_duration >= 1
d = @fog_opacity_duration
@fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
@fog_opacity_duration -= 1
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
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)
end
Graphics.frame_reset
end
if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
@fog_name = $game_map.fog_name
@fog_hue = $game_map.fog_hue
if @fog.bitmap != nil
@fog.bitmap.dispose
@fog.bitmap = nil
end
if @fog_name != ""
@fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
end
Graphics.frame_reset
end
@tilemap.ox = $game_map.display_x / 4
@tilemap.oy = $game_map.display_y / 4
@tilemap.update
@panorama.ox = $game_map.display_x / 8
@panorama.oy = $game_map.display_y / 8
@fog.zoom_x = $game_map.fog_zoom / 100.0
@fog.zoom_y = $game_map.fog_zoom / 100.0
@fog.opacity = $game_map.fog_opacity
@fog.blend_type = $game_map.fog_blend_type
@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
@fog.tone = $game_map.fog_tone
i=0
for sprite in @character_sprites
if sprite.character.is_a?(Game_Event)
#===== Änderung / Modification- Rabu ==========
if in_range?(sprite.character) or sprite.character.trigger == 3 or sprite.character.trigger == 4 or (sprite.character.list!=nil and sprite.character.list[0].code == 108)
#==============================================
sprite.update
i+=1
end
else
sprite.update
i+=1
end
end
#p i
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.ox = $game_map.display_x / 4
@weather.oy = $game_map.display_y / 4
@weather.update
for sprite in @picture_sprites
sprite.update
end
@timer_sprite.update
@viewport1.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
@viewport3.color = $game_screen.flash_color
@viewport1.update
@viewport3.update
end
end
ACTIVATED
Show Signature
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
Cool, i'll try this one as well.
hmm, it seemed to work for me though, it still lagged but at least I was able to move.
oh did you paste the script more then once, looks like its three of the same.
[EDIT] - When i tried the script you showed me, i get about the same performance as the other script i was using, it might be a tad better, but i really can't tell.
I might just use the one you showed me then. unless i can tweak the settings some more for the previous script to get better results.
Eh i'm just gonna use the one you showed me, the one i had is nice, but it isnt compatible with Tidloc'c time system. (the script changes the frame rate, and it messes with the clock)
hmm, it seemed to work for me though, it still lagged but at least I was able to move.
oh did you paste the script more then once, looks like its three of the same.
[EDIT] - When i tried the script you showed me, i get about the same performance as the other script i was using, it might be a tad better, but i really can't tell.
I might just use the one you showed me then. unless i can tweak the settings some more for the previous script to get better results.
Eh i'm just gonna use the one you showed me, the one i had is nice, but it isnt compatible with Tidloc'c time system. (the script changes the frame rate, and it messes with the clock)
EVENTALIST
Show Signature
EVENTALIST
ACTIVATED
ACTIVATED
ACTIVATED
profile
DontSay
profile
Yeah, sorry... fixed it... it was posted inside 3 times.. ^^ Don't know why...
And for me it works very well... o0 The other one lags for me... it slows down to 20 FPS... with this one I got 35-40 fps... ^^
Maybe the one you posted is better I don't know... ^.~ But with the other one, my game runs very well.. ^^
And for me it works very well... o0 The other one lags for me... it slows down to 20 FPS... with this one I got 35-40 fps... ^^
Maybe the one you posted is better I don't know... ^.~ But with the other one, my game runs very well.. ^^
ACTIVATED
Show Signature
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
Eh, when comes down to it, its all about the hardware, and with only a gig of ram, almost every thing lags with me.
EVENTALIST
Show Signature
EVENTALIST
ACTIVATED
ACTIVATED
ACTIVATED
profile
DontSay
profile
Yeah, that's right... but 1 gig RAM is normal these days, isn't it? o0 I've got 4 GB DDR3 RAM in my Laptop... ^^
ACTIVATED
Show Signature
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
LOL, i have a lap top... :~:
im gonna save up and buy a new one...
im gonna save up and buy a new one...
EVENTALIST
Show Signature
EVENTALIST
WORDSMITH
WORDSMITH
WORDSMITH
profile
Cardboard Square
profile
Cool. My game lags up my crappy old laptop, but it is RM2K.
Glad to know I will be able to run some XAS games!
Glad to know I will be able to run some XAS games!
WORDSMITH
Show Signature
WORDSMITH
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
Well i have to use the one i posted, since when i use the one that you posted (Dontsay), my guns in my game don't show the bullets.
But they both work fine, also i had a problem when i killed and enemy with the damage pop up script, the numbers would stay on the screen. witch i found out cause i was scrolling the screen and it wouldn't up date the events. So i can turn the anti lag script on and off through events during game play, witch fixed it.
But they both work fine, also i had a problem when i killed and enemy with the damage pop up script, the numbers would stay on the screen. witch i found out cause i was scrolling the screen and it wouldn't up date the events. So i can turn the anti lag script on and off through events during game play, witch fixed it.
EVENTALIST
Show Signature
EVENTALIST
ACTIVATED
ACTIVATED
ACTIVATED
profile
DontSay
profile
Don't know if it's that good, but if you put the Script above all the XAS Scripts it will show the animations (like bullets) etc. ^^ When its under the XAS it won't show... ^^
But it runs smoothly for me... I tried your post again and it really lags, doesn't matter where it is located... -.-
But it runs smoothly for me... I tried your post again and it really lags, doesn't matter where it is located... -.-
ACTIVATED
Show Signature
Go to page : 1, 2
GAMEFACE101 » MEDIA » PLAY with CODE! » PLAY with CODE (scripts and software) » RGSS (RMXP SCRIPTS) »Xp - Anti Lag
Similar topics