FastProjectile trails with pitch

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

FastProjectile trails with pitch

Post by The Ultimate DooMer »

This is a FastProjectile that contains a hack to spawn trails close together. Previously this was ok as the shot could only be fired horizontally, but now it can be fired up or down too (in the direction the player is looking). Relevant decorate code is here:
Spoiler:
which currently produces the effect as seen here:
Spoiler:
What I'm trying to do is make the trails into a smooth line, ie. spawn each one at the correct z-height based on the projectile's pitch. I tried using SXF_TRANSFERPITCH as seen on the wiki along with part of the complex formula on the same page (as it's only the z-offset I'm concerned with) but it didn't work. Anyone know to make it work properly?
User avatar
Ethril
Posts: 2677
Joined: Sun Nov 16, 2008 2:59 am
Location: with you in the dark

Re: FastProjectile trails with pitch

Post by Ethril »

The Ultimate DooMer wrote:This is a FastProjectile that contains a hack to spawn trails close together.
[wiki=Classes:FastProjectile]You don't need to use a hack.[/wiki]
The Wiki wrote:The [wiki=Actor_properties#MissileType]MissileType[/wiki] property has a special use for fast projectiles. When one is specified, several (at least eight) are spawned every tic in the projectile's wake, as a trail. The greater the speed, and the smallest (yet non-null) the radius, the more numerous the steps. See [wiki=Classes:MageWandMissile]MageWandMissile[/wiki] for an example of use, and [wiki=Classes:MageWandSmoke]MageWandSmoke[/wiki] for how a trail actor might be defined.
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Re: FastProjectile trails with pitch

Post by The Ultimate DooMer »

heh, I think I even used that at some point but got rid of it at some other point (forgetting both points in the process). Sorted now anyway, thanks.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49226
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: FastProjectile trails with pitch

Post by Graf Zahl »

A nice demonstration of the badness of Doom's movement code, I'd say...
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: FastProjectile trails with pitch

Post by NeuralStunner »

Indeed. I was pleased to discover that normal projectiles are moved in "chunks": And subsequently disappointed to find that they still take all XY movement "chunks" before any Z movement.

FastProjectiles take this a "chunk" at a time, but lack features such as bouncing. (Although they can be seekers, at least.) The ideal would be FP movement with normal missile capabilities...
User avatar
Enjay
 
 
Posts: 26979
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: FastProjectile trails with pitch

Post by Enjay »

Is there any way to get the trail actors to use the same pitch as the fast projectile?

Here's why:

Image

The trail actors have a long thin model associated with them. When firing the main projectile (more or less) horizontally I get the laser beam effect that I'm looking for (the lower red line). However, fire up or down and the continuous laser breaks into a bunch of small steps. Any way round this?


[edit]
Also, while I'm at it. I don't understand this:
The Wiki wrote:The greater the speed, and the smallest (yet non-null) the radius, the more numerous the steps.
I've tried messing with the radius of both the projectile and the trail and neither made any obvious difference to how many trails were spawned. Should they?
User avatar
Nash
 
 
Posts: 17487
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: FastProjectile trails with pitch

Post by Nash »

Use the recently added (yet undocumented) INHERITACTORPITCH flag in MODELDEF.

More info here: http://forum.drdteam.org/viewtopic.php?f=40&t=5570
User avatar
Enjay
 
 
Posts: 26979
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: FastProjectile trails with pitch

Post by Enjay »

Nash wrote:Use the recently added (yet undocumented) INHERITACTORPITCH flag in MODELDEF.
Unfortunately, that doesn't work. My guess is that the feature is doing what it is meant to but the underlying actor is horizontal. ie when a fastprojectile spawns a trail actor, the trail actor does not inherit the pitch of the projectile that spawned it. Given that my models are on the trail and not the projectile the INHERITACTORPITCH is unable to make a visible difference. :?

I wonder if it would be a suitable thing to request that projectile trails get their pitch from the projectile spawning them?
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: FastProjectile trails with pitch

Post by NeuralStunner »

Sounds reasonable to me. It could also allow for trails that move relative to the direction of the projectile, which would be great for complex smoke effects.
User avatar
Enjay
 
 
Posts: 26979
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: FastProjectile trails with pitch

Post by Enjay »

User avatar
MG_Man
Posts: 1401
Joined: Sat Jul 28, 2007 1:24 pm
Contact:

Re: FastProjectile trails with pitch

Post by MG_Man »

(Cross-post from Enjay's thread)

Isn't there a flag for that in A_SpawnItemEx? (SXF_TRANSFERPITCH)

Otherwise, I think the problem is that projectiles in general don't normally have a pitch set -- just their velocities set to move in a certain vertical direction. As stated in the A_SpawnItemEx page, 'pitch' acts as just a variable in projectiles that holds no function (other than for model purposes).

You could use a trig function to set the original projectile's pitch according to the projectile's velocity, then it can be transferred to the trail projectiles through the A_SpawnItemEx flag. Remember, this will have no effect other than rotating a model accordingly if it's set to do that kind of thing.

Code: Select all

AAAA 0 A_SetPitch (sin(velz)/cos(velx))
should do the trick.

Alternatively, if you fired the original projectile using A_SpawnItemEx (instead of A_FireCustomMissile) using the paramaters in the SXF_TRANSFERPITCH example, you could have the pitch transferred directly from the player instead of having it be determined, but I don't know what side effects that would have.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: FastProjectile trails with pitch

Post by Xaser »

The trouble is that he's using this for trails, which are spawned "automatically" by FastProjectiles. The trouble he's having is that these won't inherit pitch info, and since they have no velocity either, there's no way to do this.
Locked

Return to “Editing (Archive)”