Overall Help & Understanding
onimike
11 Jun 2014, 15:34Ok so I started this game yesterday and am kinda getting it I mean I got it working most of how I want but here are the questions I have. Now before I get a response I have looked at the coding and example posted other places and they don't cover (or im not seeing) what Im trying to do. First I want my sounds to play all the way through without taking the interval time to start but want the whole sound to play? Second I want the cell door to be open and closable and only be able to access hallway if door is open not if its closed? And last need a decent Ai system, I think I could probably use a timer to start when in area of enemy to take off so much health until you kill it but I think there's an easier way? Plus I have done all this with the drop down menus I do not know coding, I mean I can kinda understand when reading code just not typing in my own code. Tell me what you think so far got a lot more work and story for this game to add..
P.S. I don't know if it let me upload the sounds and pics or not hope it did so you all can tell what I mean about the sounds..
Thanks
Mike
P.S. I don't know if it let me upload the sounds and pics or not hope it did so you all can tell what I mean about the sounds..
Thanks
Mike
HegemonKhan
11 Jun 2014, 18:52here'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_Page
02. http://quest5.net/wiki/Tutorial
03. http://quest5.net/wiki/How_to (guides)
04. http://quest5.net/wiki/Showing_a_menu
05. http://quest5.net/wiki/Character_Creation
06. 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_element
11. http://quest5.net/wiki/ASLX_Elements
12. http://quest5.net/wiki/Category:ASLX_Elements
13. http://quest5.net/wiki/Object_element
14. http://quest5.net/wiki/Attribute_Types
from #3 ('how to' link):
http://quest5.net/wiki/Hs-blockingexit
http://quest5.net/wiki/Hs-lockedexits
http://quest5.net/wiki/Unlockdoor
from #2 (the 'tutorial' link):
http://quest5.net/wiki/Using_lockable_exits
http://quest5.net/wiki/Using_lockable_containers
http://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.")
-> }
(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_Page
02. http://quest5.net/wiki/Tutorial
03. http://quest5.net/wiki/How_to (guides)
04. http://quest5.net/wiki/Showing_a_menu
05. http://quest5.net/wiki/Character_Creation
06. 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_element
11. http://quest5.net/wiki/ASLX_Elements
12. http://quest5.net/wiki/Category:ASLX_Elements
13. http://quest5.net/wiki/Object_element
14. http://quest5.net/wiki/Attribute_Types
from #3 ('how to' link):
http://quest5.net/wiki/Hs-blockingexit
http://quest5.net/wiki/Hs-lockedexits
http://quest5.net/wiki/Unlockdoor
from #2 (the 'tutorial' link):
http://quest5.net/wiki/Using_lockable_exits
http://quest5.net/wiki/Using_lockable_containers
http://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.")
-> }
onimike
13 Jun 2014, 20:37Thank you been reading over and over, got a little bit further just really trying to hash out the mechanics of the game first before I go add x amount of rooms and objects
I do have another favor, in game you shall see how I have weapons attack damage setup and my light source (matches). Question is can you possible like suggest a easier way to accomplish these feats without me having to do this to each and every weapon or light source? I think Im suppost to make like a object type = weapons then apply that trait to each weapon just forgot haven't played around with this since 3.5 lol. Thanks again
P.S. Im not afraid of code its just I have been self teaching all this and questions here and there but regardless of code type I.E.(Java, C++, Html) the lay out formats are always different in every program like Java in Quest as Java in Unity its still Java yet the layouts are different such as {}[]"':;<>,./|\^%()?(Just so many blah) there places and when to use them. As I stated before I can read and understand what a function will do in code but writing it out is totally different then reading it lol

P.S. Im not afraid of code its just I have been self teaching all this and questions here and there but regardless of code type I.E.(Java, C++, Html) the lay out formats are always different in every program like Java in Quest as Java in Unity its still Java yet the layouts are different such as {}[]"':;<>,./|\^%()?(Just so many blah) there places and when to use them. As I stated before I can read and understand what a function will do in code but writing it out is totally different then reading it lol
HegemonKhan
14 Jun 2014, 03:42Sorry, I haven't looked at your game file yet, I'll see if I can do so with this apple (I'm sure I can) computer, when I got the time.
------------
Object Types (which as 'called upon Attributes' are known as, an example of a built-in Object Type: <inherit name="editor_object" />) are merely groups, if you're familiar with this in code terminology.
Advanced (the left pane; the 'tree of stuff') -> Object Types -> Add -> (set it up)
An Object Type is merely a 'basket' that can hold~have many 'eggs' (Attributes), if this anology helps.
for example, instead of doing this:
you can do this instead:
but, inherited attributes can *NOT* be changed, UNLESS you write over them (by setting~adding the exact same attribute to that specific Object).
also, Object Types, can hold other Object Types too (all of the held attributes of all the Object Types will be added to that Object).
---------
while quest is it's own code, it uses pretty much the same structure as 'XML' (eXtensible Markup Language), so if you want to use and~or see it better, you can download this free program:
notepad++
and when running the program, at the top bar, under languages, choose 'XML'.
--------------
quest's code structure (nearly same as XML ~ I think, as you know code better than I, as I don't know any code languages, the only other one I've been trying, is merely the command prompt on PC computers), is quite noobie-friendly (as I can attest, lol), using very few of all those symbols~characters that the other languages use (argh~lol):
the NAME Attribute (Object.name = blah) (<Element name="blah">) is your 'ID' Attribute for everything, so no 2 can be the same.
' <____>' is the beginning
' </___> ' is the ending
you got the Element Tags:
<asl version="550"></asl> is the entire game (the game file ~ everything is within these tags)
<library></library is used, instead of the <asl version="550"></als>, if you want to make a Library File
<game name="blah"></game> is your Game Object (holds the game info+settings~options+etc Attributes)
<object name="blah"></object> Objects hold Attributes and~or other Objects
<function name="blah"></function> are (or holds) scripts and Functions, with the use of parameters, and the ease of looping it
<verb name="blah"></verb> sub-Commands for specific objects, uses buttons and hyperlinks, not typed-in inputs
<command name="blah"></command> allows for typed-in inputs, are (or holds) scripts and functions, and parameters' scripting utility too
<turnscript name="blah"></turnscript> an always*(when it's enabled~activated and~or you're in the same room as it if it's not a global turnscript) running Function
<timer name="blah"></timer> same as a turnscript, but using real time ticking
<attr name="blah"></attr> your attributes
<type name="blah"></type> holds attributes and~or other Object Types
etc etc etc
Scripting:
' { ' the beginning of your nested scripts
' } ' the ending of your nested scripts
but your initial scripts don't need any beginning+ending characters~symbols
anything encased by quatation marks, are strings~text:
HK.favorite_color = "black"
msg ("Hi, my name is " + player.alias)
no quatation marks, for alphabet characters means that it's an Object
no quatation marks, for numeral characters means that it's an Integer or a Double (Float~Floating Point~Decimal Number)
and other special built-in things too: Object.Attribute=false (boolean), Object.Attribute=true (boolean), this is hidden, done automatically and unseen by internal quest core coding: result=Value_or_Expression ('get input' and 'show menu'), and etc...
so:
value_x = "1" // Attribute Type: String
value_x = 1 // Attribute Type: Integer (int)
value_x = "apple" // Attribute Type: String
value_x = apple // Attribute Type: Object // ie, it's an Object
Object.Attribute = Value_or_Expression
Horizontal:
if (Object.Attribute = Value_or_Expression) { your scripts } else if { your scripts } else { your scripts }
Vertical:
msg ("blah")
msg ("blah" + Object.Attribute)
------------
these should help you more quickly learn quest's coding structure~format~syntax~patterns:
01. http://quest5.net/wiki/Category:All_Fun ... t_Commands (page 1, range: A-S)
02. http://quest5.net/w/index.php?title=Cat ... t#mw-pages (page 2, range: S-Z)
03. http://quest5.net/wiki/Category:ASLX_Elements
04. http://quest5.net/wiki/ASLX_Elements
05. http://quest5.net/wiki/Object_element
06. http://quest5.net/wiki/Attribute_Types
------------
Object Types (which as 'called upon Attributes' are known as, an example of a built-in Object Type: <inherit name="editor_object" />) are merely groups, if you're familiar with this in code terminology.
Advanced (the left pane; the 'tree of stuff') -> Object Types -> Add -> (set it up)
An Object Type is merely a 'basket' that can hold~have many 'eggs' (Attributes), if this anology helps.
for example, instead of doing this:
<object name="HK">
<inherit name="editor_object" />
<inherit name="editor_player" />
<attr name="strength_integer" type="int">0</attr>
<attr name="endurance_integer" type="int">0</attr>
<attr name="dexterity_integer" type="int">0</attr>
<attr name="agility_integer" type="int">0</attr>
<attr name="speed_integer" type="int">0</attr>
<attr name="luck_integer" type="int">0</attr>
<attr name="intelligence_integer" type="int">0</attr>
<attr name="spirituality_integer" type="int">0</attr>
<attr name="mentality_integer" type="int">0</attr>
<attr name="piety_integer" type="int">0</attr>
<attr name="level_integer" type="int">0</attr>
<attr name="cash_integer" type="int">0</attr>
<attr name="experience_integer" type="int">0</attr>
</object>
<object name="orc">
<inherit name="editor_object" />
<attr name="strength_integer" type="int">0</attr>
<attr name="endurance_integer" type="int">0</attr>
<attr name="dexterity_integer" type="int">0</attr>
<attr name="agility_integer" type="int">0</attr>
<attr name="speed_integer" type="int">0</attr>
<attr name="luck_integer" type="int">0</attr>
<attr name="intelligence_integer" type="int">0</attr>
<attr name="spirituality_integer" type="int">0</attr>
<attr name="mentality_integer" type="int">0</attr>
<attr name="piety_integer" type="int">0</attr>
<attr name="level_integer" type="int">0</attr>
<attr name="cash_integer" type="int">0</attr>
<attr name="experience_integer" type="int">0</attr>
</object>
<object name="onimike">
<inherit name="editor_object" />
<inherit name="editor_player" />
<attr name="strength_integer" type="int">0</attr>
<attr name="endurance_integer" type="int">0</attr>
<attr name="dexterity_integer" type="int">0</attr>
<attr name="agility_integer" type="int">0</attr>
<attr name="speed_integer" type="int">0</attr>
<attr name="luck_integer" type="int">0</attr>
<attr name="intelligence_integer" type="int">0</attr>
<attr name="spirituality_integer" type="int">0</attr>
<attr name="mentality_integer" type="int">0</attr>
<attr name="piety_integer" type="int">0</attr>
<attr name="level_integer" type="int">0</attr>
<attr name="cash_integer" type="int">0</attr>
<attr name="experience_integer" type="int">0</attr>
</object>
you can do this instead:
<type name="character_object_type">
<attr name="strength_integer" type="int">0</attr>
<attr name="endurance_integer" type="int">0</attr>
<attr name="dexterity_integer" type="int">0</attr>
<attr name="agility_integer" type="int">0</attr>
<attr name="speed_integer" type="int">0</attr>
<attr name="luck_integer" type="int">0</attr>
<attr name="intelligence_integer" type="int">0</attr>
<attr name="spirituality_integer" type="int">0</attr>
<attr name="mentality_integer" type="int">0</attr>
<attr name="piety_integer" type="int">0</attr>
<attr name="level_integer" type="int">0</attr>
<attr name="cash_integer" type="int">0</attr>
<attr name="experience_integer" type="int">0</attr>
</type>
<object name="HK">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="character_object_type" />
</object>
<object name="orc">
<inherit name="editor_object" />
<inherit name="character_object_type" />
</object>
<object name="onimike">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="character_object_type" />
</object>
but, inherited attributes can *NOT* be changed, UNLESS you write over them (by setting~adding the exact same attribute to that specific Object).
also, Object Types, can hold other Object Types too (all of the held attributes of all the Object Types will be added to that Object).
---------
while quest is it's own code, it uses pretty much the same structure as 'XML' (eXtensible Markup Language), so if you want to use and~or see it better, you can download this free program:
notepad++
and when running the program, at the top bar, under languages, choose 'XML'.
--------------
quest's code structure (nearly same as XML ~ I think, as you know code better than I, as I don't know any code languages, the only other one I've been trying, is merely the command prompt on PC computers), is quite noobie-friendly (as I can attest, lol), using very few of all those symbols~characters that the other languages use (argh~lol):
the NAME Attribute (Object.name = blah) (<Element name="blah">) is your 'ID' Attribute for everything, so no 2 can be the same.
' <____>' is the beginning
' </___> ' is the ending
you got the Element Tags:
<asl version="550"></asl> is the entire game (the game file ~ everything is within these tags)
<library></library is used, instead of the <asl version="550"></als>, if you want to make a Library File
<game name="blah"></game> is your Game Object (holds the game info+settings~options+etc Attributes)
<object name="blah"></object> Objects hold Attributes and~or other Objects
<function name="blah"></function> are (or holds) scripts and Functions, with the use of parameters, and the ease of looping it
<verb name="blah"></verb> sub-Commands for specific objects, uses buttons and hyperlinks, not typed-in inputs
<command name="blah"></command> allows for typed-in inputs, are (or holds) scripts and functions, and parameters' scripting utility too
<turnscript name="blah"></turnscript> an always*(when it's enabled~activated and~or you're in the same room as it if it's not a global turnscript) running Function
<timer name="blah"></timer> same as a turnscript, but using real time ticking
<attr name="blah"></attr> your attributes
<type name="blah"></type> holds attributes and~or other Object Types
etc etc etc
Scripting:
' { ' the beginning of your nested scripts
' } ' the ending of your nested scripts
but your initial scripts don't need any beginning+ending characters~symbols
anything encased by quatation marks, are strings~text:
HK.favorite_color = "black"
msg ("Hi, my name is " + player.alias)
no quatation marks, for alphabet characters means that it's an Object
no quatation marks, for numeral characters means that it's an Integer or a Double (Float~Floating Point~Decimal Number)
and other special built-in things too: Object.Attribute=false (boolean), Object.Attribute=true (boolean), this is hidden, done automatically and unseen by internal quest core coding: result=Value_or_Expression ('get input' and 'show menu'), and etc...
so:
value_x = "1" // Attribute Type: String
value_x = 1 // Attribute Type: Integer (int)
value_x = "apple" // Attribute Type: String
value_x = apple // Attribute Type: Object // ie, it's an Object
Object.Attribute = Value_or_Expression
Horizontal:
if (Object.Attribute = Value_or_Expression) { your scripts } else if { your scripts } else { your scripts }
Vertical:
if (Object.Attribute = Value_or_Expression) {
// scripts
} else if (Object.Attribute = Value_or_Expression) {
// scripts
} else {
// scripts
}
msg ("blah")
msg ("blah" + Object.Attribute)
------------
these should help you more quickly learn quest's coding structure~format~syntax~patterns:
01. http://quest5.net/wiki/Category:All_Fun ... t_Commands (page 1, range: A-S)
02. http://quest5.net/w/index.php?title=Cat ... t#mw-pages (page 2, range: S-Z)
03. http://quest5.net/wiki/Category:ASLX_Elements
04. http://quest5.net/wiki/ASLX_Elements
05. http://quest5.net/wiki/Object_element
06. http://quest5.net/wiki/Attribute_Types