HenKonen Posted May 20, 2011 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? 0 Share this post Link to post
Melon Posted May 20, 2011 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. 0 Share this post Link to post
HenKonen Posted May 20, 2011 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? 0 Share this post Link to post
Melon Posted May 20, 2011 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. 0 Share this post Link to post