I've always wanted a geiger counter sound effect for GZDoom so I worked out the following:
Link to download
To use the mod, place the "Crow_Geiger.zip" into your ZDoom/GZDoom folder and add this line under the "Global.Autoload" section in your "gzdoom-YOURPCNAME.ini":
Code: Select all
[Global.Autoload]
Path=$PROGDIR/Crow_Geiger.zip
Inside Crow_Geiger.WAD I have a decorate file with 1 actor:
Code: Select all
ACTOR WanderingGeiger
{
+NOTRIGGER
+NOBLOCKMONST
+NOBLOCKMAP
+DONTSPLASH
+NOCLIP
+DROPOFF
+CANPASS
+JUMPDOWN
Speed 2
Radius 10
Height 10
RenderStyle None
States
{
Spawn:
TNT1 AAA 0 A_Wander(CHF_NORANDOMTURN)
TNT1 A 1 A_Wander(CHF_NORANDOMTURN)
Loop
}
}
Code: Select all
GEIGER1 GEIGER1
GEIGER2 GEIGER2
GEIGER3 GEIGER3
$pitchshift GEIGER1 0
$pitchshift GEIGER2 0
$pitchshift GEIGER3 0
$pitchshift GEIGER 0
$random GEIGER {GEIGER1 GEIGER2 GEIGER3}
Inside the WAD are 3 separate geiger counter sound effects GEIGER1, GEIGER2 and GEIGER3.
Inside the ACS folder is the following script:
Code: Select all
#library "crowgeiger"
#include "zcommon.acs"
script "Geiger Counter" ENTER
{
//set up the variables for use in the script
int x;
int y;
int z;
int UniqueNoClipTIDA;
int UniqueNoClipTIDB;
int UniqueNoClipTIDC;
int UniqueNoClipTIDD;
int UniqueNoClipTIDE;
while(true)
{
//get the player's current coordinates
x = GetActorX (0);
y = GetActorY (0);
z = GetActorZ (0) + 4.0;
//set unique identifier numbers for the TIDs to assign to the wanderers
UniqueNoClipTIDA = UniqueTID();
UniqueNoClipTIDB = UniqueTID();
UniqueNoClipTIDC = UniqueTID();
UniqueNoClipTIDD = UniqueTID();
UniqueNoClipTIDE = UniqueTID();
//spawn wanders defined in the DECORATE file where the player is
Spawn ("WanderingGeiger", x, y, z, UniqueNoClipTIDA);
Spawn ("WanderingGeiger", x, y, z, UniqueNoClipTIDB);
Spawn ("WanderingGeiger", x, y, z, UniqueNoClipTIDC);
Spawn ("WanderingGeiger", x, y, z, UniqueNoClipTIDD);
Spawn ("WanderingGeiger", x, y, z, UniqueNoClipTIDE);
//this section tells the wanders to look for the NUKAGE1,2 OR 3 textures underneath themselves
for (int i = 0; i < 5; i++ )
{
if (CheckActorFloorTexture(UniqueNoClipTIDA, "NUKAGE1") || CheckActorFloorTexture(UniqueNoClipTIDA, "NUKAGE2") || CheckActorFloorTexture(UniqueNoClipTIDA, "NUKAGE3"))
{
LocalAmbientSound("GEIGER", Random(50,127));
}
if (CheckActorFloorTexture(UniqueNoClipTIDB, "NUKAGE1") || CheckActorFloorTexture(UniqueNoClipTIDB, "NUKAGE2") || CheckActorFloorTexture(UniqueNoClipTIDB, "NUKAGE3"))
{
LocalAmbientSound("GEIGER", Random(50,127));
}
if (CheckActorFloorTexture(UniqueNoClipTIDC, "NUKAGE1") || CheckActorFloorTexture(UniqueNoClipTIDC, "NUKAGE2") || CheckActorFloorTexture(UniqueNoClipTIDC, "NUKAGE3"))
{
LocalAmbientSound("GEIGER", Random(50,127));
}
if (CheckActorFloorTexture(UniqueNoClipTIDD, "NUKAGE1") || CheckActorFloorTexture(UniqueNoClipTIDD, "NUKAGE2") || CheckActorFloorTexture(UniqueNoClipTIDD, "NUKAGE3"))
{
LocalAmbientSound("GEIGER", Random(50,127));
}
if (CheckActorFloorTexture(UniqueNoClipTIDE, "NUKAGE1") || CheckActorFloorTexture(UniqueNoClipTIDE, "NUKAGE2") || CheckActorFloorTexture(UniqueNoClipTIDE, "NUKAGE3"))
{
LocalAmbientSound("GEIGER", Random(50,127));
}
delay(5);
}
//after a very short while, remove the wanderers and the loop starts again
Thing_Remove(UniqueNoClipTIDA);
Thing_Remove(UniqueNoClipTIDB);
Thing_Remove(UniqueNoClipTIDC);
Thing_Remove(UniqueNoClipTIDD);
Thing_Remove(UniqueNoClipTIDE);
}
}
During the time the wanders are 'alive' they check for the NUKAGE textures underneath them and if they find it then they will play a random geiger counter sound effect.
You can view the wandering entities flying out of the player by typing the map cheat IDDT twice, first to show the map, second time to show all the entities in the map.
Please let me know if there is anything I am able to do that would make this better or more reliable or if the script could be written less copy-pastey!
Much thanks!