Quantcast
Channel: ZDoom
Viewing all articles
Browse latest Browse all 3391

Scripting • Re: How do i make this detect enemies?

$
0
0
I have something similar to this that I got to work. This is a little hacky, but, I created a custom puff for the punch. In the custom puff actor's states, you can have separate states if you only want the effect to happen when you hit an actor, or a wall or such.

Then in the state you want the effect to happen you add this:

Code:

A_RadiusGive("CustomInventory",64,RGF_PLAYERS,1);
This gives an item to the closest player within 64 map units. You can change the range if you need it to be larger.

Then you just have the weapon state check if the player has that inventory item:

Code:

PUNG D 0 A_JumpIfInventory("CustomInventory",1,"Hit");
Make sure you have a frame that removes it from your inventory after, such as at the beginning of the Ready state.

Statistics: Posted by Heisanevilgenius — Tue May 20, 2025 11:10 am



Viewing all articles
Browse latest Browse all 3391

Trending Articles