Projectile that gives a monster Z-Velocity?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

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!)
Post Reply
User avatar
Mini--Joe
Posts: 96
Joined: Sun Jul 27, 2014 10:25 am

Projectile that gives a monster Z-Velocity?

Post by Mini--Joe »

I'm trying to make a weapon that has multiple attacks, and one of them is an uppercut. I made the attack shoot out an invisible projectile, and I'm trying to get that projectile to launch monsters upwards. I've tried ThrustThingZ, but clearly that does not work. Any tips?
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Projectile that gives a monster Z-Velocity?

Post by Caligari87 »

If it "clearly doesn't work" then you're likely doing something wrong, as that's pretty much the kind of thing "ThrustThingZ" is designed to do. Please post the relevant code (using the

Code: Select all

 and [spoiler] tags, or pastebin if necessary) so we can see what you're doing and provide some advice.

8-)
User avatar
Mini--Joe
Posts: 96
Joined: Sun Jul 27, 2014 10:25 am

Re: Projectile that gives a monster Z-Velocity?

Post by Mini--Joe »

Spoiler:
Here it is.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Projectile that gives a monster Z-Velocity?

Post by Blue Shadow »

What you're doing there is changing the velocity of the projectile itself, not the thing it hit. To make it work, set the [wiki=Actor_flags#HITMASTER]HITMASTER[/wiki] flag on the projectile, and use [wiki]A_ChangeVelocity[/wiki] with the desired Z velocity value while passing AAPTR_MASTER as the ptr parameter.
User avatar
Mini--Joe
Posts: 96
Joined: Sun Jul 27, 2014 10:25 am

Re: Projectile that gives a monster Z-Velocity?

Post by Mini--Joe »

Oh sweet, thank you so much! Works perfectly.

I looked at the actor pointers and "AAPTR_LINETARGET" also seems to work even when HITMASTER is not set.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Projectile that gives a monster Z-Velocity?

Post by Blue Shadow »

I can't tell you anything about AAPTR_LINETARGET in this case. So unless you get confirmation that it's fine to use, I'd recommend that you stick with the HIT flag method.
Post Reply

Return to “Scripting”