Quake 1 Style Lightning Trails

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
TheSeventh
Posts: 15
Joined: Wed Oct 24, 2018 9:04 am
Location: +NOGRAVY

Quake 1 Style Lightning Trails

Post by TheSeventh »

So I'm trying to emulate the lightning trails like from Quake 1's lightning gun but I've ran into an odd issue.

It seems like every 8 actors the pitch is not being set properly as per the A_FaceTarget.

And I only noticed this because I was looking closely in the test map


The zscript code looks like this:

Code: Select all

class ZapShot : FastProjectile replaces PlasmaBall
{
	Default
	{
		Radius 4;
		Height 8;
		Speed 360;
		Damage 0;
		+FLATSPRITE
		+CANNOTPUSH
		+NODAMAGETHRUST
		-SKYEXPLODE
		MissileType "ZapTrail";
		MissileHeight 0;
	}
	States
	{
	Spawn:
		TNT1 A 4;
		Loop;
	Death:
		TNT1 A 1;
		Stop;
	}
}

class ZapTrail : Actor
{
	Default
	{
		+NOBLOCKMAP
		+NOGRAVITY
		+SHADOW
		+NOTELEPORT
		+CANNOTPUSH
		+NODAMAGETHRUST
	}
	States
	{
	Spawn:
		FRAM A 0;
		FRAM A 0 A_FaceTarget(0,0);
	Stay: //For testing purposes
		FRAM A 4 Bright A_SetRoll(random(0,359));
		Loop;
		//Stop;
	}
}
I've fiddled with using a pointer but it produces the same result.

I've also attached the .zip of the scripts and the model in question.
You do not have the required permissions to view the files attached to this post.

Return to “Scripting”