A_SpawnItemEx momentum for trails

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
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

A_SpawnItemEx momentum for trails

Post by Ghastly »

Ran into a bit of a snag with A_SpawnItemEx. I was making a trail for a fast (35 speed, YES, I double-checked to make sure) projectile, so I thought I'd give it some momentum to keep up with the projectile (so it doesn't end up too spread out). X momentum was easy, but Z momentum was a little tricky, so I put (MomZ/1.2) in there, and it worked fine. The problem is, the trail is now going slightly faster than the projectile itself. I worked and looked fine, and I didn't even notice it until I lowered the alpha on the trail.

Here's the code. Projectile's speed is 35 (28 is 80% of it, so it fits in with the Z momentum):

Code: Select all

LACR AAABBB 1 Bright A_SpawnItemEx("LasceratorTrail", 0, 0, 0, 28, 0, (MomZ/1.2), 0, 128)
I also tried this, which worked, but had the same problem, the trail was going faster than the projectile (notice the Absolute Momentum flag):

Code: Select all

LACR AAABBB 1 Bright A_SpawnItemEx("LasceratorTrail", 0, 0, 0, (MomX/1.2), (MomY/1.2), (MomZ/1.2), 0, 136)
Here's a screenshot. The actual projectile has higher alpha and is plainly visible at the back of the trail:
Image
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: A_SpawnItemEx momentum for trails

Post by XutaWoo »

You do realize the trail is actually going faster, right? Try 1.0 or 0.9.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: A_SpawnItemEx momentum for trails

Post by Ghastly »

35 divided by 1.2 is 28 (same as multiplying by 0.8), actually. It had the same problem when it was just set as 28.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: A_SpawnItemEx momentum for trails

Post by Amuscaria »

Would A_SpawnItemEx work well in your situation? Try aiming up/down and see if the spawned trails fly off in random directions. Cuz it does for me.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: A_SpawnItemEx momentum for trails

Post by Ghastly »

I'm already using A_SpawnItemEx.

It seems like it's spawning the projectiles at the designated momentum away from the projectile itself, so I tried this:

Code: Select all

LACR AAABBB 1 Bright A_SpawnItemEx("LasceratorTrail", -28, 0, (MomZ/1.2*-1), 28, 0, (MomZ/1.2), 0, 128)
To compensate for that, and now it works fine horizontally:
Image
But when it fires at more extreme vertical angles:
Image

Anyone have any ideas?

Edit: Oh, no it's not being fired straight up. It's about a 50-60 degree angle.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: A_SpawnItemEx momentum for trails

Post by Ghastly »

Bump.

Anyone have any ideas?
Locked

Return to “Editing (Archive)”