Page 1 of 1

Actor make a sound when player walks through it - how?

Posted: Sat Oct 04, 2025 6:31 am
by Enjay
I have a very simple ZScript decoration. It has no collision and minimal height, and it simply exists to allow a flat-plane model to be placed in game. The model looks like a drain cover and doing it this way allows me to place drain covers wherever I need them to be without being tied to the appearance of background flats and flat offsets.

However, it would be nice if, as the player walked "on" (i.e. through - but bear in mind the actor is only around 1 or 2 units tall IIRC) the actor made the "clang" sound of the player walking on a metal surface.

What would be the best way to do that? I'm sure that a bit of cunning ZScript code could probably check that the player had entered the actor's bounding box and make a sound, but I don't know how to do it. Can anyone suggest/share code for that feature?

I could do it by making a 64x64 sector everywhere that I place the actor and just use ACS scripting to make the sound when the player enters the sector, but that kind of defeats some of the purpose of having a flexible actor that can be placed anywhere.

Re: Actor make a sound when player walks through it - how?

Posted: Thu Oct 16, 2025 2:52 am
by JaedenDuhreis
I would give +SPECIAL flag to the decoration and override its Touch() virtual to make the sound.