stomp kill

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
memredi
Posts: 58
Joined: Thu Jan 31, 2019 5:18 pm
Location: Galactic Khaghanate

stomp kill

Post by memredi »

hey all

how do i make an actor that can be killed by stomping on? I mean when the player stands on the actor actor gets killed so how do I make it?

thanks
User avatar
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

Re: stomp kill

Post by TDRR »

Maybe giving every frame of the player's actor A_CustomBulletAttack(0, 9, 1, 10, "BulletPuff", 32, CBAF_EXPLICITANGLE|CBAF_NOPITCH) would work
Not sure if the pitch (second parameter) is the correct one, you may try to increase or decrease it to be sure, using chasecam will make it easier to see.

Doing that should make the player constantly fire a bullet downwards, so anything under it's foot will recieve 10 of damage every 2 or 4 tics.
Last edited by TDRR on Sun Feb 10, 2019 12:24 pm, edited 1 time in total.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: stomp kill

Post by Enjay »

It depends what you are trying to do but the +TOUCHY flag might be of use here. To quote the wiki, an actor with this flag "dies at the slightest touch". It can be useful for landmines and the like.
User avatar
memredi
Posts: 58
Joined: Thu Jan 31, 2019 5:18 pm
Location: Galactic Khaghanate

Re: stomp kill

Post by memredi »

remember those cockroaches from half life 1, yeah. I'm trying to do the similar thing to these. I'm trying to do some small rat. Does it count?
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: stomp kill

Post by Enjay »

If you just want them to be small, get squished easily and not attack the player, the TOUCHY flag would do it (in fact, I have used it for almost exactly that in the past). However, if you want the rats to actually pose some kind of threat (i.e. attack the player)* it probably wouldn't work because as soon as they come into contact with the player to bite him they would die (I assume).

*For what it's worth, I personally find I personally find tiny rat/bat/insect (etc) enemies to be some of the ultimate pointless and unrealistic annoyances in games: too hard to see; too hard to damage and generally doing far too much damage for their size.
Laerrus
Posts: 14
Joined: Mon Oct 02, 2023 12:27 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Win 7
Graphics Processor: Not Listed

Re: stomp kill

Post by Laerrus »

You have to use A_Explode on your player frames and tell it not to kill the player with XF_NOTAMISSILE I think it is. I was trying to figure this out myself and just got it working. There is a bit of a delay though but it works.
Post Reply

Return to “Scripting”