I want to show npc ownership in an item’s name; something simlar to
watch : Thing 'watch/timepiece' '{the bob/his} watch'
"It has no numbers on it. "
Of course, this does not work, and I don’t want to just resort to naming it ‘bob’s watch’ because I want to be able change how bob is referred to while still noting whose watch it is. What should I do?
You’re using a template, and that spot in the template contains the name property. You should be able to replace the name property with a method that returns a single-quoted string. (You will also have to state the desc property explicitly rather than using the template.)
Something like this (untested):
watch : Thing 'watch/timepiece'
name () {
local str;
if (bob.hasName) str = 'Bob\'s watch';
else str = 'watch';
return str;
}
aName = (bob.hasName ? name : 'a watch')
theName = (bob.hasName ? name : 'the watch')
desc = "It has no numbers on it. "