its jonny5s weather script. it used to compile but ever since upgrading to a new version of gzdoom it wont compile.
first is the ACS in the .wad
the second is the ACS placed in the map scripts.
please let me know if you see any reason why it wont compile.
Spoiler:
#library "weather"
#include "zcommon.acs"
#define PlayerTID 255 //player TID assigned - this can be changed.
//WeatherFX by Jon Washburn
//Feel free to use this in your own projects, just give credit.
//Also drop me a line at jon-washburn@nyc.rr.com if you like it!
int WFX_Upper_TID[100]; //Upper left bound thing for weather zone
int WFX_Lower_TID[100]; //Lower right bound thing for weather zone
str WFX_Type[100]; //Weather effect type TID array
int WFX_Density[100]; //Weather zone density
int WFX_Distance[100]; //Distance at which the weather fades out
int WFX_IgnorePlayer[100]; //1 = ignore player distance, 0 = use player distance
int WFX_Active[100]; //1 = weather zone is active, 0 = weather zone is inactive
int WFX_WeatherZones; //number of weather zones in the map
int WFX_NoWeather=0; //Adjusted Automatically using scripts
//This is the main weather spawning function
function void SpawnWeatherEffect (int UpperLeft, int LowerRight, str WeatherType, int Distance, int Density, int IgnorePlayer)
{
int xMin=0; 1024
int xMax=0; 1024
int yMin=0; 1024
int yMax=0; 1024
int xSpawnMin=0; 1024
int xSpawnMax=0; 1024
int ySpawnMin=0; 1024
int ySpawnMax=0; 1024
int xPlay=0; 1024
int yPlay=0; 1024
int xSpawn=0; 1024
int ySpawn=0; 1024
int zSpawn=0; 1024
//Get default spawn x and y max/min from map spots
xSpawnMin=GetActorX(UpperLeft)/65536;
xSpawnMax=GetActorX(LowerRight)/65536;
zSpawn=GetActorZ(UpperLeft)/65536;
ySpawnMin=GetActorY(LowerRight)/65536;
ySpawnMax=GetActorY(UpperLeft)/65536;
xMax=xSpawnMax; 1024
xMin=xSpawnMin; 1024
yMax=ySpawnMax; 1024
yMin=ySpawnMin; 1024
//Get player coordinates, if the weather zone isn't ignoring player position
if (IgnorePlayer==0)
{
xPlay=GetActorX(PlayerTID)/65536; 1024
yPlay=GetActorY(PlayerTID)/65536; 1024
//Calculate max/min values based on the position of the player.
//This attempts to center the effects around the player.
xMax=xPlay+Distance; 1024
xMin=xPlay-Distance; 1024
yMax=yPlay+Distance; 1024
yMin=yPlay-Distance; 1024
}
//Prevent effects from spawning outside the area bound by the spawn spots.
if (xMax>=xSpawnMax) {xMax=xSpawnMax; 1024}
if (xMin<=xSpawnMin) {xMin=xSpawnMin; 1024}
if (yMax>=ySpawnMax) {yMax=ySpawnMax; 1024}
if (yMin<=ySpawnMin) {yMin=ySpawnMin; 1024}
for (int i=0;i < Density;i++)
{
xSpawn=Random(xMin,xMax); 1024
ySpawn=Random(yMin,yMax); 1024
if (xSpawn <= xMax && xSpawn >= xMin && ySpawn <= yMax && ySpawn >= yMin)
{
Spawn(WeatherType,(xSpawn*65536),(ySpawn*65536),(zSpawn*65536));
}
}
}
//Set the player TID to get position information
script 940 enter
{
Thing_ChangeTID (0, PlayerTID) ; 255
if (CheckInventory("Action_WeatherToggle")==0) GiveInventory("Action_WeatherToggle",1);
if (CheckInventory("Flag_NoWeather")==1) WFX_NoWeather=1;
if (CheckInventory("Flag_NoWeather")==0) WFX_NoWeather=0;
}
//Switch the weatherFX stuff off and on
script 941 (void)
{
if (CheckInventory("Flag_NoWeather")==1) WFX_NoWeather=1;
if (CheckInventory("Flag_NoWeather")==0) WFX_NoWeather=0;
}
//This is the map script to spawn weather effects
script 950 (int DelayTime)
{
while(true)
{
for(int i=0;i<WFX_WeatherZones;i++)
{
if (WFX_Active==1 && WFX_NoWeather==0) {SpawnWeatherEffect(WFX_Upper_TID,WFX_Lower_TID,WFX_Type,WFX_Distance,WFX_Density,WFX_IgnorePlayer);}
}
delay(DelayTime);
}
}
Spoiler:
//#import "weather.acs"
//MAP ENTRANCE SCRIPTS
//script 1 open
//WFX_WeatherZones=1;
//WFX_Upper_TID[0]=7;
//WFX_Lower_TID[0]=8;
//WFX_Type[0]="RainSpawner";
//WFX_IgnorePlayer[0]=0;
//WFX_Distance[0]=1024;
//WFX_Density[0]=128;
//WFX_Active[0]=1;
//Execute the weatherFX script
//ACS_Execute(950,0,10,0,0);
//}