A problem with ownership, with item links.

XronizeMaster
21 Apr 2022, 21:45

1 letter error. When you set the ownership of a room to the player while items link is active. Confusingly, this only occurs when item links is enabled.


The Pixie
23 Apr 2022, 16:39

Can you give more details. Do you get an error message (check the console with F12)? What exactly happens?

I have to say that ownership was coded with a view to being used with items not rooms, so that may well be the root cause.


XronizeMaster
23 May 2022, 03:34

Super late update because I had to deal with school stuff.

Basically, when dealing with item links and rooms, the room becomes clickable (which is fine by me, I like links) but the name is no longer capitalized. This includes the pronoun "Your", so room names become "your room" instead of "Your room", or "Lara" becomes "lara".

(Note that I do capitalize the names of my characters.)
It gets weirder. When I put an alias for them, it fixes the character (because I capitalize aliases) but not the player, because the player becomes "your".

My research tells me it's because, somewhere along the line, it calls settings.nametransformer, which only takes the alias, so while a capitalized alias of a character works, "your" is from possAdj, which isn't capitalized.

TL;Dr
Item links remove capitalization for room names.


The Pixie
23 May 2022, 07:56

How are you getting links for room names? I am trying to recreate your issue, but my rooms do not have links!


XronizeMaster
23 May 2022, 21:12

https://ibb.co/yqt1NjW

The Link above is the image (from Img BB, image hosting website) but I will explain it here.

Put the item links library in.
Set the room's owner as "me" (so like right below lounge, put owner: "me' or whatever you named the player) and the name of the room becomes "your room"

It's lowercase with links but uppercase without links.


The Pixie
24 May 2022, 09:30

The simple solution, to stop the link, do this in settings.js.

settings.getDefaultRoomHeading = function(item) {
  return sentenceCase(lang.addDefiniteArticle(item, {ignorePossessive:true}) + item.alias)
},

I will look at other solutions, as this does raise issues...


The Pixie
25 May 2022, 12:24

I have uploaded some new file versions. There were a few issues behind it, the biggest being the capitalisation failed if the string starts with HTML.

The commit is here for more details.
https://github.com/ThePix/QuestJS/commit/c2aac32416a0690c6337a384ebf269e1f6a48e69


XronizeMaster
29 May 2022, 23:31

options.noLink causes undefined error for non-room items, including the player.

https://ibb.co/ZWSbcR5


The Pixie
30 May 2022, 07:58

Oops, needs a deault options on line 256

settings.nameTransformer = function(alias, obj, options = {}) {

I have uploaded a new version to gitHub