Display Health in game (not side panel)

Stone Rose
03 Jul 2012, 23:57
I would prefer my game to be played without the side panel; however, hiding the side panel means hiding the health display as well. I would like for the player to simply be able to type "show health" or "health" and have the game display the remaining health. I have created a player attribute called "Health" (with an integer of 100) as well as a status attribute (Health: !). I am simply uncertain how to phrase the command.

Also, is there a way to destroy/remove an exit after the player does a specific action? I don't want the direction to be listed after that.

Thank you for any help you have.

Pertex
04 Jul 2012, 08:16
This should work:
  <command name="show health">
<pattern>show health</pattern>
<script>
msg ("Your health is: " + player.health)
</script>
</command>

Stone Rose
04 Jul 2012, 08:51
It worked! Thank you so much for your help.

SylvieStotler
09 Dec 2012, 23:17
Pertex wrote:This should work:
  <command name="show health">
<pattern>show health</pattern>
<script>
msg ("Your health is: " + player.health)
</script>
</command>


I am looking for this too. Thanks Pertex :)

jaynabonne
09 Dec 2012, 23:20
To hide an exit, you can simple move it (with MoveObject or by setting its parent) to a hidden room or null. Be sure to name the exit so that you can use it in scripts.

myExit.parent = null