QUICK SCRIPT QUESTION
Posts
Pages:
1
So I am using this lag script (VX) and its great. However on some of my maps I am using a really big event that covers much of the screen. All I need to know is the call script command to event the script on and off in maps I want it on or not.
This is the script. Thanks Guys. (VX)
This is the script. Thanks Guys. (VX)
#============================================================================== # ★RGSS2 # STR02_MapAntiLag v1.0 # # ・Stops the burden of updating the off-screen events. # ・トリガーが"なし"のコモンイベントの更新を止めて負担を軽減させます。 # ・自律移動失敗時にウェイトを設定できます。(それなりに重要) #============================================================================== # ■ STRRGSS2 #============================================================================== module STRRGSS2 # Update off-screen movement? true = enabled, false = disabled SELF_MOVEMENT = true # カスタム移動失敗時に設けるウェイト 0 以上に設定 MOVE_FAILED_WAIT = 30 # Off-screen detection (the rectangle signifies what is the screen). # Do not edit, Speed set this so that it auto-detects the screen size. STR02_RECT = Rect.new(-48, -32, Graphics.width+48, Graphics.height+64) end #============================================================================== # ■ Game_Map #============================================================================== class Game_Map #-------------------------------------------------------------------------- # ★ Alias #-------------------------------------------------------------------------- alias setup_events_str02 setup_events def setup_events setup_events_str02 @common_events.clear for i in 1...$data_common_events.size @common_events[i] = Game_CommonEvent.new(i) if $data_common_events[i].trigger != 0 end end end #============================================================================== # ■ Spriteset_Map #============================================================================== class Spriteset_Map #-------------------------------------------------------------------------- # ★ 再定義 #-------------------------------------------------------------------------- def update_characters for sprite in @character_sprites if sprite.character.screenin_str02 sprite.update else sprite.visible = false end end end end #============================================================================== # ■ Game_Character #============================================================================== class Game_Character #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :screenin_str02 #-------------------------------------------------------------------------- # ★ エイリアス #-------------------------------------------------------------------------- alias initialize_str02 initialize def initialize initialize_str02 @screenin_str02 = true end alias update_str02 update def update r = STRRGSS2::STR02_RECT @screenin_str02 = (screen_x > r.x and screen_x < r.width and screen_y > r.y and screen_y < r.height) update_str02 end alias update_self_movement_str02 update_self_movement def update_self_movement return if STRRGSS2::SELF_MOVEMENT and not @screenin_str02 update_self_movement_str02 end end #============================================================================== # ■ Game_Event #============================================================================== class Game_Event < Game_Character #-------------------------------------------------------------------------- # ● 自律移動の更新 #-------------------------------------------------------------------------- def update_self_movement if @stop_count >= 30 * (5 - @move_frequency) @wait_count = STRRGSS2::MOVE_FAILED_WAIT + (@id / 4) if @move_failed end super end end
If you must use an anti-lag script (WIP had some pretty valid arguments about how they fuck up your game, IIRC) have you considered using the English-language one made by Anaryu? I only mention this because it has comments in English and hence might be easier for you to configure/use. It also might even be a translated version of the script you're using, I'm not sure.
Pages:
1














