Well, copying straight from my mod the scripts:
DECORATE
Code: Select all
Actor AirStrikeBeacon
{
Radius 16
Height 16
Mass 10
Speed 4
BounceFactor 0.0
-SHOOTABLE
-CANBLAST
States
{
Spawn:
MINE A 0 A_Gravity
BEAC ABABA 35
BEAC A 0 ACS_NamedExecuteAlways("AirStrikeTest",0)
goto idle
Idle:
BEAC AB 10
Loop
Death:
BEAC A 1 A_FadeOut(0.015)
Loop
}
}
ACS
Code: Select all
script "AirStrikeTest" (void)
{
int CenterTID = ActivatorTID();
int MissileID = UniqueTID();
int timepast = 0;
int failcount = 0 ;
while ( timepast < 400 )
{
if (failcount >= 100)
{
failcount = 0;
delay(5);
timepast++;
}
int x = GetActorX(CenterTID) + random(-768.0, 768.0);
int y = GetActorY(CenterTID) + random(-768.0, 768.0);
int z = GetActorCeilingZ(CenterTID);
if (!(Spawn("Airstrikemissile", x, y, z, MissileID)))
{
failcount++;
continue;
}
else
{
if ((CheckActorCeilingTexture(MissileID,"F_SKY1")) || (CheckActorCeilingTexture(MissileID,"F_SKY2")) || (CheckActorCeilingTexture(MissileID,"F_SKY3")) || (CheckActorCeilingTexture(MissileID,"F_SKY4")) || (CheckActorCeilingTexture(MissileID,"SKY1")) || (CheckActorCeilingTexture(MissileID,"SKY2")) || (CheckActorCeilingTexture(MissileID,"SKY3")) || (CheckActorCeilingTexture(MissileID,"SKY2A")) || (CheckActorCeilingTexture(MissileID,"SKYFOG")) || (CheckActorCeilingTexture(MissileID,"SKYFOG2")) || (CheckActorCeilingTexture(MissileID,"SKY")) || (CheckActorCeilingTexture(MissileID,"F_SKY")))
{
if ((GetActorCeilingZ (MissileID) - GetActorFloorZ (MissileID)) < 16)
{
Thing_Remove(MissileID);
failcount++;
Continue;
}
else
{
SetActorPosition(MissileID, x,y,GetActorCeilingZ(MissileID) - 4.0, 0);
}
}
else
{
Thing_Remove(MissileID);
failcount++;
Continue;
}
Thing_ChangeTID(MissileID, 0);
delay(5);
timepast++;
}
}
Thing_Remove(CenterTID);
}
What it does in short: A beacon after a short while summons a few hundred missiles from sky in a significant radius.
What it does in long: The script is called from the decorate actor once, and only once.
The script first sets a TID to the actor, to be able to reference it easily.
The timepast variable is used to count how many missiles have been already spawned
The failcount is a safety variable, in case there are no valid places to spawn a missile, it will eventually terminate the script.
"if (!(Spawn("Airstrikemissile", x, y, z, MissileID)))" <- this both spawns a missile as well as checks for success. It adds a TID to the missile to reference it later.
The latter large "if" block is the thing you want the most - this tests if the location where missile spawns has the sky. If not, the missile is removed.
In your case the "beacon" should be spawned at the player's location, and then a similar script should be ran.
Hope it isn't too confusing
