FastProjectile trails to inherit pitch from the projectile

Moderator: GZDoom Developers

Post Reply
User avatar
Enjay
 
 
Posts: 26979
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

FastProjectile trails to inherit pitch from the projectile

Post by Enjay »

Rising from a discussion in this thread:

http://forum.zdoom.org/viewtopic.php?f=3&t=33044

It would be useful if the trails spawned by fastprojectiles could inherit the pitch of the projectile that spawned them.
User avatar
MG_Man
Posts: 1401
Joined: Sat Jul 28, 2007 1:24 pm
Contact:

Re: FastProjectile trails to inherit pitch from the projecti

Post by MG_Man »

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.
Gez
 
 
Posts: 17939
Joined: Fri Jul 06, 2007 3:22 pm

Re: FastProjectile trails to inherit pitch from the projecti

Post by Gez »

MG_Man wrote:Isn't there a flag for that in A_SpawnItemEx? (SXF_TRANSFERPITCH)
Yeah, but you can't replicate FastProjectile trails with A_SpawnItemEx.
User avatar
MG_Man
Posts: 1401
Joined: Sat Jul 28, 2007 1:24 pm
Contact:

Re: FastProjectile trails to inherit pitch from the projecti

Post by MG_Man »

My bad, I thought this was referring to the method The Ultimate DooMer used in the first post of the other thread.

I think with modification that can still be used to get what he wants. Let me play with it for a bit.


Otherwise, this is just sidestepping the original request which I think would be useful. Just remember that the original projectile still probably won't have the pitch transferred from the player unless A_FireCustomMissile was modified as well, so you'll still need to use one of my earlier methods.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”