Lightning Storm
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.
Lightning Storm
Is there a way to make a lightning storm with a lightning sound like in Hexen map 01?
Yes, brother. 
Looking at hexen.wad, I'm not sure there is a thunder sound in map01, at least I don't see what plays it. The only obvious ambient sound is an owl, played somewhat at random by this script:
script 253 OPEN
{
delay(random(3, 7)*100);
thingsound(36, "Ambient6", 100);
restart;
}
The lightning is a callout in the mapinfo lump (text file in the wad) which has these entries for map01:
map 1 "WINNOWING HALL"
warptrans 1
next 2
cluster 1
sky1 SKY2 0
sky2 SKY3 0
lightning <---------
cdtrack 13
Zdoom will allow you to place this entry in a mapinfo lump for doom, doom2, heretic and hexen games. I'm not clear on getting thunder to sound in sequence with this lightning. ??

Looking at hexen.wad, I'm not sure there is a thunder sound in map01, at least I don't see what plays it. The only obvious ambient sound is an owl, played somewhat at random by this script:
script 253 OPEN
{
delay(random(3, 7)*100);
thingsound(36, "Ambient6", 100);
restart;
}
The lightning is a callout in the mapinfo lump (text file in the wad) which has these entries for map01:
map 1 "WINNOWING HALL"
warptrans 1
next 2
cluster 1
sky1 SKY2 0
sky2 SKY3 0
lightning <---------
cdtrack 13
Zdoom will allow you to place this entry in a mapinfo lump for doom, doom2, heretic and hexen games. I'm not clear on getting thunder to sound in sequence with this lightning. ??
If you pop along to my examples site ( http://members.lycos.co.uk/Enjay001/ ) there are 2 Zdoom sky examples about half way down the page. Redsky is the one you want. Not only does it use a MAPINFO to get lightning on the level, it has the thunder sound defined and in addition uses a cool feature where the sky changes momentarily to show a lightning bolt every time the lightning flashes. All done without scripting.
You may be interested to know, there is also a script type (use lightning instead of open, (void), enter, etc) which will execute the script every time lightning flashes on the level.
You may be interested to know, there is also a script type (use lightning instead of open, (void), enter, etc) which will execute the script every time lightning flashes on the level.
- Hirogen2
- Posts: 2033
- Joined: Sat Jul 19, 2003 6:15 am
- Operating System Version (Optional): Tumbleweed x64
- Graphics Processor: Intel with Vulkan/Metal Support
- Location: Central Germany
- Contact:
But you do not know when the lightning strikes... at least I don't. If I want a minute to pass between two bolts, I usually need a custom script.Enjay wrote:You may be interested to know, there is also a script type (use lightning instead of open, (void), enter, etc) which will execute the script every time lightning flashes on the level.
True, but if you want something to co-incide with the thunder-clap every time it happens, regardless of when it happens, it can be a useful feature.Hirogen2 wrote:But you do not know when the lightning strikes... at least I don't. If I want a minute to pass between two bolts, I usually need a custom script.
eg, I have a level that uses a skybox. I use a lighning script to alter the appearance of the skybox whenever the lightning hits.
- Hirogen2
- Posts: 2033
- Joined: Sat Jul 19, 2003 6:15 am
- Operating System Version (Optional): Tumbleweed x64
- Graphics Processor: Intel with Vulkan/Metal Support
- Location: Central Germany
- Contact:
So do I
...etc
Code: Select all
script 123 OPEN {
delay(random(35*2, 35*10));
changelighttovalue(sector, 255);
delay(2);
ambientsound("world/thunder", 127);
restart;
}
Code: Select all
script 123 lightning {
...
}
Just for completeness, there are 3 relevant sector types I'm aware of:Cyb wrote:If you need lightning in a sector without sky then forcelightning(tag) will do it
197 Outdoor lightning - forces the full lightning effect without having F_SKY1 on either the floor or ceiling.
198 Indoor lightning - A duller lightning flash. I think intended for use in rooms with windows to simulate the flash shining in through the window.
199 Indoor lightning brighter - same as 198, but brighter. Presumably for sectors right beside the window etc.