the 'article~gender' built-in Attributes are used for outputting: him~her~it~he~she~they~them
http://docs.textadventures.co.uk/quest/ ... ender.htmlhttp://docs.textadventures.co.uk/quest/ ... ticle.htmlso, you need to change
object
in your VARIABLE (an Attribute VARIABLE):
object.article
to the name of your Object, for example:
HK.article
or you can use the special 'this' (it gets the Object, which is the Object that you added the Verb to, it gets the Verb's Object), too:
this.article
so, your 'defaultexpression' would be something like this:
"You can't use " + HK.article + "like that."
or
"You can't use " + this.article + "like that."
-----------
I'm not sure what you're trying to do with your:
if (object.article = "hole") {
msg ("THAT WORKED.")
}
as this is incorrect usage, and I don't know what your intended usage was suppose to be.
-------
my way of displaying the general syntax~format is this:
Attribute Usage: Object_name.Attribute_name
or
Attribute Usage: Object_name.Attribute_name = Value_or_Expression
or (within an 'if' Script):
GUI~Editor: if [expression] Object_name.Attribute_name OPERATOR Value_or_Expression
in Code: if (Object_name.Attribute_name OPERATOR Value_or_Expression) { scripts }
Variable Usage: variable_string = Value_or_Expression
Command's Parameter-Variable Usage: (not covering here, too difficult to try to explain)
Function's Parameter Usage: (not covering here, too difficult to try to explain)
--------
OPERATORS:
Math Operators:
Addition: +
Subtraction: -
Multiplication: *
Division: /
Modulus (same as division, but it gets the remainder): %
Equals: =
Not Equals 1: <>
Not Equals 2: not Object_name.Attribute_name = Value_or_Expression
Assignment: =
Dis-Assignment 1: <>
Dis-Assignment 2: not Object_name.Attribute_name = Value_or_Expression
Comparison: =
Contrasting 1: <>
Contrasting 2: not Object_name.Attribute_name = Value_or_Expression
Text (string) Operators:
Concatenation (literally placing texts~strings next to each other): +
Assignment: =
Dis-Assignment 1: <>
Dis-Assignment 2: not Object_name.Attribute_name = Value_or_Expression
Comparison: =
Contrasting 1: <>
Contrasting 2: not Object_name.Attribute_name = Value_or_Expression
etc etc etc ???
-------
difference between Concatenation (of text~strings) and Addition (of numeric values~amounts):
Addition: 5 + 5 = 10
Addition: 5 + 5 + 5 + 5 = 20
Addition: 100 + 100 = 200
Addition: 100 + 50 + 25 = 175
Concatenation: "5" + "5" = "55"
Concatenation: "5" + "5" + "5" + "5" = "5555"
Concatenation: "100" + "100" = "100100"
concatenation: "100" + "50" + "25" = "1005025"
Concatenation: "birth" + "day" = "birthday"
Concatenation: "birth" + " " + "day" = "birth day"
Concatenation: "birth " + "day" = "birth day"
Concatenation: "birth" + " day" = "birth day"
--------
VARIABLES
-> Variable
-> Attribute
-> Parameter
Variable: variable_string = Value_or_Expression
example: handled = false
example: count = 0
example: greeting = "hi, my name is HK."
example: left_hand = shield
example: strength = 75
example: my_list = split ("blah1;blah2;blah3", ";")
Variables, as can be seen, are NOT attached to an Object (via Object_name.Attribute_name), and thus they can't be used outside of their own script block (they are 'local' VARIABLES). They're temporary+local VARIABLES, they're not 'saved', and thus not 'loadable' anywhere in your game code.
Attribute: Object_name.Attribute_name = Value_or_Expression
example: game.state = 0
example: game.state = "0"
example: player.state = 0
example: player.state = "0"
example: orc.dead = false
example: HK.favorite_color = "black"
example: player.left_hand = shield
example: player.right_hand = sword
example: HK.right_hand = claymore
example: HK.left_hand = claymore
example: HK.favorite_colors_list = split ("black;red", ";")
example: game.count = 0
example: player.count = 0
example: player.strength = 75
example: HK.strength = 100
example: orc.strength = 50
example: HK.physical_damage = (HK.claymore.physical_damage + HK.claymore.physical_damage * HK.strength / 100) - (orc.steel_plate_mail.physical_resistance + orc.steel_plate_mail.physical_resistance * orc.endurance / 100)
as can be seen, Attributes ARE attached to Objects (via Object_name.Attribute_name), and thus they're 'saved' (so long as the Object that holds them, aka that they're attached to, exists and~or still exists, obviously), which means that they can be used~loaded anywhere in the game ('global'). They're permanent (so long as the Object that they're attached to, exists and~or still exists) and they're global, you can use them anywhere in the game.
-------
you could do a script block like this:
'npc1' Object's 'Add Attribute':
(Object Name: npc1)
Atribute Name: favorite_color
Attribute Type: string
Attribute Value: whatever color
'npc1' Object's 'whatever' Verb:
if (npc1.favorite_color = "black") {
msg ("npc1 is awesome!")
} else {
msg ("npc1 is not awesome.")
}
'npc2' Object's 'Add Attribute':
(Object Name: npc2)
Atribute Name: favorite_color
Attribute Type: string
Attribute Value: whatever color
'npc2' Object's 'whatever' Verb:
if (npc2.favorite_color = "black") {
msg ("npc1 is awesome!")
} else {
msg ("npc2 is not awesome.")
}
or, you can do this:
'npc1' Object's 'Add Attribute':
(Object Name: npc1)
Atribute Name: favorite_color
Attribute Type: string
Attribute Value: whatever color
'npc1' Object's 'whatever' Verb:
if (this.favorite_color = "black") {
msg (this.name + " is awesome!")
} else {
msg (this.name + " is not awesome.")
}
'npc2' Object's 'Add Attribute':
(Object Name: npc2)
Atribute Name: favorite_color
Attribute Type: string
Attribute Value: whatever color
'npc2' Object's 'whatever' Verb:
if (this.favorite_color = "black") {
msg (this.name + " is awesome!")
} else {
msg (this.name + " is not awesome.")
}