Trying to add atmosphere to my level and fog would go a long way to making it amazing. I'm aware of how to give the illusion of fog using Sector_SetFade and Sector_SetColor, however I'm really hoping there's an easier way than setting the fade and color of every sector to be fogged. In the game City of the Damned 2 there was an interesting fog element used. I assume it was done with decorate, but I'm just speculating. If anyone knows, I would love a nudge in the right direction.
Thanks Doomers. Keep the great stuff coming!
Fog effects
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- zrrion the insect
- Posts: 2411
- Joined: Thu Jun 25, 2009 1:58 pm
- Location: Time Station 1: Moon of Glendale
Re: Fog effects
As far as Decorate fog goes, there's this (which I based off of the fog in TCoTD2A,) and there's also this.
The MAPINFO properties "Fade", "FadeTable", and "OutsideFog" can all be used to make fog. FadeTable requires a new colormap and only works properly in zdoom so, unless you know what you're doing, the other two should probably be used instead.
Should you want something a little more flexible than MAPINFO's Fade, there's some ACS you can use:
The MAPINFO properties "Fade", "FadeTable", and "OutsideFog" can all be used to make fog. FadeTable requires a new colormap and only works properly in zdoom so, unless you know what you're doing, the other two should probably be used instead.
Should you want something a little more flexible than MAPINFO's Fade, there's some ACS you can use:
Code: Select all
script "FogMachine" OPEN
{
for ( int i = 0 ; i <= 3000000 ; i++) // If you have more than 3000000 sector tags yikes
{
Sector_SetFade( i , random( 0 , 255 ) , random( 0 , 255 ) , random( 0 , 255 ));
Sector_SetColor( i , random( 0 , 255 ) , random( 0 , 255 ) , random( 0 , 255 ) , random( 0 , 255 ));
}
}
- Hindsight2020
- Posts: 261
- Joined: Wed Mar 20, 2013 3:29 am
- Location: Indiana, USA
Re: Fog effects
Thanks for the resources. The OutsideFog works great. I wish I could go more than 99, but its the best thing I've come across so far. I'd rather have something the player could walk thru. I have tried your decorate fog, but for some reason I'm only getting an error marker.<!> I'll take a look at the code, maybe I've got some conflicting doom ed #s. Again thanks for the great resources. Helps a TON
- Hindsight2020
- Posts: 261
- Joined: Wed Mar 20, 2013 3:29 am
- Location: Indiana, USA
Re: Fog effects
Tried your fog decorate but still coming up the error marker. After taking a look at your DECORATE info I notice there are several places that are simply "----".As far as Decorate fog goes, there's this (which I based off of the fog in TCoTD2A,)
Code: Select all
Spawn:
TNT1 A 0
TNT1 A 0 A_SetScale(Random(2,2.25))
TNT1 A 0 A_Jump(256,1,2,3,4)
AWCF ABCD 0 A_Jump(256,"Coolness")
Coolness:
"----" AAAAAAAAAAAAAAAAAAAA 10 A_FadeIn(0.002)
"----" A 0 A_Jump(256,0,1,2,3,4,5,6,7,8,9,10,11,12,13)
"----" AAAAAAAAAAAAAA 4
"----" AAAAAAAAAAAAAAAAAAAA 10 A_FadeOut(0.002)
"----" A 0 A_Jump(256,0,1,2,3,4,5,6,7,8,9,10,11,12,13)
AWCF AAAAAAAAAAAAAA 4
loop
Thanks!
- zrrion the insect
- Posts: 2411
- Joined: Thu Jun 25, 2009 1:58 pm
- Location: Time Station 1: Moon of Glendale
Re: Fog effects
The "----" just means that it uses the same sprite as before; you don't need to do anything there. I did this so I could randomize the sprite used and not have to write code for each sprite. I'll look over the code and see if I can spot any problems.
Are you using zdoom, zandronum, or gzdoom, and are there any errors in the console? Knowing those things would help in tracking down the problem.
Are you using zdoom, zandronum, or gzdoom, and are there any errors in the console? Knowing those things would help in tracking down the problem.
- Hindsight2020
- Posts: 261
- Joined: Wed Mar 20, 2013 3:29 am
- Location: Indiana, USA
Re: Fog effects
You're right, info I should've already provided. Sorry about that.
Using the latest version of GZDB and Slade3
Playing on GZDoom. I did modify your decorate a bit but only to add a doom ed # and category. Tried without any modification and it didn't show up in my editor.
I didn't see any errors related to the fog in the console (however there was a bunch of other errors I'll probably be asking about in the near future lol).
I'm sure there's something I'm missing, thanks for your help on this.
Using the latest version of GZDB and Slade3
Playing on GZDoom. I did modify your decorate a bit but only to add a doom ed # and category. Tried without any modification and it didn't show up in my editor.
I didn't see any errors related to the fog in the console (however there was a bunch of other errors I'll probably be asking about in the near future lol).
I'm sure there's something I'm missing, thanks for your help on this.
-
- Posts: 4949
- Joined: Sun Nov 14, 2010 12:59 am
Re: Fog effects
Are you sure you're loading the fog WAD when testing your map in game (assuming you didn't merge the fog WAD with your map's WAD)?
- Hindsight2020
- Posts: 261
- Joined: Wed Mar 20, 2013 3:29 am
- Location: Indiana, USA
Re: Fog effects
I think so. I loaded into my editor the same way I've loaded dozens of other things. I'll take another look when I get home... It's not merged with my wad. That makes me a bit nervous at this stage. But maybe that would help?Blue Shadow wrote:Are you sure you're loading the fog WAD when testing your map in game (assuming you didn't merge the fog WAD with your map's WAD)?