RPGMakerID
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Komunitas RPG Maker Indonesia
 
IndeksIndeks  Latest imagesLatest images  PencarianPencarian  PendaftaranPendaftaran  Login  
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.

 

 [Xp] Multiple Fog

Go down 
2 posters
PengirimMessage
LiTTleDRAgo
Senior
Senior
LiTTleDRAgo


Level 5
Posts : 712
Thanked : 27
Engine : RMXP
Skill : Skilled
Type : Scripter

Trophies
Awards:
[Xp] Multiple Fog Empty
PostSubyek: [Xp] Multiple Fog   [Xp] Multiple Fog Empty2011-06-06, 09:51

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


Kembali Ke Atas Go down
DrDhoom
Doomed Zombie
DrDhoom


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

[Xp] Multiple Fog Empty
PostSubyek: Re: [Xp] Multiple Fog   [Xp] Multiple Fog Empty2011-06-06, 10:20

wogh mantap mas drago... gw dah kmren" nyari ni script :D
Kembali Ke Atas Go down
LiTTleDRAgo
Senior
Senior
LiTTleDRAgo


Level 5
Posts : 712
Thanked : 27
Engine : RMXP
Skill : Skilled
Type : Scripter

Trophies
Awards:
[Xp] Multiple Fog Empty
PostSubyek: Re: [Xp] Multiple Fog   [Xp] Multiple Fog Empty2011-06-06, 18:38

wah, jadi malu nih kk XD

hmm kyknya ada sedikit salah typo di skripnya, ntar saya benerin dulu deh
Kembali Ke Atas Go down
Sponsored content





[Xp] Multiple Fog Empty
PostSubyek: Re: [Xp] Multiple Fog   [Xp] Multiple Fog Empty

Kembali Ke Atas Go down
 
[Xp] Multiple Fog
Kembali Ke Atas 
Halaman 1 dari 1
 Similar topics
-
» [Technique] Multiple Ending
» [REQ]Multiple Money system
» [VX]Multiple Money Script
» Multiple question from newbie
» [Xp] Multiple Treasure Info

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