Relatively Simple Fogs, Un-laggy :D |
|
|
|
|
Jul 31 2009, 08:55 PM
|
Making a Comeback

Group: Revolutionary
Posts: 393
Type: Musician
RM Skill: Intermediate

|
Relatively Simple Fogs Version 1.5bAuthor: Miget man12Release Date: July 31, 2009 V1.5: August 1, 2009 V1.5b: August 7, 2009 (bug fix)IntroductionThis script takes a different approach to fogs. Instead of having you enter a script call to make a fog appear, it will draw a different fog every time you transfer. In other words, each map has it's own fog that is automatically drawn. I originally made it for use in Twilight1300's Legend of Zelda: Realm of the Gods, then I decided to use it in my own project. I eventually edited it quite a bit, and I did some research, and I found that Woratana's is one of the few working fog scripts. I don't know about every one else, but that script creates a ton of lag for me  . Anyway, I decided to post this for others. Version 1.5 gives you the ability to use multiple fogs! Features-Each map gets it's own fog that is automatically drawn -You can draw a new fog while in a map (but it will be erased when you transfer!) -Lots of customization for fogs -Up to 9999 fogs (but it's a really bad idea to have that many  ) ScriptCODE #============================================================================== # Miget man12's Relatively Simple Fogs V 1.5 # # This script takes a different approach to fogs. Instead of having you enter # a script call to make a fog appear, it will draw a different fog every time # you transfer. In other words, each map has it's own fog that is automatically # drawn. Version 1.5 allows you to have multiple fogs! #----------------------------------------------------------------------------- #Methods you can use:: # To pause a Fog, put a script command: # $game_map.fog_frozen[id] = true # # To change the Opacity of fog while in a map, put: # $game_map.fog[id].opacity = (0~255) # # To change the Blend of fog while in a map, put: # $game_map.fog[id].blend_type = 0, 1, or 2 (normal, additive, or subtractive) # # To change the X movement speed of fog while in a map, put: # $game_map.fog[id].sx = number (e.g.: 0.02, 348, 20.7 :P) # # To change the Y movement speed of fog while in a map, put: # $game_map.fog[id].sy = number (e.g.: 0.4, 4731, 48.29) # # To change the Zoom of fog while in a map, put: # $game_map.fog_zoom[id] = number (e.g.: 0.1, 674, 381.594) # # To change the Filename of a fog while in a map, put: # $game_map.fog_filename[id] = "filename" (in quotes!) # # To create a Fog in a map that does not have a preset fog or change the fog, # put: # $game_map.setup_fog(See Fog Data Setup) # Example:: # $game_map.setup_fog(["BlueSky",95,2,1.5,4,2]) #============================================================================== module Mm12 #Customization:: MAP_FOGS = {} # DO NOT DELETE OR CHANGE THIS! # #Instructions:: # To set up, put # MAP_FOGS[map ID]=["fog filename",fog opacity(0~255), # blend type(0:norm,1:add,2:sub),zoom level(1 is normal), # move speed on X Axis(1/8 pixel/frame),move speed on Y Axis(1/8 pixel / frame)] # Example: # MAP_FOGS[1] = ["BlueSky",125,0,2,0,0] # Explanation: # MAP001 will have a fog with the BlueSky parallax with 125 opacity that has # normal blend. It will be twice as big as the real file, and no movement. # MAP_FOGS[2] = ["BlueSky",95,2,1.5,4,2] # Explanation: # MAP002 will have a fog with the BlueSky parallax with 95 opacity that has # Sub. blend. It will be 1 1/2 times as big as the real file. It will move 1/2 # a pixel right every frame, and 1/4 a pixel down every frame. #(V1.5) # To have more than one fog per map, just put 2 fogs in brackets, seperated by # commas: # MAP_FOGS[3] = [["CloudySky",45,0,1.3,2,0],["BlueSky",45,2,1.5,3,5]] ################ # Actual Setup:: MAP_FOGS[1] = ["BlueSky",165,0,2,0,0] MAP_FOGS[2] = ["BlueSky",145,2,1.5,4,2] MAP_FOGS[3] = [["CloudySky",75,0,1.3,2,0],["BlueSky",65,2,1.5,3,5]] # Folder where fogs reside FOGS_FOLDER = "Parallaxes" end module Cache #-------------------------------------------------------------------------- # * Get System Graphic # filename : Filename #-------------------------------------------------------------------------- def self.fog(filename) load_bitmap("Graphics/#{Mm12::FOGS_FOLDER}/", filename) rescue Bitmap.new(200,200) end end class Game_Map attr_accessor :fog, :fog_frozen, :fog_hidden, :fog_opacity, :fog_ox, :fog_oy, :fog_zoom, :fog_filename alias mm12_fog_gm_mp_setup setup alias mm12_fog_gm_mp_update update alias mm12_fog_gm_mp_init initialize def initialize mm12_fog_gm_mp_init @fogox = Array.new(9999,0) @fogoy = Array.new(9999,0) @fog_ox = [] @fog_oy = [] @fog = [] @filename = [] @fog_filename = [] @fog_zoom = [] @fog_hidden = [] @fog_frozen = Array.new(9999,false) end def setup(map_id) mm12_fog_gm_mp_setup(map_id) setup_fog end def setup_fog(fog_data=nil) for i in 0..(@fog.size-1) if @fog_hidden[i] @fog[i].opacity = @fog_opacity @fog_hidden[i] = false return end @fog[i].dispose unless @fog[i] == nil @fog[i] = nil end @fog = [] if fog_data == nil fog_data = Mm12::MAP_FOGS[@map_id] if fog_data.nil? @fog_used = false return end if !fog_data[0].is_a?(Array) fog_data = [fog_data] end i = 0 for data in fog_data @fog[i] = Plane.new @fog[i].ox=0 @fog[i].oy=0 @fog[i].ox = @fog_ox[i] unless @fog_ox[i].nil? @fog[i].oy = @fog_oy[i] unless @fog_oy[i].nil? @fog_ox[i] = nil @fog_oy[i] = nil @fog[i].bitmap = Cache.fog(data[0]) @fog[i].z = 30 @fog[i].opacity = data[1] @fog[i].blend_type = data[2] @fog[i].zoom_x = data[3] @fog[i].zoom_y = data[3] @fog_zoom[i] = data[3] @fog[i].sx = data[4]#.to_f @fog[i].sy = data[5]#.to_f @filename[i] = data[0] @fog_filename[i] = data[0] i += 1 end else if !fog_data[0].is_a?(Array) fog_data = [fog_data] end i = 0 for data in fog_data @fog_used = true @fog[i] = Plane.new @fog[i].bitmap = Cache.fog(data[0]) @fog[i].opacity = data[1] @fog[i].blend_type = data[2] @fog[i].zoom_x = data[3] @fog[i].zoom_y = data[3] @fog_zoom[i] = data[3] @fog[i].sx = data[4] @fog[i].sy = data[5] @filename[i] = data[0] @fog_filename[i] = data[0] i += 1 end end end def update mm12_fog_gm_mp_update for i in 0..(@fog.size-1) return if @fog[i].nil? @fog[i].zoom_x = @fog[i].zoom_y = @fog_zoom[i] if @fog[i].zoom_x != @fog_zoom[i] if @fog_filename[i] != @filename[i] @filename[i] = @fog_filename[i] @fog[i].bitmap = Cache.fog(@filename) end if @fog_frozen[i] @fog[i].ox = ($game_map.display_x/8.0)+@fogox[i] unless @fog[i].nil?# or @fog_frozen or @fog.ox == ($game_map.display_y/8.0)+(@fog.sx/8.0) else @fogox[i] -= @fog[i].sx/8.0 unless @fogox[i].nil? @fog[i].ox = ($game_map.display_x/8.0)+@fogox[i] unless @fog[i].nil?# or @fog_frozen or @fog.ox == ($game_map.display_y/8.0)+(@fog.sx/8.0) end if @fog_frozen[i] @fog[i].oy = ($game_map.display_y/8.0)+@fogoy[i] unless @fog[i].nil?# or @fog_frozen or @fog.oy == ($game_map.display_y/8.0)+(@fog.sy/8.0) else @fogoy[i] -= @fog[i].sy/8.0 unless @fogoy[i].nil? @fog[i].oy = ($game_map.display_y/8.0)+@fogoy[i] unless @fog[i].nil?# or @fog_frozen or @fog.oy == ($game_map.display_y/8.0)+(@fog.sy/8.0) end end end end class Scene_Map alias mm12_fog_scn_mp_terminate terminate alias mm12_fog_scn_mp_start start def start mm12_fog_scn_mp_start $game_map.setup_fog end def terminate mm12_fog_scn_mp_terminate for i in 0..9999 next if $game_map.fog[i].nil? $game_map.fog_ox[i] = $game_map.fog[i].ox $game_map.fog_oy[i] = $game_map.fog[i].oy $game_map.fog[i].dispose unless $game_map.fog[i].nil? $game_map.fog[i] = nil end end end class Plane attr_accessor :sx, :sy end CustomizationQUOTE CODE #Customization:: MAP_FOGS = {} # DO NOT DELETE OR CHANGE THIS! # #Instructions:: # To set up, put # MAP_FOGS[map ID]=["fog filename",fog opacity(0~255), # blend type(0:norm,1:add,2:sub),zoom level(1 is normal), # move speed on X Axis(1/8 pixel/frame),move speed on Y Axis(1/8 pixel / frame)] # Example: # MAP_FOGS[1] = ["BlueSky",125,0,2,0,0] # Explanation: # MAP001 will have a fog with the BlueSky parallax with 125 opacity that has # normal blend. It will be twice as big as the real file, and no movement. # MAP_FOGS[2] = ["BlueSky",95,2,1.5,4,2] # Explanation: # MAP002 will have a fog with the BlueSky parallax with 95 opacity that has # Sub. blend. It will be 1 1/2 times as big as the real file. It will move 1/2 # a pixel right every frame, and 1/4 a pixel down every frame. #(V1.5) # To have more than one fog per map, just put 2 fogs in brackets, seperated by # commas: # MAP_FOGS[3] = [["CloudySky",45,0,1.3,2,0],["BlueSky",45,2,1.5,3,5]] ################ # Actual Setup:: MAP_FOGS[1] = ["BlueSky",165,0,2,0,0] MAP_FOGS[2] = ["BlueSky",145,2,1.5,4,2] MAP_FOGS[3] = [["CloudySky",75,0,1.3,2,0],["BlueSky",65,2,1.5,3,5]] # Folder where fogs reside FOGS_FOLDER = "Parallaxes" CompatibilityShould have pretty good compatibility. Only edits a couple methods(all of which are aliased). ScreenshotDEMOhttp://www.mediafire.com/download.php?mmzmykeymwuInstallationPlace script above 'Main', but below 'Materials.' Edit customization/fog setup. FAQn/a Terms and ConditionsCredits. As always (it's nice knowing that people are using your script) I'd appreciate that you could post here saying your gonna use it. CreditsMiget man12 Woratana(Fog Movement formula)
__________________________
By the way:   I'm bored because it's summer so I decided to drop by for a bit.
|
|
|
|
|
|
|
|
|
Aug 1 2009, 09:06 AM
|

Keeper of the RMVX FAQ

Group: Revolutionary
Posts: 706
Type: Mapper
RM Skill: Intermediate

|
Thanks for making this one. i had soo much lag form Wora's script too. and I think this one is better/easier to use.
__________________________
  QUOTE (Albino Parakeet @ Apr 1 2011, 05:46 PM)  i need to know exactly how to put a penis inside someone's butt. do you have the technical knowledge to tell me how? QUOTE (Albino Parakeet @ Apr 2 2011, 01:20 PM)  QUOTE (Shadyone @ Apr 2 2011, 06:29 AM)  I see the keet likes anal. im trying to get into it but people aren't answering my question
|
|
|
|
|
|
|
|
|
Aug 1 2009, 09:16 AM
|
Making a Comeback

Group: Revolutionary
Posts: 393
Type: Musician
RM Skill: Intermediate

|
@Rei: If you want I'll add that feature. (off-topic) The demo is planned to be released in September. here's the topic: http://www.rpgrevolution.com/forums/index....showtopic=29997@xeyla: Thanks!  ~Miget man12
__________________________
By the way:   I'm bored because it's summer so I decided to drop by for a bit.
|
|
|
|
|
|
|
|
|
Aug 1 2009, 09:57 AM
|

Public memberTitle(String n)

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled

|
Geez, what's with all the great scripts this morning!? I've been looking for a fog system that's incredibly simple, not semi-simple. This is exactly what I was waiting for. Thanks a ton, midget man! Would it be alright if you made a demo?
__________________________
|
|
|
|
|
|
|
|
|
Aug 1 2009, 11:06 AM
|
Making a Comeback

Group: Revolutionary
Posts: 393
Type: Musician
RM Skill: Intermediate

|
Updated to V1.5! Now features ability to have multiple fogs! @SuperMega: Okay, sorry, it took me a little while to add the multiple fogs feature  Here it is: http://www.mediafire.com/download.php?4zgtaydzizw~Miget man12
__________________________
By the way:   I'm bored because it's summer so I decided to drop by for a bit.
|
|
|
|
|
|
|
|
|
Aug 1 2009, 11:12 AM
|

I'm sorry.. What?

Group: Revolutionary
Posts: 217
Type: Event Designer
RM Skill: Skilled

|
Wow, pretty good !  I was actually looking forward to a fog system like this. I was pretty annoyed at creating an event in every map, not to mention the lag it caused ;/
__________________________
|
|
|
|
|
|
|
|
|
Aug 7 2009, 03:10 PM
|
Making a Comeback

Group: Revolutionary
Posts: 393
Type: Musician
RM Skill: Intermediate

|
Bug fix! This will fix the error of having it so that if you open the menu and close it you get a no method error. CODE #============================================================================== # Miget man12's Relatively Simple Fogs V 1.5 # # This script takes a different approach to fogs. Instead of having you enter # a script call to make a fog appear, it will draw a different fog every time # you transfer. In other words, each map has it's own fog that is automatically # drawn. Version 1.5 allows you to have multiple fogs! #----------------------------------------------------------------------------- #Methods you can use:: # To pause a Fog, put a script command: # $game_map.fog_frozen[id] = true # # To change the Opacity of fog while in a map, put: # $game_map.fog[id].opacity = (0~255) # # To change the Blend of fog while in a map, put: # $game_map.fog[id].blend_type = 0, 1, or 2 (normal, additive, or subtractive) # # To change the X movement speed of fog while in a map, put: # $game_map.fog[id].sx = number (e.g.: 0.02, 348, 20.7 :P) # # To change the Y movement speed of fog while in a map, put: # $game_map.fog[id].sy = number (e.g.: 0.4, 4731, 48.29) # # To change the Zoom of fog while in a map, put: # $game_map.fog_zoom[id] = number (e.g.: 0.1, 674, 381.594) # # To change the Filename of a fog while in a map, put: # $game_map.fog_filename[id] = "filename" (in quotes!) # # To create a Fog in a map that does not have a preset fog or change the fog, # put: # $game_map.setup_fog(See Fog Data Setup) # Example:: # $game_map.setup_fog(["BlueSky",95,2,1.5,4,2]) #============================================================================== module Mm12 #Customization:: MAP_FOGS = {} # DO NOT DELETE OR CHANGE THIS! # #Instructions:: # To set up, put # MAP_FOGS[map ID]=["fog filename",fog opacity(0~255), # blend type(0:norm,1:add,2:sub),zoom level(1 is normal), # move speed on X Axis(1/8 pixel/frame),move speed on Y Axis(1/8 pixel / frame)] # Example: # MAP_FOGS[1] = ["BlueSky",125,0,2,0,0] # Explanation: # MAP001 will have a fog with the BlueSky parallax with 125 opacity that has # normal blend. It will be twice as big as the real file, and no movement. # MAP_FOGS[2] = ["BlueSky",95,2,1.5,4,2] # Explanation: # MAP002 will have a fog with the BlueSky parallax with 95 opacity that has # Sub. blend. It will be 1 1/2 times as big as the real file. It will move 1/2 # a pixel right every frame, and 1/4 a pixel down every frame. #(V1.5) # To have more than one fog per map, just put 2 fogs in brackets, seperated by # commas: # MAP_FOGS[3] = [["CloudySky",45,0,1.3,2,0],["BlueSky",45,2,1.5,3,5]] ################ # Actual Setup:: MAP_FOGS[1] = ["BlueSky",165,0,2,0,0] MAP_FOGS[2] = ["BlueSky",145,2,1.5,4,2] MAP_FOGS[3] = [["CloudySky",75,0,1.3,2,0],["BlueSky",65,2,1.5,3,5]] # Folder where fogs reside FOGS_FOLDER = "Parallaxes" end module Cache #-------------------------------------------------------------------------- # * Get System Graphic # filename : Filename #-------------------------------------------------------------------------- def self.fog(filename) load_bitmap("Graphics/#{Mm12::FOGS_FOLDER}/", filename) rescue Bitmap.new(200,200) end end class Game_Map attr_accessor :fog, :fog_frozen, :fog_hidden, :fog_opacity, :fog_ox, :fog_oy, :fog_zoom, :fog_filename alias mm12_fog_gm_mp_setup setup alias mm12_fog_gm_mp_update update alias mm12_fog_gm_mp_init initialize def initialize mm12_fog_gm_mp_init @fogox = Array.new(9999,0) @fogoy = Array.new(9999,0) @fog_ox = [] @fog_oy = [] @fog = [] @filename = [] @fog_filename = [] @fog_zoom = [] @fog_hidden = [] @fog_frozen = Array.new(9999,false) end def setup(map_id) mm12_fog_gm_mp_setup(map_id) setup_fog end def setup_fog(fog_data=nil) for i in 0..(@fog.size-1) if @fog_hidden[i] @fog[i].opacity = @fog_opacity @fog_hidden[i] = false return end @fog[i].dispose unless @fog[i] == nil @fog[i] = nil end @fog = [] if fog_data == nil fog_data = Mm12::MAP_FOGS[@map_id] if fog_data.nil? @fog_used = false return end if !fog_data[0].is_a?(Array) fog_data = [fog_data] end i = 0 for data in fog_data @fog[i] = Plane.new @fog[i].ox=0 @fog[i].oy=0 @fog[i].ox = @fog_ox[i] unless @fog_ox[i].nil? @fog[i].oy = @fog_oy[i] unless @fog_oy[i].nil? @fog_ox[i] = nil @fog_oy[i] = nil @fog[i].bitmap = Cache.fog(data[0]) @fog[i].z = 30 @fog[i].opacity = data[1] @fog[i].blend_type = data[2] @fog[i].zoom_x = data[3] @fog[i].zoom_y = data[3] @fog_zoom[i] = data[3] @fog[i].sx = data[4]#.to_f @fog[i].sy = data[5]#.to_f @filename[i] = data[0] @fog_filename[i] = data[0] i += 1 end else if !fog_data[0].is_a?(Array) fog_data = [fog_data] end i = 0 for data in fog_data @fog_used = true @fog[i] = Plane.new @fog[i].bitmap = Cache.fog(data[0]) @fog[i].opacity = data[1] @fog[i].blend_type = data[2] @fog[i].zoom_x = data[3] @fog[i].zoom_y = data[3] @fog_zoom[i] = data[3] @fog[i].sx = data[4] @fog[i].sy = data[5] @filename[i] = data[0] @fog_filename[i] = data[0] i += 1 end end end def update mm12_fog_gm_mp_update for i in 0..(@fog.size-1) return if @fog[i].nil? @fog[i].zoom_x = @fog[i].zoom_y = @fog_zoom[i] if @fog[i].zoom_x != @fog_zoom[i] if @fog_filename[i] != @filename[i] @filename[i] = @fog_filename[i] @fog[i].bitmap = Cache.fog(@filename) end if @fog_frozen[i] @fog[i].ox = ($game_map.display_x/8.0)+@fogox[i] unless @fog[i].nil?# or @fog_frozen or @fog.ox == ($game_map.display_y/8.0)+(@fog.sx/8.0) else @fogox[i] -= @fog[i].sx/8.0 unless @fogox[i].nil? @fog[i].ox = ($game_map.display_x/8.0)+@fogox[i] unless @fog[i].nil?# or @fog_frozen or @fog.ox == ($game_map.display_y/8.0)+(@fog.sx/8.0) end if @fog_frozen[i] @fog[i].oy = ($game_map.display_y/8.0)+@fogoy[i] unless @fog[i].nil?# or @fog_frozen or @fog.oy == ($game_map.display_y/8.0)+(@fog.sy/8.0) else @fogoy[i] -= @fog[i].sy/8.0 unless @fogoy[i].nil? @fog[i].oy = ($game_map.display_y/8.0)+@fogoy[i] unless @fog[i].nil?# or @fog_frozen or @fog.oy == ($game_map.display_y/8.0)+(@fog.sy/8.0) end end end end class Scene_Map alias mm12_fog_scn_mp_terminate terminate alias mm12_fog_scn_mp_start start def start mm12_fog_scn_mp_start $game_map.setup_fog end def terminate mm12_fog_scn_mp_terminate for i in 0..9999 next if $game_map.fog[i].nil? $game_map.fog_ox[i] = $game_map.fog[i].ox $game_map.fog_oy[i] = $game_map.fog[i].oy $game_map.fog[i].dispose unless $game_map.fog[i].nil? $game_map.fog[i] = nil end end end class Plane attr_accessor :sx, :sy end Fixed Demo: http://www.mediafire.com/download.php?mmzmykeymwu~Miget man12
__________________________
By the way:   I'm bored because it's summer so I decided to drop by for a bit.
|
|
|
|
|
|
|
|
|
Aug 9 2009, 08:33 PM
|
Making a Comeback

Group: Revolutionary
Posts: 393
Type: Musician
RM Skill: Intermediate

|
Hm, that's odd. I'm not getting that error. My guess would be a compatibility issue, try placing this script below all your other scripts.
~Miget man12
__________________________
By the way:   I'm bored because it's summer so I decided to drop by for a bit.
|
|
|
|
|
|
|
|
|
Aug 9 2009, 08:53 PM
|
Level 7

Group: Member
Posts: 96
Type: None
RM Skill: Beginner

|
QUOTE (miget man12 @ Aug 9 2009, 09:33 PM)  Hm, that's odd. I'm not getting that error. My guess would be a compatibility issue, try placing this script below all your other scripts.
~Miget man12 Yep, that was the problem. Thanks it works now
|
|
|
|
|
|
|
|
|
Sep 2 2009, 04:12 PM
|
Making a Comeback

Group: Revolutionary
Posts: 393
Type: Musician
RM Skill: Intermediate

|
I'm confused. The fogs stays on when you transfer maps? The fogs automatically disappear if the map does not have a fog set. If it stays there, that's most likely some sort of compatibility issue. also, you can just call this to get rid of the fog: CODE $game_map.setup_fog(["",0,0,0,0,0]) Hope that's helpful some -- I'm not sure I understood the question fully. ~Miget man12
__________________________
By the way:   I'm bored because it's summer so I decided to drop by for a bit.
|
|
|
|
|
|
|
|
|
Sep 2 2009, 05:48 PM
|
Making a Comeback

Group: Revolutionary
Posts: 393
Type: Musician
RM Skill: Intermediate

|
Ooh, that's actually a good idea! Hm I never thought of that:D I'll do that when I'm done with my homework(shouldn't be too long; pretty light load today) But yeah, definitely something I should add. Probably wont matter the battle system that much either:D Expect it within the next hour or two:)
~Miget man12
__________________________
By the way:   I'm bored because it's summer so I decided to drop by for a bit.
|
|
|
|
|
|
|
|
|
Dec 20 2009, 02:25 PM
|

Public memberTitle(String n)

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled

|
QUOTE (nathkyo @ Dec 20 2009, 12:47 AM)  this is a really cool script however is there any way to make it only appear on certain maps. Maybe by putting something in the map's name that triggers the fog There's a configuration in the script that allows you to choose which maps you want to use the fogs for. It's near the top of the script.
__________________________
|
|
|
|
|
|
|
|
|
Dec 21 2009, 12:08 AM
|
Level 2

Group: Member
Posts: 18
Type: None
RM Skill: Intermediate

|
QUOTE (SuperMega @ Dec 20 2009, 02:25 PM)  QUOTE (nathkyo @ Dec 20 2009, 12:47 AM)  this is a really cool script however is there any way to make it only appear on certain maps. Maybe by putting something in the map's name that triggers the fog There's a configuration in the script that allows you to choose which maps you want to use the fogs for. It's near the top of the script. hey thanks I found it it works great
|
|
|
|
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|