Make a monster in it's death state react to projectiles?

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

Make a monster in it's death state react to projectiles?

Post by Mini--Joe »

How do I make a monster in it's death state react to projectiles?

I have a SSG that shoots a bunch of small projectiles that each have a small amount of A_Radiusthrust. I want the amount of projectiles combined thrust to send the monster flying back, but when the monster dies, the rest of the projectiles just pass through it.

How would I get the effect I want?
User avatar
Tartlman
Posts: 226
Joined: Thu Oct 11, 2018 5:24 am
Location: meme hell

Re: Make a monster in it's death state react to projectiles?

Post by Tartlman »

Simply set it to the unshootable state at the end of the death animation.
At least i hope that works.

Edit: You may have some unforeseen consequences if you want to make a monster react to projectiles in its death state. For example, normally you could probably take down 4 zombiemen with one ssg shot, but since bullets won't pass through on death you'll probably only kill one. I don't think there's a good way to fix this.
User avatar
Dr_Cosmobyte
Posts: 2847
Joined: Thu Jun 04, 2015 9:07 pm
Preferred Pronouns: He/Him
Location: Killing spiders.

Re: Make a monster in it's death state react to projectiles?

Post by Dr_Cosmobyte »

maybe you could make the monster spawn a copy of itself which would be just like a normal monster, but it stays on a static sprite (the last on in death sequence, obviously), doesn't attack the playre and doesn't count on kills.
User avatar
Apeirogon
Posts: 1606
Joined: Mon Jun 12, 2017 12:57 am

Re: Make a monster in it's death state react to projectiles?

Post by Apeirogon »

In decorate you can set on monster budda flag and use A_JumpIfHealthLower(2, "state name") at the beginning of the pain/idle/see state to throw monster into specific state in which you unset budda flag and take last 1-2 hp of a monster and send him to death state.
Or make projectile which give to monster inventory some dummy item, amount of which then counts in first death state sequence and then multiply by this number it speed.

But better use zscript. It much more flexible and dont require calling to hackermans, bug-o-users and gods of a program crutch for such a thing.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Make a monster in it's death state react to projectiles?

Post by Matt »

I think, without having tested it, it would work set it back to +shootable at the very instant of death ("override void Die()" or the first death state sprite). This has consequences for autoaim, however, and possibly other effects that can get a lot weirder and more frustrating to debug than shotguns no longer being grossly overpowered.

Failing that, I know it works to spawn at the instant of death a second actor that takes the hits from the rest of the shotgun blast. This actor should have the same bloodcolor and last at least a couple ticks to take care of any projectiles coming in very quickly but not instantly after the first set.
User avatar
Niphura
Posts: 192
Joined: Fri Jun 16, 2017 3:07 pm
Location: Argentina

Re: Make a monster in it's death state react to projectiles?

Post by Niphura »

I was asking something similar, how can I make an enemy react in this way?

https://youtu.be/_OjmmX1oqBk?t=175

I mean that when you shoot him he is suspended for a while in the air and that you can shoot him again sending him higher. is it possible on doom?

Return to “Scripting”