Changing Death to Teleportation

When the player runs out of hitpoints, I want to transport them to a starting area so they can try again. However, when I put in the Move Player Object to Starting Area code in, whenever the player died they'd just immediately go there and no special text would be written. Considering that you can walk into rooms and be hit immediately by the attackturnscript I've got at the moment, this means that you can occasionally walk into a room and instantly die if you're very low health.

Modifying the Mr. Pixie's attackturnscript is a bit beyond me at the moment (though feel free to let me know if you have any ideas) but at the very least I'd like players to be able to read the turn that killed them and the amount of damage they took before they were teleported away.

I tried to go with a "You lost!" message, then Wait For Key Press, then Move Player Object, combo but that would occasionally freeze the program. What should I do?

player.alias = "you"
player.size = 0
player.melee = 0
player.shooter = 0
player.noncombatant = 0
player.hitpoints = 1
player.attack = 0
player.damage = 0
player.defence = 0
player.armour = 0
player.changedhitpoints => {
  if (player.hitpoints > 0) {
    msg ("Hits points now " + player.hitpoints)
  else {
    msg ("</br><b>They got you!  You've been returned to the main area.</b>")

Are you clearing the screen when the person enters the room?
If so, turn it off when they get killed so that the text remains on the screen.

You could move them to a "waiting room", have a doctor, or cleric, revive them then have a one-way door back to Room 1 (the starting room).

That's a very simple and elegant solution! Thanks. :) I didn't even think of removing the screen clearing element. I prefer having it because it declutters the screen and looks good with pictures, but it would be best not to if the alternative is sudden death!

I asked, because I like the cleared screen myself, especially if there is a lot of reading to do, or old text can confuse the issue.
But, you do loose the "what did I just do?"...

This topic is now closed. Topics are closed after 60 days of inactivity.