RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Handling Fog

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 88
Your greatest flaw is that you have a soul.
Warm greetings.

This may sound dumb but do you have an idea of how to make at least two fogs work at the same time? I did use search and didn't come up with what I wanted. I tried some of the tricks and failed to achieve it. It's the RPGM XP PK I'm talking about. To make it more precise, I want a forest shade fog to stand still while the mist fog moves around, I can deal with all just don't know how to put two of them.

*****
Ancient Mummy
Rep:
Level 90
I think this can only be done by scripting not sure though..

***
Rep:
Level 88
Your greatest flaw is that you have a soul.

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
If you need a "standing" fog, just use the "Show picture" command. ;8

EDIT:

Nvm, I didn't get the question right. Let me script it for you.

EDIT:

Code: [Select]
FOGNAMES = {}

# template:
# FOGNAMES[MAP_ID] = ["FOG_NAME", HUE, OPACITY, BLENDTYPE, ZOOM, X_OFF, Y_OFF]

FOGNAMES[1] = ["001-Fog01", 0, 80, 0, 0, 100.0, 0]

#==============================================================================
# Game_Map
#==============================================================================

class Game_Map
 
  attr_accessor :fog2_name
  attr_accessor :fog2_hue
  attr_accessor :fog2_opacity
  attr_accessor :fog2_blend_type
  attr_accessor :fog2_zoom
  attr_accessor :fog2_sx
  attr_accessor :fog2_sy
  attr_reader   :fog2_ox
  attr_reader   :fog2_oy
  attr_reader   :fog2_tone
 
  alias setup_fog2_later setup
  def setup(map_id)
    setup_fog2_later(map_id)
    @fog2_name = (FOGNAMES[map_id][0] == nil ? "" : FOGNAMES[map_id][0])
    @fog2_hue = (FOGNAMES[map_id][1] == nil ? 0 : FOGNAMES[map_id][1])
    @fog2_opacity = (FOGNAMES[map_id][2] == nil ? 0 : FOGNAMES[map_id][2])
    @fog2_blend_type = (FOGNAMES[map_id][3] == nil ? 0 : FOGNAMES[map_id][3])
    @fog2_zoom = (FOGNAMES[map_id][4] == nil ? 100.0 : FOGNAMES[map_id][4])
    @fog2_sx = (FOGNAMES[map_id][5] == nil ? 0 : FOGNAMES[map_id][5])
    @fog2_sy = (FOGNAMES[map_id][6] == nil ? 0 : FOGNAMES[map_id][6])
    @fog2_ox = 0
    @fog2_oy = 0
    @fog2_tone = Tone.new(0, 0, 0, 0)
    @fog2_tone_target = Tone.new(0, 0, 0, 0)
    @fog2_tone_duration = 0
    @fog2_opacity_duration = 0
    @fog2_opacity_target = 0
  end
 
  def start_fog2_opacity_change(opacity, duration)
    @fog2_opacity_target = opacity * 1.0
    @fog2_opacity_duration = duration
    @fog2_opacity = @fog2_opacity_target if @fog2_opacity_duration == 0
  end
 
  alias update_fog2_later update
  def update
    update_fog2_later
    @fog2_ox -= @fog2_sx / 8.0
    @fog2_oy -= @fog2_sy / 8.0
    if @fog2_tone_duration >= 1
      d = @fog2_tone_duration
      target = @fog2_tone_target
      @fog2_tone.red = (@fog2_tone.red * (d - 1) + target.red) / d
      @fog2_tone.green = (@fog2_tone.green * (d - 1) + target.green) / d
      @fog2_tone.blue = (@fog2_tone.blue * (d - 1) + target.blue) / d
      @fog2_tone.gray = (@fog2_tone.gray * (d - 1) + target.gray) / d
      @fog2_tone_duration -= 1
    end
    if @fog2_opacity_duration >= 1
      d = @fog2_opacity_duration
      @fog2_opacity = (@fog2_opacity * (d - 1) + @fog2_opacity_target) / d
      @fog2_opacity_duration -= 1
    end
  end
 
end

#==============================================================================
# Spriteset_Map
#==============================================================================

class Spriteset_Map
 
  alias init_fog2_later initialize
  def initialize
    init_fog2_later
    @fog2 = Plane.new(@viewport1)
    @fog2.z = 3000
    update
  end
 
  alias disp_fog2_later dispose
  def dispose
    @fog2.dispose
    disp_fog2_later
  end
 
  alias upd_fog2_later update
  def update
    upd_fog2_later
    if @fog2_name != $game_map.fog2_name or @fog2_hue != $game_map.fog2_hue
      @fog2_name = $game_map.fog2_name
      @fog2_hue = $game_map.fog2_hue
      if @fog2.bitmap != nil
        @fog2.bitmap.dispose
        @fog2.bitmap = nil
      end
      if @fog2_name != ""
        @fog2.bitmap = RPG::Cache.fog(@fog2_name, @fog2_hue)
      end
      Graphics.frame_reset
    end
    @fog2.zoom_x = $game_map.fog2_zoom / 100.0
    @fog2.zoom_y = $game_map.fog2_zoom / 100.0
    @fog2.opacity = $game_map.fog2_opacity
    @fog2.blend_type = $game_map.fog2_blend_type
    @fog2.ox = $game_map.display_x / 4 + $game_map.fog2_ox
    @fog2.oy = $game_map.display_y / 4 + $game_map.fog2_oy
    @fog2.tone = $game_map.fog2_tone
  end
 
end


Use Call script and use this here

Code: [Select]
$game_map.start_fog2_opacity_change(OPACTIY, DURATION)

to change the second fog. This works the same like the fog change event command for the first one.
For any changes during the map you can just use:

Code: [Select]
$game_map.fog2_ATTRIBUTE_NAME = NEW_VALUE

ATTRIBUTE_NAME can be one of those here:

Code: [Select]
name
hue
opacity
blend_type
zoom
sx
sy

Don't forget to set up the configuration FOGNAMES for each map you want. Skip it for any maps you don't want this feature.
« Last Edit: April 12, 2007, 05:58:51 PM by Blizzard »
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

***
Rep:
Level 88
A pirate's life for me
Can't this be done with multiple pictures? That would be simpler I think.

By the way.... How do I change the board skin? I'm stuck with the pink one  :'(


The new generation will go to the distance... Will the distance between us smallen?

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Profile -> Look and layout preferences (on the top).
Using mulitple pics would increase the lag , maybe even dramatically (and it's harder...). That script I made for you will use the same way to show a fog just like the default fog is shown. I guess this to be the optimal solution.
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

***
Rep:
Level 88
Your greatest flaw is that you have a soul.
Bravo. You inspire me. I put that over main index script, yes?
« Last Edit: April 12, 2007, 09:26:42 PM by Decadent Sympozium »

***
Rep:
Level 88
Your greatest flaw is that you have a soul.
Blizzard, art thou sure of your script? I'm getting an error, but regardless, there's something bugging me, if you take a look at the begining of your script, you wrote

"FOGNAMES[MAP_ID] = ["FOG_NAME", HUE, OPACITY, BLENDTYPE, ZOOM, X_OFF, Y_OFF]"

And beneath

"FOGNAMES[1] = ["001-Fog01", 0, 80, 0, 0, 100.0, 0]"

Now, as far as I know "zoom" is set as 100.0, however, you placed 100.0 at X_OFF, and 0 at Zoom, so I am wondering if you accidently miscripted something else or I'm just being ignorant to something.

As for the error, I may be missing something, I put the script above main (or was that a mistake) and on test I'm getting error

"??? 28 ??? NoMethod Error undefined error "[]" for nil: NillClass"

However, now I'm thinking, am I supposed to replace something else except to write file names there at the begining of your script?
« Last Edit: April 20, 2007, 01:49:54 PM by Decadent Sympozium »

***
Rep:
Level 88
Your greatest flaw is that you have a soul.

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
i'm sorry but blizzard does not visit RMRK anymore. You will have to wait for someone else with scripting knowlege to help.
Watch out for: HaloOfTheSun

***
Rep:
Level 88
Your greatest flaw is that you have a soul.
i'm sorry but blizzard does not visit RMRK anymore. You will have to wait for someone else with scripting knowlege to help.

What do you mean he doesn't visit it anymore? Mind providing some more info?

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
the fact that he "quit" rmrk. There is no "evidence" he just left after some problems around here.

read his sig, you can find his most updated scripts where? not here...at his forum. he left.
Watch out for: HaloOfTheSun

*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
You can find him at his forums Chaos Project