Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
grommile

Implementing a death exit in ACS

Recommended Posts

I looked at ACS and thought "hey, neat, I can do things like damage the player or exit the level". I then inferred that this should enable me to implement a death exit.

I wrote an ENTRY script which gives every player a Thing ID, and an ordinary script which does 20000 damage to every player then calls Exit_Normal(0). Script written, I set up a linedef in my UDMF-format Doom II level to use the ACS_Execute action, triggering on Player Use and invoking my newly created script.

When I run the level in Eternity, the script kills the player just fine, but doesn't then exit the level. If I comment out the "kill the player" part, the script exits the level just fine, but the player isn't dead so of course they have a full inventory in the next level.

What am I missing? (Apart from any question of whether death exits are a good feature.)

Share this post


Link to post

In the OPTIONS lump you'll need to set comp_zombie to 0. Exit_Normal only works if(!EV_isZombiePlayer(instance->actor)). Do NOT try to trick EV_isZombiePlayer by healing the player for 1, as this behaviour seems unintended and WILL be patched out if ZDoom also checks if the player is a zombie (for parity).

Share this post


Link to post

To be honest, I see nothing to be gained by preventing zombie players from exiting a level.
I think I'll keep the current behavior of only preventing it for intra-hub map changes.

Share this post


Link to post

Yeah, that compatflag seems like a clear case of something that ought to be set to the sensible option by default, and arguably doesn't even need to be exposed in the menu at all, IMO. If it's needed for hubs, I'd just enable it when hubs are in use.

Share this post


Link to post

Personally I'd like to see more granularity, since the comp setting is a bit sweeping in what it affects. I dunno how I'd go about that though. Compat stuff isn't really something I want to touch much, if at all.

Share this post


Link to post

Yes, a silly option in the first place (introduced in MBF, I think), and incorrectly described - it actually prevents any dead players from exiting a map (thus breaking some maps' intended behaviour dating back to at least 1996), and not just zombie players.

The in-menu description was changed in Prboom-plus, BTW.

Share this post


Link to post

I think sometimes it's possible for zombie (not just dead) players to exit levels and turn into something even worse than zombies, who can do even less, and can potentially be stuck forever in this mode, because among other things, they can't trigger monsters, use switches or fire weapons. I guess that's why Lee feared this effect.

Share this post


Link to post

I don't know if there's something specific about the death exit that I'm failing to understand, but wouldn't ClearInventory(); be an easier / better solution?

script 50 (void)
{
	ClearInventory();
	GiveInventory("Fist", 1);
}

Share this post


Link to post

ClearInventory isn't in Eternity yet. It'll probably make its way in once EDF inventory is fully complete (including stuff like weapons and keys).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×