Could find not function 'GetDefiniteAlias(Element)' Error - Cloak of Darkness

Disva
16 Jan 2022, 03:56

I was following the guide to making Cloak of Darkness ( here: http://docs.textadventures.co.uk/quest/cloak_of_darkness.html ), as I'd finished the Quest Tutorial and wanted to continue learning, but I ran into the following error. When searching for GetDefiniteAlias, the only result is in Quest's Cloak of Darkness tutorial, oddly...was it later removed, and the tutorial wasn't updated? Or am I somehow using it wrong? My script is as follows:

if (not object1.parent = player) {
  msg ("You aren't carry it " + object.article + ".")
}
else if (not object2 = hook) {
  msg ("You can't hang stuff on " + GetDisplayName(object2) + ".")
}
else {
  object1.parent = object2
  msg ("You hang " + GetDefiniteAlias(object1) + " on " + GetDefiniteAlias(object2) + ".")
}

Thank you for your help!


mrangel
16 Jan 2022, 13:11

I think it should say GetDefiniteName.


mrangel
16 Jan 2022, 13:15

Actually, I think GetDisplayName and GetDefiniteAlias in that code snippet should both be GetDefiniteName; otherwise you get incorrect grammar ("You can't hang stuff on door." - should have a "the").

This is a function that was added in Quest 5.8, I believe. It returns the alias of an object, with "the" added to the beginning unless it's a proper name. So you might get "You hang the hat on the hook." with "the", but "you hang the hat on John." without "the".