Per 2016, RMID pindah ke RMID Discord (Invite link dihapus untuk mencegah spambot -Theo @ 2019). Posting sudah tidak bisa dilakukan lagi.
Mohon maaf atas ketidaknyamanannya dan mohon kerjasamanya.

Share | 
 

 [Xp] Multiple Fog

Topik sebelumnya Topik selanjutnya Go down 
[Xp] Multiple Fog Empty2011-06-06, 09:51
Post[Xp] Multiple Fog
#1
LiTTleDRAgo 
Senior
Senior
LiTTleDRAgo

Level 5
Posts : 712
Thanked : 27
Engine : RMXP
Skill : Skilled
Type : Scripter
Awards:
[Xp] Multiple Fog Vide
Multiple Fog
Versi: 1.00
Tipe: Graphic


Pengenalan

Skrip buat memunculkan lebih dari satu fog


Fitur


  • Memunculkan lebih dari satu fog



Screenshots

Males


Demo

Males juga


Scripts

Code:

#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
#  This class brings together map screen sprites, tilemaps, etc.
#  It's used within the Scene_Map class.
#==============================================================================

class Spriteset_Map
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def multifog(a,b,c)
    @fog2_name = ""
    @fog2 = Plane.new(a)
    @fog2.z = -400
    @fog2_ox = 0
    @fog2_oy = 0 
   
    @fog3_name = ""
    @fog3 = Plane.new(b)
    @fog3.z = -300 
    @fog3_ox = 0
    @fog3_oy = 0
   
    @fog4_name = ""
    @fog4 = Plane.new(c)
    @fog4.z = -200 
    @fog4_ox = 0
    @fog4_oy = 0
  end
  #--------------------------------------------------------------------------
  # * Fog Setup
  #--------------------------------------------------------------------------
  def system_fog_setup
    $game_system.fog2_name = ""
    $game_system.fog2_zoom = 1.00             
    $game_system.fog2_opacity = 255   
    $game_system.fog2_blend_type = 0
    $game_system.fog2_ox = 0
    $game_system.fog2_oy = 0
   
    $game_system.fog3_name = ""
    $game_system.fog3_zoom = 1.00             
    $game_system.fog3_opacity = 255   
    $game_system.fog3_blend_type = 0
    $game_system.fog3_ox = 0
    $game_system.fog3_oy = 0 
   
    $game_system.fog4_name = ""
    $game_system.fog4_zoom = 1.00             
    $game_system.fog4_opacity = 255   
    $game_system.fog4_blend_type = 0
    $game_system.fog4_ox = 0
    $game_system.fog4_oy = 0
  end
 
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  alias dispose_multifog dispose
  def dispose
    [@fog2, @fog3, @fog4].each {|i| i.dispose}
    dispose_multifog
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias update_multifog update
  def update
   
    if @fog2_name == nil
      v1, v2, v3 = @viewport1, @viewport2, @viewport3
      multifog(v1,v2,v3)
    end
 
    if $game_system.fog2_name == nil 
      system_fog_setup
    end
   
    #---------------------------------------------------------------------------
    # FOG 2
    #---------------------------------------------------------------------------
    if @fog2_name != $game_system.fog2_name
      @fog2_name = $game_system.fog2_name
      if @fog2.bitmap != nil
          @fog2.bitmap.dispose
          @fog2.bitmap = nil
      end
      if @fog2_name != ""
          @fog2.bitmap = RPG::Cache.fog(@fog2_name, 0)
      end
      Graphics.frame_reset
    end   
    @fog2.opacity = 255
    @fog2.blend_type = $game_system.fog2_blend_type
    @fog2_ox += $game_system.fog2_ox
    @fog2_oy += $game_system.fog2_oy   
    @fog2.ox = $game_map.display_x / 3 + ($game_player.screen_x / 3 ) + @fog2_ox
    @fog2.oy = $game_map.display_y / 3 +  @fog2_oy
   
    #---------------------------------------------------------------------------
    # FOG 3
    #---------------------------------------------------------------------------   
    if @fog3_name != $game_system.fog3_name
      @fog3_name = $game_system.fog3_name
      if @fog3.bitmap != nil
          @fog3.bitmap.dispose
          @fog3.bitmap = nil
      end
      if @fog3_name != ""
          @fog3.bitmap = RPG::Cache.fog(@fog3_name, 0)
      end
      Graphics.frame_reset
    end 
    @fog3.opacity = 255
    @fog3_ox += $game_system.fog3_ox
    @fog3_oy += $game_system.fog3_oy       
    @fog3.ox = $game_map.display_x / 3 + ($game_player.screen_x / 2 ) + @fog3_ox
    @fog3.oy = $game_map.display_y / 4 + @fog3_oy 
   
    #---------------------------------------------------------------------------
    # FOG 4
    #---------------------------------------------------------------------------   
    if @fog4_name != $game_system.fog4_name
      @fog4_name = $game_system.fog4_name
      if @fog4.bitmap != nil
          @fog4.bitmap.dispose
          @fog4.bitmap = nil
      end
      if @fog4_name != ""
          @fog4.bitmap = RPG::Cache.fog(@fog4_name, 0)
      end
      Graphics.frame_reset
    end 
    @fog4.opacity = 255
    @fog4_ox += $game_system.fog4_ox
    @fog4_oy += $game_system.fog4_oy       
    @fog4.ox = $game_map.display_x / 3 + ($game_player.screen_x / 2 ) + @fog4_ox
    @fog4.oy = $game_map.display_y / 4 + @fog4_oy 
    #---------------------------------------------------------------------------
    update_multifog
  end
end

class Interpreter
 
  def set_fog2(n = "",ox = 0,oy = 0)
    $game_system.fog2_name = n
    $game_system.fog2_ox = ox
    $game_system.fog2_oy = oy
  end
   
  def set_fog3(n = "",ox = 0,oy = 0)
    $game_system.fog3_name = n
    $game_system.fog3_ox = ox
    $game_system.fog3_oy = oy 
  end
   
  def set_fog4(n = "",ox = 0,oy = 0)
    $game_system.fog4_name = n
    $game_system.fog4_ox = ox
    $game_system.fog4_oy = oy
  end
 
  def reset_fog
    set_fog2("", 0, 0)
    set_fog3("", 0, 0)
    set_fog4("", 0, 0)
  end
end

#===============================================================================
# ■ GAME_SYSTEM
#===============================================================================
class Game_System
  attr_accessor :fog2_name   
  attr_accessor :fog2_zoom             
  attr_accessor :fog2_opacity     
  attr_accessor :fog2_blend_type
  attr_accessor :fog2_ox
  attr_accessor :fog2_oy
 
  attr_accessor :fog3_name   
  attr_accessor :fog3_zoom             
  attr_accessor :fog3_opacity     
  attr_accessor :fog3_blend_type
  attr_accessor :fog3_ox
  attr_accessor :fog3_oy   
 
  attr_accessor :fog4_name   
  attr_accessor :fog4_zoom             
  attr_accessor :fog4_opacity     
  attr_accessor :fog4_blend_type
  attr_accessor :fog4_ox
  attr_accessor :fog4_oy
 #--------------------------------------------------------------------------
 # ● Initialize
 #--------------------------------------------------------------------------       
 alias drago_multifog_init initialize
 def initialize
  drago_multifog_init
  @fog2_name = @fog3_name = @fog4_name = ""
  @fog2_zoom = @fog3_zoom = @fog4_zoom = 1.00           
  @fog2_opacity    = @fog3_opacity    = @fog4_opacity    = 255 
  @fog2_blend_type = @fog3_blend_type = @fog4_blend_type = 0
  @fog2_ox = @fog3_ox = @fog4_ox = @fog2_oy = @fog3_oy = @fog4_oy = 0 
 end 
end 

cara pakenya :

panggil di skrip editor
Code:
set_fog2(n,ox ,oy)
set_fog3(n,ox ,oy)
set_fog4(n,ox ,oy)

bedanya fog2, fog3, fog4 ada di viewportnya

n = nama fog (liat di bagian folder fog => harus string (" "))
ox = geser vertikalnya, mesti integer (positif geser kanan, negatif geser kiri)
oy = geser horizontalnya, (positif geser bawah, negatif geser atas)

kalo mau reset fog panggil di skrip editornya

Code:
reset_fog



Credits


  • LiTTleDRAgo


[Xp] Multiple Fog Empty2011-06-06, 10:20
PostRe: [Xp] Multiple Fog
#2
DrDhoom 
Doomed Zombie
DrDhoom

Level 5
Posts : 629
Thanked : 22
Engine : Multi-Engine User
Skill : Intermediate
Type : Scripter

[Xp] Multiple Fog Vide
wogh mantap mas drago... gw dah kmren" nyari ni script :D
[Xp] Multiple Fog Empty2011-06-06, 18:38
PostRe: [Xp] Multiple Fog
#3
LiTTleDRAgo 
Senior
Senior
LiTTleDRAgo

Level 5
Posts : 712
Thanked : 27
Engine : RMXP
Skill : Skilled
Type : Scripter
Awards:
[Xp] Multiple Fog Vide
wah, jadi malu nih kk XD

hmm kyknya ada sedikit salah typo di skripnya, ntar saya benerin dulu deh
[Xp] Multiple Fog Empty
PostRe: [Xp] Multiple Fog
#4
Sponsored content 




[Xp] Multiple Fog Vide
 

[Xp] Multiple Fog

Topik sebelumnya Topik selanjutnya Kembali Ke Atas 

Similar topics

+
Halaman 1 dari 1

Permissions in this forum:Anda tidak dapat menjawab topik
RPGMakerID :: Scripts & Event Systems :: RMXP Scripts-