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

Defining a drowning-mimicing damage type

Recommended Posts

Hi!

Is it possible to define your own damage type that would drain the air supply before damaging the player? I'm trying to create an effect of suffocating in space. The player could still breathe for a while before starting to take damage.

Has anyone stumbled upon a similar problem? Any ideas?

Share this post


Link to post
Herska said:

Hi!

Is it possible to define your own damage type that would drain the air supply before damaging the player? I'm trying to create an effect of suffocating in space. The player could still breathe for a while before starting to take damage.

Has anyone stumbled upon a similar problem? Any ideas?

You could use a looping script with SetAirSupply each tick, but I don't know if running out of air does anything if the game thinks you're not underwater, in which case said script could just damage you after a certain length of time. The SecActEnter and SecActExit things can be used to start and stop the script, if necessary.

Share this post


Link to post

int spaceoxygen = 350;

script 8 (void) //Suffocating (enter sector)

{
if (spaceoxygen > 0)
        {
        SetFont("BIGFONT");
        hudmessage(d: ((spaceoxygen+34) / 35);HUDMSG_plain,51,CR_lightblue,0.02,0.9,0);
        spaceoxygen --;
        delay(1);
        restart;
        }
    else
        {
        SetFont("BIGFONT");
        hudmessage(s:"0";HUDMSG_PLAIN,51,CR_lightblue,0.02,0.9,0);
        delay(35);
        thing_damage(0,10,0);
        restart;
        }
        }

script 9 (void) //Leaving sector
{
ACS_terminate(9,3);
spaceoxygen = 350;
hudmessage(s:" ";HUDMSG_PLAIN,51,CR_lightblue,0.02,0.9,0);
}
Ok i managed to create the script duo above. Works otherwise beautifully, but the armor protects the player from this "drowning" damage, which isn't very credible.

I don't know how to define a damage type for sector damage. Is there a way? The best alternative from preset damage types was damagetype 0, but instead of "Player died" it displays "player killed himself". It would be nice to define a "player suffocated" MOD and make it irresistable by body armor.

Of course these are just minor problems but I like to enchance my scripts to the max :)

Help?

Share this post


Link to post

Try using Thing_Damage2 as you can set the type of damage, one of the types is drowning damage that ignores armour. You can replace the drowning obituary message using a LANGUAGE lump.

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
×