The first argument on the placeable actors sets the color of the particles spawned whose sprite consists of a 1x1 square. The particles simply spawn a series of +NoInteraction particles behind them in a line which inherit the color.
Also, I can't seem to get the editor key stuff working in UDB.
Spoiler: ZScriptCode: Select all
class FloorSpark : SwitchableDecoration { //$Arg0 "Color" //$Arg0ToolTip "Color values (0 - 9)" //$Arg0Enum { 0 = "White"; 1 = "Yellow"; 2 = "Orange"; 3 = "Gold"; 4 = "Green"; 5 = "Light Red"; 6 = "Red"; 7 = "Pink"; 8 = "Purple"; 9 = "Blue"; } int translationIdx; static const string spriteList[] = { "PTCW", "PTCY", "PTCO", "PTCG", "PTGN", "PTR1", "PTR2", "PTP1", "PTP2", "PTCB" }; override void BeginPlay() { super.BeginPlay(); translationIdx = Args[0]; if (translationIdx < 0) translationIdx = 0; else if (translationIdx > spriteList.Size() - 1) translationIdx = spriteList.Size() - 1; } virtual float GenerateAngle() { return frandom(0, 360); } virtual float GeneratePitch() { return pitch + 90 + frandom(-15, 15); } virtual Vector3 GenerateVelocity(float a, float p) { Vector3 velocity; float speed = frandom(4.0, 8.0); velocity.x = cos(a) * cos(p) * speed; velocity.y = sin(a) * cos(p) * speed; velocity.z = sin(p) * speed; return velocity; } virtual void SpawnSparkParticles() { float a, p; for (int i=0; i<16; i++) { a = GenerateAngle(); p = GeneratePitch(); let velocity = GenerateVelocity(a, p); Actor particle = Spawn("SparkParticle", pos); particle.vel.x = velocity.x; particle.vel.y = velocity.y; particle.vel.z = velocity.z; particle.A_SetAngle(a); particle.sprite = GetSpriteIndex(spriteList[translationIdx]); } } Default { Height 1; Radius 1; +NoBlockmap; +NoSector; +NoGravity; +DontSplash; } States { Spawn: Active: TNT1 A 1 NoDelay { A_StartSound("World/Spark"); SpawnSparkParticles(); } Goto Inactive; Inactive: TNT1 A -1; stop; } } class WallSpark : FloorSpark { override float GenerateAngle() { return angle + frandom(-15, 15); } override float GeneratePitch() { return frandom(-15, 15); } } class CeilingSpark : FloorSpark { override float GeneratePitch() { return pitch - 90 + frandom(-15, 15); } override Vector3 GenerateVelocity(float a, float p) { Vector3 velocity; float speed = frandom(4.0, 8.0); float vspeed = frandom(0, 4.0); velocity.x = cos(a) * cos(p) * speed; velocity.y = sin(a) * cos(p) * speed; velocity.z = sin(p) * vspeed; return velocity; } Default { +SpawnCeiling; } } class SparkParticle : Actor { virtual int SpawnTail() { int count; let a = VectorAngle(vel.x, vel.y); let p = VectorAngle(vel.xy.Length(), vel.z); Vector3 pPos; for (float i=1; i<vel.Length(); i+=0.5) { pPos.x = pos.x - cos(a) * cos(p) * i; pPos.y = pos.y - sin(a) * cos(p) * i; pPos.z = pos.z - sin(p) * i; let tail = Spawn("SparkParticleTail", pPos); tail.A_SetAngle(a); tail.sprite = sprite; count++; } return count; } override void BeginPlay() { super.BeginPlay(); if (!random(0,7)) { BounceFactor = 0.333; bBounceOnFloors = true; bBounceAutoOff = true; } } Default { Height 1; Radius 1; Projectile; Gravity 0.5; -NoGravity; +DontSplash; +ForceXYBillboard; } States { Spawn: #### A 1 Bright { SpawnTail(); } loop; Death: #### A 0 Bright { SpawnTail(); A_Stop(); } #### BCD 2 Bright A_FadeOut(0.25); stop; SpriteList: PTCW ABCD 0; PTCY ABCD 0; PTCO ABCD 0; PTCG ABCD 0; PTGN ABCD 0; PTR1 ABCD 0; PTR2 ABCD 0; PTP1 ABCD 0; PTP2 ABCD 0; PTCB ABCD 0; stop; } } class SparkParticleTail : SparkParticle { Default { +NoInteraction; } States { Spawn: #### A 2 Bright; stop; } }
Spoiler: Textures LumpCode: Select all
sprite PTCWB0, 1, 1 { patch PTCWA0, 0, 0 } sprite PTCWC0, 1, 1 { patch PTCWA0, 0, 0 } sprite PTCWD0, 1, 1 { patch PTCWA0, 0, 0 } sprite PTCYA0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=227:227"; } } sprite PTCYB0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=227:227"; } } sprite PTCYC0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=227:227"; } } sprite PTCYD0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=227:227"; } } sprite PTCOA0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=211:211"; } } sprite PTCOB0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=211:211"; } } sprite PTCOC0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=211:211"; } } sprite PTCOD0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=211:211"; } } sprite PTCGA0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=249:249"; } } sprite PTCGB0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=249:249"; } } sprite PTCGC0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=249:249"; } } sprite PTCGD0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=249:249"; } } sprite PTGNA0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=112:112"; } } sprite PTGNB0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=112:112"; } } sprite PTGNC0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=112:112"; } } sprite PTGND0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=112:112"; } } sprite PTR1A0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=171:171"; } } sprite PTR1B0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=171:171"; } } sprite PTR1C0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=171:171"; } } sprite PTR1D0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=171:171"; } } sprite PTR2A0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=176:176" } } sprite PTR2B0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=176:176" } } sprite PTR2C0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=176:176" } } sprite PTR2D0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=176:176" } } sprite PTP1A0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=250:250"; } } sprite PTP1B0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=250:250"; } } sprite PTP1C0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=250:250"; } } sprite PTP1D0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=250:250"; } } sprite PTP2A0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=253:253"; } } sprite PTP2B0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=253:253"; } } sprite PTP2C0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=253:253"; } } sprite PTP2D0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=253:253"; } } sprite PTCBA0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=195:195"; } } sprite PTCBB0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=195:195"; } } sprite PTCBC0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=195:195"; } } sprite PTCBD0, 1, 1 { patch PTCWA0, 0, 0 { Translation "4:4=195:195"; } }
Spoiler: GLDefs LumpCode: Select all
pointlight WhiteSpark1 { color 1.0 1.0 1.0 size 8 offset 0 0 0 } pointlight WhiteSpark2 { color 1.0 1.0 1.0 size 6 offset 0 0 0 } pointlight WhiteSpark3 { color 1.0 1.0 1.0 size 4 offset 0 0 0 } pointlight WhiteSpark4 { color 1.0 1.0 1.0 size 2 offset 0 0 0 } pointlight YellowSpark1 { color 1.0 1.0 0.56 size 8 offset 0 0 0 } pointlight YellowSpark2 { color 1.0 1.0 0.56 size 6 offset 0 0 0 } pointlight YellowSpark3 { color 1.0 1.0 0.56 size 4 offset 0 0 0 } pointlight YellowSpark4 { color 1.0 1.0 0.56 size 2 offset 0 0 0 } pointlight OrangeSpark1 { color 1.0 0.78 0.6 size 8 offset 0 0 0 } pointlight OrangeSpark2 { color 1.0 0.78 0.6 size 6 offset 0 0 0 } pointlight OrangeSpark3 { color 1.0 0.78 0.6 size 4 offset 0 0 0 } pointlight OrangeSpark4 { color 1.0 0.78 0.6 size 2 offset 0 0 0 } pointlight GoldSpark1 { color 1.0 0.9 0.29 size 8 offset 0 0 0 } pointlight GoldSpark2 { color 1.0 0.9 0.29 size 6 offset 0 0 0 } pointlight GoldSpark3 { color 1.0 0.9 0.29 size 4 offset 0 0 0 } pointlight GoldSpark4 { color 1.0 0.9 0.29 size 2 offset 0 0 0 } pointlight GreenSpark1 { color 0.46 1.0 0.43 size 8 offset 0 0 0 } pointlight GreenSpark2 { color 0.46 1.0 0.43 size 6 offset 0 0 0 } pointlight GreenSpark3 { color 0.46 1.0 0.43 size 4 offset 0 0 0 } pointlight GreenSpark4 { color 0.46 1.0 0.43 size 2 offset 0 0 0 } pointlight Red1Spark1 { color 1.0 0.6 0.6 size 8 offset 0 0 0 } pointlight Red1Spark2 { color 1.0 0.6 0.6 size 6 offset 0 0 0 } pointlight Red1Spark3 { color 1.0 0.6 0.6 size 4 offset 0 0 0 } pointlight Red1Spark4 { color 1.0 0.6 0.6 size 2 offset 0 0 0 } pointlight Red2Spark1 { color 1.0 0 0 size 8 offset 0 0 0 } pointlight Red2Spark2 { color 1.0 0 0 size 6 offset 0 0 0 } pointlight Red2Spark3 { color 1.0 0 0 size 4 offset 0 0 0 } pointlight Red2Spark4 { color 1.0 0 0 size 2 offset 0 0 0 } pointlight PinkSpark1 { color 1.0 0.48 1.0 size 8 offset 0 0 0 } pointlight PinkSpark2 { color 1.0 0.48 1.0 size 6 offset 0 0 0 } pointlight PinkSpark3 { color 1.0 0.48 1.0 size 4 offset 0 0 0 } pointlight PinkSpark4 { color 1.0 0.48 1.0 size 2 offset 0 0 0 } pointlight PurpleSpark1 { color 0.62 0 0.6 size 8 offset 0 0 0 } pointlight PurpleSpark2 { color 0.62 0 0.6 size 6 offset 0 0 0 } pointlight PurpleSpark3 { color 0.62 0 0.6 size 4 offset 0 0 0 } pointlight PurpleSpark4 { color 0.62 0 0.6 size 2 offset 0 0 0 } pointlight BlueSpark1 { color 0.56 0.56 1.0 size 8 offset 0 0 0 } pointlight BlueSpark2 { color 0.56 0.56 1.0 size 6 offset 0 0 0 } pointlight BlueSpark3 { color 0.56 0.56 1.0 size 4 offset 0 0 0 } pointlight BlueSpark4 { color 0.56 0.56 1.0 size 2 offset 0 0 0 } object SparkParticle { frame PTCWA { light WhiteSpark1 } frame PTCWB { light WhiteSpark2 } frame PTCWB { light WhiteSpark3 } frame PTCWC { light WhiteSpark4 } frame PTCYA { light YellowSpark1 } frame PTCYB { light YellowSpark2 } frame PTCYC { light YellowSpark3 } frame PTCYD { light YellowSpark4 } frame PTCOA { light OrangeSpark1 } frame PTCOB { light OrangeSpark2 } frame PTCOC { light OrangeSpark3 } frame PTCOD { light OrangeSpark4 } frame PTCGA { light GoldSpark1 } frame PTCGB { light GoldSpark2 } frame PTCGC { light GoldSpark3 } frame PTCGD { light GoldSpark4 } frame PTGNA { light GreenSpark1 } frame PTGNB { light GreenSpark2 } frame PTGNC { light GreenSpark3 } frame PTGND { light GreenSpark4 } frame PTR1A { light Red1Spark1 } frame PTR1B { light Red1Spark2 } frame PTR1C { light Red1Spark3 } frame PTR1D { light Red1Spark4 } frame PTR2A { light Red2Spark1 } frame PTR2B { light Red2Spark2 } frame PTR2C { light Red2Spark3 } frame PTR2D { light Red2Spark4 } frame PTP1A { light PinkSpark1 } frame PTP1B { light PinkSpark2 } frame PTP1C { light PinkSpark3 } frame PTP1D { light PinkSpark4 } frame PTP2A { light PurpleSpark1 } frame PTP2B { light PurpleSpark2 } frame PTP2C { light PurpleSpark3 } frame PTP2D { light PurpleSpark4 } frame PTCBA { light BlueSpark1 } frame PTCBB { light BlueSpark2 } frame PTCBC { light BlueSpark3 } frame PTCBD { light BlueSpark4 } }