here's some useful links for you to help you out:
(don't be scared of code, as the only two issues with writing code is first knowing how to write it, ie it's structure ~ syntax ~ format ~ pattern, and also in writing precisely... no typos or your code won't work, lol. So, it's not really as scary as it seems, 'troubleshooting' errors when you try to write in code, is merely 'spell and typo checking', hehe. Though, this isn't easy... to find the errors...)
(but, if you just don't like code, or if it is just too confusing for you, quest does have a great GUI~Editor for you, I just don't know it that well, and it takes longer to explain stuff via it, which is just why I personally usually help people with code, as it's faster and easier for me to do so. I can help via using the GUI~Editor, but I need the time to do so, which I don't have much of anymore... sighs)
01.
http://quest5.net/wiki/Main_Page02.
http://quest5.net/wiki/Tutorial03.
http://quest5.net/wiki/How_to (guides)
04.
http://quest5.net/wiki/Showing_a_menu05.
http://quest5.net/wiki/Character_Creation06.
http://quest5.net/wiki/Category:All_Fun ... t_Commands (page 1, range: A-S)
07.
http://quest5.net/w/index.php?title=Cat ... t#mw-pages (page 2, range: S-Z)
08.
viewforum.php?f=18 (more guides: libraries and code)
09. (also, look up 'switch' =or= 'case command' in #03 and~or in #06-07)
10.
http://quest5.net/wiki/Object_element11.
http://quest5.net/wiki/ASLX_Elements12.
http://quest5.net/wiki/Category:ASLX_Elements13.
http://quest5.net/wiki/Object_element14.
http://quest5.net/wiki/Attribute_Typesfrom #3 ('how to' link):
http://quest5.net/wiki/Hs-blockingexithttp://quest5.net/wiki/Hs-lockedexitshttp://quest5.net/wiki/Unlockdoorfrom #2 (the 'tutorial' link):
http://quest5.net/wiki/Using_lockable_exitshttp://quest5.net/wiki/Using_lockable_containershttp://quest5.net/wiki/Using_containers-------------
in the GUI~Editor (with the drop down menus and buttons, ie not code view writing mode):
I think on your Object (or Exit too), you want to do the container tab (with quest version 550 ~ most recent, you may need to go into I think the 'game' Object, and one of it's tabs has check boxes I think for turning on more various tabs for the Objects ~ you may need to do this to see the container tab, whatever it is called), and I think one of the container type choices is: 'openable ~ closable', this makes your Object a 'door-like' Object. Now, the built in scripts have confused others and me too, but you can set your Object up for being open or closed initially, and then within the script you can open~close the Object, prevent from going through the Object unless it is open, require a 'key' Object to unlock it, and etc...
-------
there's many ways to do what you want with removing your health:
Timers, Turnscripts, and 'monster~enemy' Objects' Verbs' scripts.
the scripting (ie 'run as script -> add a script' in the GUI~Editor) is the same for all of them:
for example:
first, we need a 'dead~alive' Attribute (a boolean, ie a flag):
Object: room
-> 'orc' Object -> Attributes (Tab) -> Attributes -> Add ->
Object: orc
Attribute Name: dead
Attribute Type: boolean
Attribute Value: false
some coding logic mentality:
dead = false -> conceptually, it is 'alive'
dead = true -> conceptually, it is 'dead'
alive = false -> conceptually, it is 'dead'
alive = true -> conceptually, it is 'alive'
most people use 'dead=false_or_true', instead of 'alive=false_or_true'
think of booleans (ie flags) as like a light switch, ie you can turn it 'on' (ie =true, =on, =yes, =1~binary, = +charge~chemistry~electronics, =etc) and 'off' (ie =false, =off, =no, =0~binary, = -charge~chemistry~electronics, =etc)
though, for specifically quest's Boolean Attribute Type, it uses '=false_or_true'
we initially set our 'orc' as:
orc.dead = false
as we want our orc to be alive, so that we can and have to, kill it, lol.
another example of boolean (flag) usage:
lich.undead_boolean = true
HK.undead_boolean = false
// hehe

which we can then script in cool things for:
if (lich.undead = true) {
-> // conceptual pseudo-scripting (I'm lazy): if using holy_damage, then: lich.hp = lich.hp - HK.holy_damage * 2
}
another example of boolean (flag) usage:
HK.running = false // I'm walking right now
HK.running = true // I'm running right now
HK.flying = false // I'm walking right now
HK.flying = true // I'm flying right now
as I think you're seeing... boolean usage unfortunately, gets cumbersome (too many booleans!), very fast...
(for example: status_effects)
HK.poisoned = false
HK.petrified = false
HK.stunned = false
HK.confused = false
HK.silenced = false
HK.asleep = false
HK.cursed = false
HK.blessed = false
HK.miniturized~'moogled' = false
HK.blinded = false
HK.paralyzed = false
etc etc etc
well, there's a way to do the same thing without using 4829472987492837 booleans, but you're probably not ready yet for this (using lists and~or dictionaries), as they're a bit more complicated.
-------
so (in code, sorry, but it's faster than trying to do it via the GUI~editor)... now let's put the rest of it in (making~adding and using Attributes):
Object: orc
Verb: fight (custom~self made)
if (orc.dead = false) {
-> // if the orc is alive, you fight it
-> player.hp = player.hp - orc.damage
-> msg ("The orc attacks you")
-> if (player.hp <= 0) {
->-> msg ("The orc has killed you.")
->-> msg ("GAME OVER")
->-> finish
-> }
-> orc.hp = orc.hp - player.damage
-> msg ("You attack the orc.")
-> if (orc.hp <= 0) {
->-> // we tell quest to set ~ re-set the orc as being now dead:
->-> orc.dead = true
->-> msg ("You killed the orc! Now it is dead.")
-> }
// if you were to click on the orc's 'fight' Verb again, after killing it, then you get this response of scripts:
} else if (orc.dead = true) {
-> msg ("The orc is already dead, silly. You have no need to fight the orc's corpse!")
}
------------
in code, as scripting:
Object_name.Attribute_name = Expression_or_Value
orc.dead = false
in code, as 'tags':
<object name="room">
-> <inherit name="editor_object" />
-> <object name="player">
->-> <inherit name="editor_object" />
->-> <inherit name="editor_player" />
-> </object>
-> <object name="orc">
->-> <inherit name="editor_object" />
->-> <attr name="dead" type="boolean">false</attr>
-> </object>
</object>
---------------
now, as for the GUI~Editor, these are you two SUPER Scripts:
'if' and 'set a variable or attribute'
which, especially when used together, let's you do pretty much 90% of what you want to do within your game
there's many places to add scripts to: Verbs, Functions, Commands, Turnscripts, Timers, Objects (as Attributes, Attribute Type: Script), and etc.
if:
run as script -> add a script -> scripts -> if -> [EXPRESSION] -> code (write~type) it in: see below
set a variable or an attribute:
run as script -> add a script -> variables -> set a variable or an attribute ->code (write~type) it in: see below
Quest's Terminology:
Variables:
-> An Attribute: Object.Attribute = Value_or_Expression
-> A Variable: Attribute = Value_or_Expression
Attributes, by having (being 'attached' to) the 'Object.', makes it 'savable', an thus 'loadable' (so long as the object still exists), which means that you can use that Attribute anywhere (same concept as with Functions and the 'call function' Script).
Variables (Attribute = Value_or_Expression), however, can only be used within it's own script location. It can't be used within another script elsewhere in the game.
for examples:
game (object) -> Scripts (tab) -> Start Script -> Add a script -> call function: character_creation_function
<function name="character_creation_function">
-> msg ("What is your name?")
-> get input {
->-> my_name = result
-> }
</function>
Object: npc
Verb: Chat
msg ("Hi, my name is " + my_name + ".")
// outputs: ERROR, 'my_name' isn't defined, it has no value given to it yet. my_name = ??? -> null -> ERROR
whereas, by attaching it to an Object (in the GUI~Editor simply Add the Attribute to that Object), Object.Attribute:
game (object) -> Scripts (tab) -> Start Script -> Add a script -> call function: character_creation_function
<function name="character_creation_function">
-> msg ("What is your name?")
-> get input {
->-> // I, during game play, type in: HK
->-> player.my_name = result
-> }
</function>
Object: npc
Verb: Chat
msg ("Hi, my name is " + player.my_name + ".")
// outputs: Hi, my name is HK.
------------
orc.dead_boolean = false
HK.strength_integer = 100
HK.class_string = "warrior"
HK.damage_double = 53.7
HK.favorite_colors_stringlist = split ("black;red", ";")
HK.favorite_color_string = "black"
HK.damage_integer = wooden_sword.damage_integer + wooden_sword.damage_integer * (HK.strength_integer - orc.endurance_integer) / 100
orc.fight_script = (see below)
if (orc.dead = false) {
-> you_go_first_variable = false
-> if (HK.speed_integer > orc.speed_integer) {
->-> you_go_first_variable = true
-> } else if (HK.speed_integer = orc.speed_integer) {
->-> if (RandomChance (50) = true) {
->->-> you_go_first_variable = true
->-> }
-> }
-> if (you_go_first_variable = false) {
->-> HK.hp_integer = HK.hp_integer - orc.damage_integer
->-> msg ("The orc attacks you for " + orc.damage_integer + ", leaving your HP at " + HK.hp_integer + ".")
->-> if (HK.hp_integer <= 0) {
->->-> msg ("You got killed by the orc")
->->-> msg ("GAME OVER")
->->-> finish
->-> } else {
->->-> orc.hp_integer = orc.hp_integer - HK.damage_integer
->->-> msg ("You attack the orc for " + HK.damage_integer + ", leaving it with only " + orc.hp_integer + " HP left.")
->->-> if (orc.hp_integer <= 0) {
->->->-> orc.dead_boolean = true)
->->->-> msg ("You killed the orc.")
->->-> }
->-> }
-> } else if (you_go_first_variable = true) {
->-> orc.hp_integer = orc.hp_integer - HK.damage_integer
->-> msg ("You attack the orc for " + HK.damage_integer + ", leaving it with only " + orc.hp_integer + " HP left.")
->-> if (orc.hp_integer <= 0) {
->->-> orc.dead_boolean = true)
->->-> msg ("You killed the orc.")
->-> } else {
->->-> HK.hp_integer = HK.hp_integer - orc.damage_integer
->->-> msg ("The orc attacks you for " + orc.damage_integer + ", leaving your HP at " + HK.hp_integer + ".")
->->-> if (HK.hp_integer <= 0) {
->->->-> msg ("You got killed by the orc")
->->->-> msg ("GAME OVER")
->->->-> finish
->->-> }
->-> }
-> }
} else if (orc.dead_boolean = true) {
-> if (orc.cash_integer > 0) {
->-> HK.cash_integer = HK.cash_integer + orc.cash_integer
->-> msg ("You loot the orc's dead body for it's bag of gold coins")
-> }
-> if (not orc.equipment_and_item_objectlist = null) {
->-> foreach (object_x, orc.equipment_and_item_objectlist) {
->->-> object_x.parent = HK
->-> }
->-> msg ("You loot the orc's dead body of all its equipment and items.")
-> }
-> if (orc.cash_integer <= 0 and orc.equipment_and_item_objectlist = null) {
->-> msg ("The orc is already dead, and there's nothing left on him for you to loot.")
-> }