the Elements of Quest:Objects:In GUI~Editor:
self apparent~explanatory:
"game file object" (the "ROOT" Object) -> Objects (Tab) -> Add -> (create your Object)
"game" (Object) -> (can't create Objects inside of the special: Game Object)
"room" (Object) -> Objects (Tab) -> Add -> (create your Object)
"player" (Object) -> Objects (Tab) -> Add -> (create your Object)
Default New Game Objects: "game file object", "game", "room", and "player"
In-Code:
<asl version="540">
</asl>
<game name="blah">
</game>
<object name="room">
</object>
<object name="player">
</object>
The "game" Object is a special Object, it's thee: Game Object.
the format you see above are called tags for where the Object begins and ends:
Object Beginning:
<asl version="540">
<game name="blah">
<object name="room">
<object name="player">
Object Ending:
</asl>
</game>
</object>
</object>
so these "tags" are our "CREATION" coding, the tags is how we "CREATE" (ADD) Objects to our game in Code.
The use of "Objects" is known as "Object-Oriented Programming", which is much easier to understand than the older programming system with arrays and etc complicated stuff.
By using these "Object tags", we can easily "nest" (put) Objects inside of Objects, as many layers deep as we want:
In GUI~Editor:
"Nesting" ("Indenting" or "Parent'ing<->Child'ing"): ie just like a folder~directory tree organization
".aslx game file" (Object)
-> "game" (Object) -> Objects (Tab) -> Add -> "room" (Object)
-> "room" (Object) -> Objects (Tab) -> Add -> "player" (Object)
->-> "player" (Object) -> Objects (Tab) -> Add -> "pants_with_pockets" (Object)
->->-> "pants_with_pockets" (Object) -> Objects (Tab) -> Add -> "wallet" (Object)
->->->-> "wallet" (Object) -> Objects (Tab) -> Add -> "one_dollar_bill" (Object)
->->->->-> "one_dollar_bill" (Object)
the ".aslx game file" Object is the "Root", because it contains (holds) ALL of the other Objects.
the ".aslx game file" Object is also the Direct "Parent" Object of the "game" and "room" Objects.
the ".aslx game file" Object is the Indirect "Parent" Object of the "player, pants, wallet, 1 dollar" Objects.
the "game" and "room" Objects are the Direct "Child" Object of the ".aslx game file" Object.
the "one_dollar_bill" is an Indirect "Child" Object of the "room" Object.
just like on your computer with its folders ("directories"):
C drive (the "ROOT")
-> programs
->-> quest
->->-> quest.exe file
->->-> core.aslx quest default library file (all the built-in code by Alex that enables quest to work and the coding already available for you to use to create your own coding~game: ie "take", "functions", "objects", "exits", the GUI~Editor "tab" scripting~coding, and etc)
->->-> english.aslx quest default library file (the language of the text displayed is as english)
->->-> your game (.aslx) file
->->-> your library (.aslx) file
anyways...
In Code:
A Game File (.aslx):
<asl version="540">
-> <game name="blah">
-> </game>
-> <object name="room">
->-> <object name="player">
->-> </object>
-> </object>
</asl>
A Library File (.aslx):
<library>
</library>
However, Objects, aren't the only things that use the "tags":
<function name="blah">
</function>
<command name="blah">
</command>
<turnscript name="blah">
</turnscript>
<timer name="blah">
</timer>
<verb name="blah">
</verb>
<type name="blah">
</type>
and etc
recognizing any of these things now? in the GUI~Editor? In Code?
Attributes:(using an european person as an example)
Attribute: "white_skin"
okay... but "white_skin"... OF WHAT ???
an Attribute MUST be "of" ("attached to") an Object
In GUI~Editor (as "CREATION"):
Add Object -> "european"
"european" (Object) -> Attributes (Tab) -> Attributes -> Add ->
Name: skin_color_string
Type: string
Value: white_skin
a built-in Attribute:
Name: alias
Type: string
Value: (left blank~empty)
In Code (as "CREATION"):
<object name="european">
-> <skin_color_string type="string>white_skin</skin_color_string>
-> // or, in a shortened recognized form by quest engine:
-> // <skin_color_string>white_skin</skin_color_string>
-> // or, a built-in attribute (not the "john" Value though, lol):
-> // <alias>john</alias>
</object>
As Scripting (as "ACTION"):
Object.Attribute=Value_or_Expression
european.skin_color_string=white_skin
Object: "european"
Attachment: "."
Attribute: "skin_color_string"
(Type: string)
Value: white_skin
built-in attribute:
european.alias="john" // the quotes *are required* for the Value of String Attributes
Scripting to Output~Effect~Result During Game Play:
(In GUI~Editor: Run as script -> Add a~new script -> Print a message -> Print [EXPRESSION] -> for example, type this in -> european.skin_color_string)
msg (european.skin_color_string) -> white_skin
msg ("You have " + european.skin_color_string +".") -> You have white_skin.
msg (european.alias) -> john
msg (european.alias + " has " + european.skin_color_string +".") -> john has white_skin.
----------------------
the Types of Attributes:
String Attribute:a string is merely a collection of characters (not all characters are allowed though), for some examples of some Values:
a
4
fbaofn_46neus_joqbm_888_v6v6v6v6v
red
12345
the quotes *are required* for the Value of String Attributes:
human_typing_this_post.alias="HK" // lol ~ hehe
ball.color="red"
security_door_1.passcode="123456"
security_door_2.passcode="qwerty"
security_door_3.passcode="1_q_2_w_3_e_4_r_5_t_6_y"
Integer Attribute:
integer are non-decimal numbers: ... , -100, -1, 0, 1 , 100, ...
HK.strength=100
HK.current_hit_points=999
HK.maximum_hit_points=999
HK.current_mana_points=99
HK.maximum_mana_points=99
HK.carry_weight=100
HK.cash=0 // I'm very poor, boohoo
HK.experience=999999
HK.level=99
Double Attributes:doubles are merely decimal numbers
HK.physical_damage=900.73
HK.fire_damage=35.1
HK.water_resistance=0.00008
Boolean Attributes:the Value is either: "true" or "false"
HK.dead=false
HK.is_super_awesome=true
tv.switched_on=false
HK.walking=false
HK.flying=true
HK.likes_playing_computer_games=true
further explanation of booleans, there's many types of combinations (choose whatever works best)
HK.dead=false // HK is "alive"
HK.alive=true // HK is "alive"
HK.dead=true // HK is "dead"
HK.alive=false // HK is "dead"
HK.walking=false // HK is "running"
HK.running=false // HK is "walking"
HK.running=true // HK is "running"
HK.walking=true // HK is "walking"
we have a starting setting or "flagging" (from our "CREATION"):
dragon.dead=false // dragon is "alive"
we can then toggle the effect in our Verbs:
HK kills the dragon: dragon.dead=true // dragon is now "dead"
HK revives the dead dragon: dragon.dead=false // dragon is "alive" again
HK kills the dragon again: dragon.dead=true // dragon is "dead" again
etc...
booleans are paired with "if" conditionals:
in our "tags" we create the Object and its Attributes (or in GUI~Editor: we add the object, and then we add the attributes for that object):
<object name="dragon">
-> <inherit name="editor_object" />
-> // this, the above code line, is shortened by the quest engine, but it's long form is actually this (I think):
-> // <inherit name="editor_object">
->-> // <enabled type="boolean">true</enabled>
-> // </inherit>
-> <dead type="boolean">false</dead>
</object>
In GUI~Editor: in the "fight" Verb (the "ACTION" usage of our attributes, in here we will switch the dragon from being set~flagged as "alive" to being "dead") of the "dragon" Object:
if (dragon.dead=true) {
-> msg ("the dragon is already dead, silly. you can't kill something that is already dead!")
} else if (dragon.dead=false) {
-> msg ("you kill the dragon") // this tells the game player what happened (the dragon is now "dead"), but the quest engine doesn't recognize this as saying that the dragon is now "dead"
-> dragon.dead=true // this tells the quest engine that the dragon is now set~flagged (changed to) as "dead", but it is invisible to the game player
}
In Code:
<object name="dragon">
-> <inherit name="editor_object" />
-> // this, the above code line, is shortened by the quest engine, but it's long form is actually this (I think):
-> // <inherit name="editor_object">
->-> // <enabled type="boolean">true</enabled>
-> // </inherit>
-> <dead type="boolean">false</dead>
-> <fight type="script">
->-> if (dragon.dead=true) {
->->-> msg ("the dragon is already dead, silly. you can't kill something that is already dead!")
->-> } else if (dragon.dead=false) {
->->-> msg ("you kill the dragon") // this tells the game player what happened (the dragon is now "dead"), but the quest engine doesn't recognize this as saying that the dragon is now "dead"
->->-> dragon.dead=true // this tells the quest engine that the dragon is now set~flagged as "dead", but it is invisible to the game player
->-> }
-> </fight>
-> <displayverbs type="simplestringlist">Fight</displayverbs>
</object>
Script Attributes:(see the "fight" Script Attribute above ~ these are your added Verbs to~of an Object in the GUI~Editor)
List (String and Object) Attributes:stringlists:
a built-in stringlist: <displayverbs type="simplestringlist">Look at; Take; Give; Use; Drop; Etc</displayverbs>
<gender_type_string_list type="simplestringlist">male;female</gender_type_string_list>
<elemental_type_string_list type="simplestringlist">fire;water;air;earth</elemental_type_string_list>
<class_type_string_list type="simplestringlist">knight;berserker;archer;ranger;thief;mage;cleric</class_string_list>
<travel_list type="simplestringlist">wasteland;grassland;plains;swampland;desert;tundra;hills;forest;mountains</travel_list>
objectlists:
a built-in objectlist: <inventory type="objectlist">spellbook;wooden_sword;hp_potion;mp_potion;shield;etc</inventory>
<sword_types type="objectlist">short_sword;long_sword;claymore;katana;broad_sword;cutlass;scimitar</sword_types>
<fire_spells type="objectlist">fireball;melt;inferno</fire_spells>
Dictionary (String, Object, and Script) Attributes:
these are a bit more complicated... don't worry about dictionaries for now.
Functions:these are just like the scripting of verbs, except they're more powerful (parameters) and easier to use (especially "looping" ie "call function"), than Script Attributes (which you use in or as your Verbs).
Commands:Commands enable you to type in something as a game player (during game play) for a function~scripting to act upon. Though they're less noob-friendly, as you got to understand using functions with parameters. Commands are global.
Verbs:Verbs are actually a sub-type of Commands, allowing you to attach it directly to an Object, and allowing for the creation of the "buttons" and "hypertexts" features during game play. Verbs are local (specifically for that Object).
etc..getting tired... lol
-----------------------------
let's see if this helped you with the attributes (such as your "immobilize player" boolean attribute) ...
as for your GPS.noticed...
you must have the typing MATCHING EXACTLY, lower and upper case matter:
"gps.noticed" NOT EQUAL~MATCHING TO "GPS.noticed"
you've got two Attributes, and not a single Attribute.
Attribute_1: GPS.noticed
Attribute_2: gps.noticed
hence the ERROR message you're receiving (for example):
<object name="GPS">
-> <noticed type="boolean">false</noticed>
-> <blah type="script">
->-> if (gps.noticed=false) {
->->-> msg ("I don't see anyone")
->-> } else if (gps.noticed=true) {
->->-> msg ("I see you!")
->-> }
-> </blah>
</object>
Quest engine:
I need to find the Object.Attribute "gps.noticed" so I can do the "blah" script... there's a "GPS.noticed" Object.Attribute, but no "gps.noticed" Object.Attribute, can't compute ("what do I do? I need help, my human coder!")... ERROR.... ERROR!
ya.. coding is annoying... typo'es and simple mistakes... don't go well with coding... lol. You must TYPE exactly for it to be correct and to work properly.
quick coding tip:
using uppercase is annoying (having to do shift_key+letter_key and having to remember to do it too, lol), so try to have everything as lower case, unless you absolutely have to use uppercase for a very important reason.
-----------
for the "immobilized" attribute:
you got it correct, but you've got it initially set as "player.immobilized=true":
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<scenery type="boolean">false</scenery>
<immobilized />
</object>
<immobilized />
is the same as (it's the shortened "understood" form of)
<immobilized type="boolean">true</immobilized>
here's how it'd look in it's long~full form (if the quest engine didn't automatically convert it to it's shortened form):
[code]<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<scenery type="boolean">false</scenery>
<immobilized type="boolean">true</immobilized>
</object>[/code]
so if you want it to be initially set as "false", then change it to look like this:
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<scenery type="boolean">false</scenery>
<immobilized type="boolean">false</immobilized>
</object>
now, as for changing the attribute back and forth:
you do it in scripting (such as in your verbs):
player.immobilized=true
(to toggle back and forth)
player.immobilized=false
here's an example of a working coding (though I'm not using the "immobilized" as you are, as it doesn't prevent you from clicking on the "fight" button again, lol):
initially, let's have it (created, and) set as "false":
<object name="player">
-> <inherit name="editor_object" />
-> <inherit name="editor_object" />
-> <immobilized type="boolean">false</immobilized>
</object>
now let's do the scripting (the Verb), where we'll need to change~switch it to being set as "true", for our Verb to work fully:
<object name="assassin">
-> <inherit name="editor_object" />
-> <fight type="script">
->-> // initially, we've got it set as: player.immobilized=false
->-> if (player.immobilized=true) {
->->-> msg ("the assassin, grinning triumphantly, walking up to your paralyzed body, slashes your throat open, killing you")
->->-> msg ("GAME OVER")
->->-> finish
->-> } else if (player.immobilized=false) {
->->-> msg ("the assassin gets to attack first, using a dart gun with a paralyzing substance coated on the dart, you're paralyzed, oh... %@$# !")
->->-> // now, since you've got paralyzed, we need to tell the quest engine that you're now paralyzed too, by changing the boolean attribute to now being set to "true":
->->-> player.immobilized=true
->-> }
-> </fight>
-> <displayverbs type="simplestringlist">Fight</displayverbs>
</object>
we could also have it instead be initially set as true, and obviously create a new verb scripting to work with it. I just choose to go from: "false" to "true", so, I could've just as well gone from "true" to "false", changing up the scripting in the verb to work.
here's some added script lines, to save you from death, and showing you how we can switch it back from "true" to "false" again:
(see if you can spot the added script lines, and see if you can understand how this all works too, hopefully...lol)
<object name="assassin">
-> <inherit name="editor_object" />
-> <fight type="script">
->-> // initially, we've got it set as: player.immobilized=false
->-> if (player.immobilized=true) {
->->-> if (antedote.parent=player) {
->->->-> msg ("just in time, you poke yourself with an antedote coated needle, unseen by the assassin. you pretend to be paralyzed, and as soon as the gloating assassin is next to you, you suddenly jam your dagger into his chest and heart, killing him, instead of him killing you")
->->->-> player.immobilized.false
->->-> } else {
->->->-> msg ("the assassin, grinning triumphantly, walking up to your paralyzed body, slashes your throat open, killing you")
->->->-> msg ("GAME OVER")
->->->-> finish
->->-> }
->-> } else if (player.immobilized=false) {
->->-> msg ("the assassin gets to attack first, using a dart gun with a paralyzing substance coated on the dart, you're paralyzed, oh... %@$# !")
->->-> // now, since you've got paralyzed, we need to tell the quest engine that you're now paralyzed too, by changing the boolean attribute to now being set to "true":
->->-> player.immobilized=true
->-> }
-> </fight>
-> <displayverbs type="simplestringlist">Fight</displayverbs>
</object>