[XP] Blizz-ABS Event Anti-Lag

Started by Blizzard, January 09, 2008, 08:30:06 am

Previous topic - Next topic

LiTTleDRAgo

ah..... then, how about adding this line ?

Quote
  def update?
    return true if NO_ABSEAL_IDS.include?($game_map.map_id)
    return true if [3, 4].include?(self.trigger)
    return true if @move_route_index < @move_route.list.size
    return false if AUTO_KILL && @character_name == '' && @tile_id < 384
    return false if @real_x >= $game_map.display_x + 20 * 128 - @sprite_size[0]
    return false if @real_x < $game_map.display_x - @sprite_size[1]
    return false if @real_y >= $game_map.display_y + 15 * 128 - @sprite_size[2]
    return false if @real_y < $game_map.display_y - @sprite_size[3]
    return true
  end

Poe


Blizzard

Quote from: ForeverZer0 on December 07, 2011, 12:32:23 am
Umm... I think deleting that part effectively makes the script do absolutely nothing. The whole point is to catch the update method, and stop it from working if its not needed. By removing that part, it will just behave normally, and the script becomes just a bunch of worthless text in the editor.


Actually I'm not entirely sure about that. Events will keep being updated, but their sprites still won't. Obviously, you're still right about an update overhead for events.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

Ah yes, sprite updating is handled in Spriteset_Map, not through the event.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

syldocaine

First at all this masterpiece of work rescued my whole project from being a lag chaos.

But i have one question: Is there a way to fix it that big sprites pop up if im walking from north to south for example the big waggons from the standart RTP?
It's not that big problem but it would be cool.

Kise

Looks really good, but I can't use it because of this error - http://ifotos.pl/z/wwnexrh/ Any ideas how I can fix that?

KK20

This is an error related to RGSS3, not the script itself. Because you are using XPA, you should refer to the XPA topic instead as the "superclass mismatch" error has been reported and solved multiple times now.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Zangetsu

Hi, I am having a problem.

Is this script compatible to the "Emotions script" by Ánemus? It seems to have an error...

I will paste the code here if it helps. :)

#===============================================================#
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>SCRIPT<<<<<<<<<<<<<<<<<<<<<<<<<<<<<#
#===============================================================#
#                                                               #
#                        Emotions Script                        #
#                by Ánemus (www.arcadiumrpg.net)                #
#                                                               #
#  This script shows emotions over the player or over the other #
#                     characters of the map.                    #
#                                                               #
#                  $scene.emotion(id,ev,image)                  #
#                                                               #
#           For any comments: anemus@arcadiumrpg.net            #
#                                                               #
#===============================================================#
#>>>>>>>>>>>>>>>>>>>>>>>>>>>SETTINGS<<<<<<<<<<<<<<<<<<<<<<<<<<<<#
#===============================================================#
#                                                               #
# Number of Repetitions or LOOP:                                #
# That's the number of times the animation of the emotion will  #
# repeat. I recomend 1, because bigger numbers are just way to  #
# repetitive.                                                   #
LOOP = 1
#                                                               #
# Delay:                                                        #
# That's the slowness of the animation. I recomend 3 or 4,      #
# smaller numbers are like flashes, so they aren't really       #
# useful.                                                       #
DELAY = 5
#                                                               #
# Deafult file for emotions:                                    #
# This is a tool to make it easier to use, this way you just    #
# write the id of the animation and the event where you want to #
# show it.
DEFAULTFILE = "Balloon"
#                                                               #
#===============================================================#
#>>>>>>>>>>>>>>>>>>>>>>>>>INSTRUCTIONS<<<<<<<<<<<<<<<<<<<<<<<<<<#
#===============================================================#
#                                                               #
# Whenever you want to use it just use Call Script command      #
# then write:                                                   #
# $scene.emotion(id, ev, image)                                 #
# Being id the number of the emotion in the file (the top one is#
# the 0 and the lowest one the 9), ev the event over which you  #
# are showing the emotion (being -1 for the player and any      #
# other number for events, and image, that is the image file    #
# that you are using for the emotions. This file is to be placed#
# on Pictures folder and should be 256x320 px.                  #
#                                                               #
# Some tips:                                                    #
# If you are using the emotion file specified in DEFAULTFILE    #
# you dont need to include it in the sentence.                  #
# $scene.emotion(id, ev)                                        #
# Now if you are using the default file and also placing the    #
# emotion on the main character, the sentence is reduced to:    #
# $scene.emotion(id)                                            #
#                                                               #
#===============================================================#
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>END<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<#
#===============================================================#

#===============================================================#
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>CODE<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<#
#===============================================================#
class Sprite_Character < RPG::Sprite
  alias :old_updateEmo :update
  def update
    old_updateEmo
    if @frames != nil
      @pic.x = (@character.screen_x + 5)
      @pic.y = (@character.screen_y - @ph - @ch.to_i+2)
      if @frames > (1 + LOOP*7)*DELAY
        @pic.zoom_x = 0.6
        @pic.zoom_y = 0.6
        @pic.opacity = 100
        @frames -= 1
        return
      elsif @frames > (LOOP*7)*DELAY
        @pic.zoom_x = 1
        @pic.zoom_y = 1
        @pic.opacity = 255
        @frames -= 1
        @iframe = 1
        @gota = 0
        return
      elsif @frames == 0
        @frames = nil
        @pic.bitmap.dispose
        @pic.dispose
        @picid = nil
        return
      else
        @pic.bitmap.clear
        @pic.bitmap.blt(0,0,RPG::Cache.picture(@picig),Rect.new(@iframe*32, @picid*32, 32, 32))
        @pic.zoom_x = 1
        @pic.zoom_y = 1
        @pic.opacity = 255
        @frames -= 1
        if @gota == DELAY
          @iframe += 1
          if @iframe > 7
            @iframe = 1
          end
          @gota = 0
        end
        @gota +=1
      end
    end
  end
  def emotion (id,ig="Balloon",wt=false)
    @frames = (2 + LOOP*7)*DELAY
    @picid = id > 9 ? 9 : id
    @picig = ig
    @pic = Sprite.new
    @pic.bitmap = Bitmap.new(32,32)
    @pic.bitmap.blt(0, 0, RPG::Cache.picture(@picig), Rect.new(0,32*@picid,32,32))
    @pic.ox = @pic.bitmap.width / 2
    @pic.oy = @ph = @pic.bitmap.height / 2
    @pic.z = 100
    if wt
      return @frames
    else
      return 0
    end
  end
  def dispose
    super
    if @pic != nil
      @pic.bitmap.dispose
      @pic.dispose
    end
  end
end
class Spriteset_Map
  def emotion (id,ev=-1,ig=DEFAULTFILE,wt=false)
    if ev.to_i > -1
      @frames = @character_sprites[ev].emotion (id,ig,wt)
    else
      @frames = @character_sprites[@character_sprites.size - 1].emotion(id,ig,wt)
    end
    return @frames
  end
end
class Scene_Map
  def emotion (id,ev=-1,ig=DEFAULTFILE,wt=false)
    $game_system.map_interpreter.wait_count = @spriteset.emotion (id,ev,ig,wt)
  end
end
class Interpreter
  def wait_count=(frames)
    @wait_count = frames.to_i
  end
end
My name is Kitsuki.

Blizzard

Try putting it below or above the script, opposite from what you have now.
Also, <3 for your username.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Zangetsu

Thanks Blizzard :D

Unfortunately the script doesn't seem compatible, but I'll probably try with another project soon! I like this script a lot ;)
My name is Kitsuki.

Kise

I think you have incorrect version of the script in the thread, it's the same as in demo. Events are disappearing on screen edges. Tested on new project.

KK20

What in the grave-digging world are you talking about?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kise

ABSEAL's demo has slightly modified version to show how this script works, events are disapearing on the edges on the screen. Script linked directly in the thread is the same.

Blizzard

Yes, the demo is setup to show how the script works by reducing the the boundary within the screen so it's visible.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Kise

March 13, 2018, 01:53:30 pm #34 Last Edit: March 13, 2018, 02:14:57 pm by Kise
Script under this link http://downloads.chaos-project.com/scripts/Blizz-ABSEAL.txt and in the demo are identical. They both reduce the boundary within the screen.

Jaiden

Quote from: Kise on March 13, 2018, 01:53:30 pm
Script under this link http://downloads.chaos-project.com/scripts/Blizz-ABSEAL.txt and in the demo are identical. They both reduce the boundary within the screen.

I do believe that's the point. You're supposed to get an idea of how it works and then modify the configuration of the script to fit your needs.

Kise

That's not the case. Message in demo says '[..]This demo uses slightly modified version of ABSEAL. Instead of cutting off everything beyond the screen, ABSEAL will now cut off everything that is beyond the dark border[..]"

Blizzard

You are right. I accidentally copied the modified version into the script that was meant for distribution. I uploaded v3.2 and added the EXTEND_TILES options which makes it easier to control this if I ever mess up again. The demo uses a value of -1 EXTEND_TILES while a value of 0 should be the default.

Make sure to do a browser cache clear by pressing CTRL+F5 to make sure the browsers downloads the new file. It should say v3.2 in the header.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.