[v1.3.0+] Schrödinger's Lore (Mark 2)

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

[v1.3.0+] Schrödinger's Lore (Mark 2)

#1 Post by Zizzo »

My original Schrödinger's Lore addon has an annoying bug: because the game's notes on which which lore you've seen is also used to decide whether to place a lore object, the lore listed in the "Show known Lore" dialog will sometimes be different from the lore you've actually seen. In retrospect, I really should have implemented that whole thing differently… :oops:

Anyway, backpatching the proper implementation into the original addon would invove multiple moving parts and would almost certainly break badly, so I'm starting over with a new addon, cleverly named Schrödinger's Lore (Mark 2). :wink: As you can no doubt imagine, you definitely shouldn't use both at once, and if you're going to use either, you should definitely use this one.

[If you're an addon author and your addon adds lore that would benefit from this reordering, you can get in on this too: in your ToME:load hook, check for the presence of the PartyLore:addLoreGroup() method, and if present, call it to add whatever lore groups you need (after loading your lore definitions, of course :wink: ). Check this addon's hooks/load.lua for examples. (Fortunately, this is exactly the same mechanism provided by the original Schrödinger's Lore addon, so your modifications will work the same for both addons.)]

[Technical notes:]

Code: Select all

Hooks:
  ToME:load [to add our lore groups]
  Entity:loadList [to modify lore objects as needed]
Superload:
  mod.class.interface.PartyLore:
    addLoreGroup() [added, to add lore groups (hence the name)]
    getLoreGroup() [added, for use by Party:learnLore() below]
    checkLoreFilter() [added, for lore objects' :checkFilter() method]
  mod.class.Party:
    learnLore() [to check for lore groups and change lore to be learned as needed]
  mod.dialogs.Birther:
    on_register() [show an addon collision dialog if necessary]
Last edited by Zizzo on Sat Mar 16, 2019 12:57 am, edited 1 time in total.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Schrödinger's Lore (Mark 2)

#2 Post by Zizzo »

Frequently Asked Questions:

What's the difference between Schrödinger's Lore and Schrödinger's Lore (Mark 2)? Can I use both?

Schrödinger's Lore and Schrödinger's Lore (Mark 2) both perform the same function of arranging for various groups of lore to be learned in sequence, independent of which actual lore object you happen to find first. Mark 2 uses a slightly better implementation that avoids a problem in the original implementation (basically, different parts of the game disagreed on which lore the player had actually learned).

Both addons modify the same part of the game, so using both of them at once is likely to cause errors or damage your character; the character creation dialog will warn you if you try to create a character with both addons enabled. The original Schrödinger's Lore is officially deprecated in favor of Mark 2, so if you are going to use either, we recommend using Mark 2.

What was wrong with the original Schrödinger's Lore, and why not fix it instead of making a new addon?

The original Schrödinger's Lore implementation tried to avoid altering the internal structure of the lore objects you find lying around on the floor. Unfortunately, the game also uses its internal notes about which lore the player has seen to decide whether to place certain lore on a level at all, with the result that, for instance, vising the orc internment camps in the "wrong" order could lead to some lore not being placed. The attempted fix had the undesirable side effect that the known lore listed in the "Show known Lore" dialog sometimes would not match the lore the player had actually seen, showing some lore you hadn't seen and not showing some lore you had seen.

The proper fix was to use the approach we tried to avoid in the first place: to alter lore objects so that their "should I place this lore?" check would not be confused by our lore reordering. This change was deemed too complex to attempt to retro-fit on the fly onto existing characters; hence the new Mark 2 addon.

But what if I have characters using the original Schrödinger's Lore? Will installing Mark 2 break them?

No, it's fine to have both addons installed, just not both enabled. After installing Schrödinger's Lore (Mark 2), you should go to the Addons dialog and disable the original Schrödinger's Lore addon. Existing characters using the original addon will continue to do so unchanged, while new characters will use Mark 2.

What lore is actually affected by this addon?

Both addons (except where otherwise indicated) will reorder the following groups of lore:
  • In Scintillating Caves, the two lores on level 2 and the two on level 3.
  • In Ruins of Kor'Pul, the two lores on level 1 and the two on level 2.
  • In Daikara, the two lores on level 4.
  • In Grushnak Pride, the two lores on level 1 and the two on level 2. (Mark 2 only, as of release 1.1.1)
  • In Valley of the Moon, the two lores on level 1. (Mark 2 only, as of release 1.1.2)
  • The five letters between Weisman and Rolf.
  • In the Embers of Rage DLC:
    • In Sunwall Outpost, the two lores on level 2 and the two on level 3.
    • The four Internment Camp reports.
    • In Palace of Fumes, the three lores on level 1, the two lores on level 3, and the two lores on level 4. (Mark 2 only, as of release 1.1.3)
If there are other groups of lore you think would benefit from being reordered in this manner, here would be a good place to suggest them. :wink: Other addons may also arrange for some of their lore to be reordered by this addon (as detailed above).
Last edited by Zizzo on Mon Jul 01, 2024 8:35 pm, edited 3 times in total.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Schrödinger's Lore (Mark 2)

#3 Post by Zizzo »

Found a couple more groups of lores that could stand to be properly re-ordered: the ones on Grushnak Pride levels 1 and 2. That's going out as v1a.1.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Schrödinger's Lore (Mark 2)

#4 Post by Zizzo »

Now that the Limmir quest no longer requires an unenchanted amulet to work on, I'm attempting it more often. In the process, naturally, I discovered the two lore pieces on level 1 of Valley of the Moon — out of order, of course, which was a bit confusing. :? Which is where this addon comes in. :mrgreen: v1a.2, just pushed out, now includes support for reordering those lores.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Schrödinger's Lore (Mark 2)

#5 Post by Zizzo »

Pushing one of my older characters through the latter parts of Embers, and it occurs to me that the various lores in Palace of Fumes, plot-significant as they are, would probably benefit from proper ordering. We cover that in v1a.3, just released: three lores on level 1, two on level 3 and two on level 4 (level 2 only has one lore, so no reordering needed).
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Schrödinger's Lore (Mark 2)

#6 Post by Zizzo »

Well, this is embarrassing… :oops: Y'know how, since 1.7.4 or so, the lore for an artifact that pops up when you find it includes an image of the artifact? Well, you probably don't know about it if you're using this addon, since PartyInterface:learnLore() gained some arguments in 1.7.3 and 1.7.4, one of which added that feature, and we weren't propagating those arguments through our superloaded method. (There's also an 'after_learn_cb' argument we weren't propagating, for code that's supposed to be run after you learn the lore, so we might have been really breaking something…)

Anyway, v1a.4 fixes this. We Apologize for the Error.™ :oops: :oops:
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply