most of quest's commands (scripts/functions/attributes/etc):
(look through these, to try to find the command for what you want to do)
http://docs.textadventures.co.uk/quest/scripts/http://docs.textadventures.co.uk/quest/functions/ (categorical order)
http://docs.textadventures.co.uk/quest/ ... tions.html (alphabetical order)
http://docs.textadventures.co.uk/quest/scopes.htmlhttp://docs.textadventures.co.uk/quest/ ... /game.htmlhttp://docs.textadventures.co.uk/quest/ ... bject.htmlthe 'set' Script~Function (in/under the 'scripts' link in quest doc site):
http://docs.textadventures.co.uk/quest/scripts/set.htmlexamples:
(the first parameter, Object Name, must NOT be in double quotes)
(the middle/second parameter, Attribute Name, MUST BE IN double quotes)
(the third/last paramter, Attribute Value/Expression, depends on its attribute type)
set (player, "hair_length_as_string", "long") // or: player.hair_length_as_string = "long"
set (player, "hair_length_as_integer", 3) // or: player.hair_length_as_integer = 3
set (orc, "dead", false) // or: orc.dead = false
set (game.pov, "alias", "Neonayon") // or: game.pov.alias = "Neonayon"
set (hegemonkhan, "strength_as_string", "strong") // or: hegemonkhan.strength_as_string = "strong"
set (hegemonkhan, "strength_as_integer", 100) // or: hegemonkhan.strength_as_integer = 100
set (game, "pov", Neonayon) // or: game.pov = Neonayon
set (game, "pov", player) // or: game.pov = player
set (game, "pov", HegemonKhan) // or: game.pov = Hegemonkhan
set (game, "greeting", "hello, new player...") // or: game.greeting = "hello, new player..."
--------------
the 'greater than', 'lesser than', and etc operators:
obviously, you need numbers for this comparison, some examples
if (player.hair_length_as_integer = 3 and not player.hair_length_as_string = "long") {
player.hair_length_as_string = "long"
msg ("Your hair is now long.")
}
if (player.hair_length_as_integer > 3) {
msg ("Sorry, but for some reason, your hair currently is blocked from growing longer than length 3:"long", so it shrinks back to 3:long")
player.hair_length_as _integer = 3
player.hair_length_as_string = "long"
}
if (player.hair_length_as_integer < 3) {
msg ("Sorry, but for some reason, your hair currently is blocked from shrinking shorter than length 3:"long", so it grows back to 3:long")
player.hair_length_as _integer = 3
player.hair_length_as_string = "long"
}
// combing the two blocks above:
if (player.hair_length_as_integer < 3 and player.hair_length_as_integer > 3) {
msg ("Sorry, but for some reason, your hair currently is blocked from, shrinking shorter or growing longer, than length 3:"long", so it, shrinkgs or grows, back to 3:long")
player.hair_length_as _integer = 3
player.hair_length_as_string = "long"
}
// combining the top 3 blocks of this code box together (and extra stuff for completeness):
if (player.hair_length_as_integer = 3 and not player.hair_length_as_string = "long") {
player.hair_length_as_string = "long"
msg ("Your hair is now long.")
} else if (player.hair_length_as_string = "long" and not player.hair_length_as_integer = 3) {
player.hair_length_as_integer = 3
} else if (player.hair_length_as_string = "long") {
msg ("Your hair is already long")
} else {
msg ("Sorry, but for some reason, your hair currently is blocked from, shrinking shorter or growing longer, than length 3:"long", so it, shrinkgs or grows, back to 3:long")
player.hair_length_as _integer = 3
player.hair_length_as_string = "long"
}
actually, ALL SYMBOLS~CHARACTERS (the 'char' data/attribute type: uses single quotes, as opposed to the double quotes for string data/attribute types, haven't tested if/how quest uses 'char' or not) have a numeric value:
http://www.asciitable.com/ (U.S.)
https://en.wikipedia.org/wiki/List_of_U ... characters (international)
for example:
ASCII:
'A' (char data/attribute type) = 65
'a' (char data/attribute type) = 97
thus:
if ('A' < 'a') -> TRUE
if ('A' > 'a') -> FALSE
this is how:
my_variable = "HK"
if (my_variable = "HK") -> TRUE
// if ("HK" = "HK") -> TRUE
my_variable = "Neonayon"
if (my_variable = "HK") -> FALSE
// if ("Neonayon" = "HK") -> TRUE
works, it compares char by char, as seen below:
if ("ab" < "az") -> ???
if (a:97 < a:97) -> (so far it's) FALSE (but we're not done, there's more chars to compare)
if (b:98 < z:122) -> TRUE
--
if ("ab" = "az") -> ???
if (a:97 = a:97) -> (so far it's) TRUE (but we're not done, there's more chars to compare)
if (b:98 = z:122) -> FALSE
--
if ("ab" > "az") -> ???
if (a:97 > a:97) -> (so far it's) FALSE (but we're not done, there's more chars to compare)
if (b:98 > z:122) -> FALSE