I only know about ZScript, not much on Decorate, but I think that for this to work you need to convert this Actor from decorate to ZScript. It is pretty simple.
Code: Select all
Class RandomExplosion : Actor
{
Default
{
Radius 16;
Height 16;
Scale 0.8;
RenderStyle "Translucent";
Alpha 0.8;
+LOOKALLAROUND;
+AMBUSH;
+QUICKTORETALIATE;
}
States
{
Spawn:
TNT1 A 0;
TNT1 AA 6 A_LookEx; //keeps a loot out for the player passing by
Loop;
See:
TNT1 AA 6 A_JumpIfInTargetLOS("DecideToExplodeOrNot", 180, 0, 256); //if this actor is within 180° of player fov goto state
Stop;
DecideToExplodeOrNot:
TNT1 A 0;
TNT1 A 0 A_Jump(256, "ExplosionDeath", "NoExplosionDeath"); //to explode or not explode, that is the question
Stop;
ExplosionDeath:
TNT1 A 0;
TNT1 A 0 A_Quake (2, 35, 128, 512, 0); //rumble the screen with damage if close
CRXP ABCDEFGHIJKLMNOP 1 Bright Light("FIRELIGHT") A_SpawnProjectile("CrowSplosion01", random(90.0, 110.0), 0, random(0, 360), 2, random(90, -90), 0); //chuck out some other projectiles, they work fine
CRXP QRSTUVWXYZ 1 Bright Light("FIRELIGHT");
CRXQ ABCDEFGHI 1 Bright Light("FIRELIGHT");
Stop;
NoExplosionDeath:
TNT1 A 0;
TNT1 A -1; //no explosion state
Stop;
}
}
Then you can modify ExplosionDeath state, add something like this:
Code: Select all
ExplosionDeath:
TNT1 A 0;
TNT1 A 0 A_Quake (2, 35, 128, 512, 0); //rumble the screen with damage if close
CRXP ABCDEFGHIJKLMNOP 1 Bright Light("FIRELIGHT") A_SpawnProjectile("CrowSplosion01", random(90.0, 110.0), 0, random(0, 360), 2, random(90, -90), 0); //chuck out some other projectiles, they work fine
CRXP QRSTUVWXYZ 1 Bright Light("FIRELIGHT");
CRXQ ABCDEFGHI 1 Bright Light("FIRELIGHT");
TNT1 A 0 ChangeSector(-32.0);
Stop;
And add function
Code: Select all
void ChangeSector(double dh)
{
Sector sec = CurSector;
SecPlane floor = sec.floorplane;
floor.ChangeHeight(dh);
}
But I don't know if it works, can't test it right now. You can check all the functions and stuff you can do with sectors in ZScript, in gzdoom.pk3, look for mapdata.txt inf ZScript folder.
BTW I remember that ZSCript classes don't show up on DoomBuilder properly, you needed to do something for that, but I can't remember what it was

Also you must create ZSCRIPT lump in your mod file and include your file with this new class.