Destructable corpses

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
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Destructable corpses

Post by MartinHowe »

I have a system set up whereby when certain monsters are killed, they set themselves solid, unshootable, height 1 and health 1.

They enter a state looping waiting to be "killed" again when a missile hits them (a script will set all such objects on the map to be shootable, remove the CORPSE flag and give them a sensible height just before it happens).

However, I cannot get the missile to interact with them :( Yet if I use a script to explicitly damage them, it works fine.

The issue is that it must be the missile that triggers their "final" death, as the script would simply do it for all of them at the same time. There are several missiles being fired around the map from the epicenter, and corpses further away from the epicentre should detonate later than the ones near the missile source, as the missile spread fans out.

Basically, corpses that can be destroyed if something of sufficient damage hits them.

Am I doing something really silly here to make it not work, or is there some minimally documented thing done in the engine to dead things?
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
Contact:

Re: Destructable corpses

Post by Matt »

The way you're wording it implies that these missiles are moving in a generally horizontal direction but your corpses are height 1. Are they even hitting?

How are you changing health? Setting health directly ("health=1;", etc.) will result in undesired side effects.

As far as I'm aware the corpse cannot be made to enter into a pain or death state without overriding DamageMobj, which I think would be the cleanest way to do this anyway.
User avatar
MartinHowe
Posts: 2022
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom
Contact:

Re: Destructable corpses

Post by MartinHowe »

Matt wrote:The way you're wording it implies that these missiles are moving in a generally horizontal direction but your corpses are height 1. Are they even hitting?

How are you changing health? Setting health directly ("health=1;", etc.) will result in undesired side effects.

As far as I'm aware the corpse cannot be made to enter into a pain or death state without overriding DamageMobj, which I think would be the cleanest way to do this anyway.
Well this is in DECORATE rather than ZScript. I think the way I was originally trying to do it is one of the "DON'T DO THAT"'s :)
What I have now seems to work, so maybe I have hit on the right thing after all. Needs more testing to be sure though.
Post Reply

Return to “Scripting”