Can projectile change monster's 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
Ahpiox
Posts: 98
Joined: Fri Dec 22, 2017 1:52 am

Can projectile change monster's velocity?

Post by Ahpiox »

I'm making new small mod, in which you can push monsters away. There is a way to make this thing real, and if yes then how?
User avatar
Ahpiox
Posts: 98
Joined: Fri Dec 22, 2017 1:52 am

Re: Can projectile change monster's velocity?

Post by Ahpiox »

Ahpiox wrote:I'm making new small mod, which planned feature is pushing monsters away. There is a way to make this thing real, and if yes then how?
User avatar
phantombeta
Posts: 2088
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Can projectile change monster's velocity?

Post by phantombeta »

Patience is a virtue. This is a forum, not instant messaging. Most users aren't online all the time, and even if they are, they might not be able to answer your question.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Can projectile change monster's velocity?

Post by Caligari87 »

You'd probably be interested in setting the ProjectileKickBack property for your projectiles. That does exactly what you're describing. Weapons can also have the Weapon.KickBack property, which does the same for melee / hitscan attacks.

Alternatively you could do it manually via ZSCript by imparting some of your projectile's velocity (or some static velocity) to whatever it hits, which may offer more consistent / controllable results but requires a little more coding.

8-)
User avatar
Ichor
Posts: 1783
Joined: Wed Jul 23, 2003 9:22 pm

Re: Can projectile change monster's velocity?

Post by Ichor »

Caligari87 wrote:You'd probably be interested in setting the ProjectileKickBack property for your projectiles. That does exactly what you're describing. Weapons can also have the Weapon.KickBack property, which does the same for melee / hitscan attacks.
Does that work for melee attacks as well?
Post Reply

Return to “Scripting”