Mudlet 3.0.0 final is available!

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet 3.0.0 final is available!

Post by Vadi »

https://github.com/Mudlet/Mudlet/blob/d ... .cpp#L8600 nothing to do with mudlet-lua here. Should be able to expand the arguments to shortened directions, I think.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Mudlet 3.0.0 final is available!

Post by Jor'Mox »

Vadi wrote:https://github.com/Mudlet/Mudlet/blob/d ... .cpp#L8600 nothing to do with mudlet-lua here. Should be able to expand the arguments to shortened directions, I think.
The only thing to be careful of here (from what I can tell), is to ensure that the door's presence is stored the same way, regardless of if it is set by using "down" or "d", since the key to the table returned by getDoors is definitely the same as the string used to give the direction of the door when setDoor is called currently.

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Mudlet 3.0.0 final is available!

Post by SlySven »

Oh, hell, that's my area of work - I avoided the TLuaInterpreter::dirToString() & dirToNumber() functions because I was not certain they would always work as intended - but failed to allow for the contracted/abbreviated/initial forms for the directions; in my defence I suspect I was thinking ahead and becoming uneasy about allowing initials to be used as directions because it would likely to get difficult to encode all languages exit directions with unique sets of initials, e.g.
in English we have:
n, ne, e, se, s, sw, w, nw, u, d, i, o
but for say French I think that could become:
n, ne, e, se, s, so, o, no, h, b, d, s (from "sortir")

Ah, well, I ought to be able to fix this for the moment.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Mudlet 3.0.0 final is available!

Post by Jor'Mox »

Unfortunately, the commitment to be 100% backward compatible gets in the way here. When you use the getRoomExits function, the results are returned with the directions being given in full, but when you use the getDoors function, the directions are abbreviated. In an ideal world, both functions would return results with similar formats (either both full directions or both abbreviated ones). And as you point out, abbreviations are more tricky once we start looking at more languages, so full directions would be ideal. But if you change getDoors to be like getRoomExits, then suddenly old code will become broken.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet 3.0.0 final is available!

Post by Vadi »

We'll have to live with it. Breaking scripts just to fix some misalignment is not worth it.

All languages use the same set of 8 directions and making Mudlet be incompatible from one script to the next is not a brilliant idea - we should have the API return consistent results across all languages, with localisation happening in the script as necessary. We will not be helping the community by fracturing available scripts and making it a pain in the arse for coders by forcing them to deal with every language that Mudlet could be replying to it in.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet 3.0.0 final is available!

Post by Vadi »


User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Mudlet 3.0.0 final is available!

Post by SlySven »

I suspect the only way to handle language/directions long-term is to provide a means to allow the user to specify what identifiers and initials to use for each of those 10 - not 8 - exit directions {though some MUDs only use 6}, the reason for both because the former are wanted for UI purposes and the latter for MUD server commands. Whilst we can arrange for sensible Language defaults to be populated automatically, I think users will appreciate the flexibility to override them should their needs require it; that being said we would then need to produce a more unified set of Lua commands to get around the uneven means of specifying/getting exit direction related data which we can offer whilst deprecating but not removing the existing incoherent ones.

I had previously experimented with internally representing ALL exits as a QPair<quint8, QString> where the first part is one of the previous 1-12 codes for "normal" exits and 13 for "special" exits and the second part is either a NULL or a Language specific representation of the exit direction for normal exits and the actual exit string for specials - this was showing promise and made the internal coding logically much simpler - this though did mean any exit specification as a lua argument needed to also be a pair of values (or a table though that may be harder to process in a simple manner?) with the first as that number and the second as the string which could be a nil for all but 13 as an input. OTOH that means that user/package scripts would always have to work with numbers which would eliminate language variations in this matter! :)

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Mudlet 3.0.0 final is available!

Post by SlySven »

The above also means we could/would need to offer "Special Stub Exits" which actually makes sense for MUDs that have odd commands to go to somewhere else - but which the user/player/explorer does not yet know where they go...!

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Mudlet 3.0.0 final is available!

Post by Jor'Mox »

The fact that there are three distinct ways to specify direction in the various Mudlet mapper commands has always been confusing to me, especially since it isn't that all functions accept any of the three variations, but rather that some take one version while others take another, etc. While I understand that all of the various options in place currently are going to have to remain, it would be nice if every mapper function dealing with exits accepted the numbers for direction arguments, and for those that returned things with directions, had an option allowing you to tell it to use numbers in place of direction words or abbreviations. That way existing functionality would be preserved while allowing for a simpler, more consistent way of interacting with things.

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Mudlet 3.0.0 final is available!

Post by SlySven »

@Jor'Mox - Agreed!

The reason, I think that these disparities came about is simply that Mudlet has evolved and different people have added different things and not always adopted (for various reasons) previous methodologies, either because of unfamiliarity or because the existing model could not be stretched to cover a new application. The "keys" for Custom Exit Lines being the worst case as far as I can tell in that they have to be in UPPER-CASE whereas the other commands that use even the same "words" use lower-case only. *sigh*

On the other hand the demands that I18n will place on Mudlet for 4.0 does provide an ideal opportunity to get things right/better going forwards. 8-)

Post Reply