[v1.3.0+] Schrödinger's Lore
Posted: Fri May 18, 2018 12:58 am
As long-time players will know, there are lots of lore entries in the game that are pretty much meant to be read sequentially, and may not make sense if you read them out of order. Usually they're on different levels, which sorts them out well enough, but if more than one are placed on the same level (the two in the first level of Kor'Pul, for instance), the order in which you read them will depend on which lore object you find first, which won't always be the right order.
As a quickie workaround for that, I've whipped up my new Schrödinger's Lore addon. This addon adds the functionality of "lore groups", which are shown in order. If you pick up a lore object for lore that's in a group, then instead of seeing the lore for that object, you'll see the next lore in its group that you haven't seen yet.
For a first pass, the addon defines the following lore groups:
[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
). Check this addon's hooks/load.lua for examples.]
Technical notes:
As a quickie workaround for that, I've whipped up my new Schrödinger's Lore addon. This addon adds the functionality of "lore groups", which are shown in order. If you pick up a lore object for lore that's in a group, then instead of seeing the lore for that object, you'll see the next lore in its group that you haven't seen yet.
For a first pass, the addon defines the following lore groups:
- 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.
- The five letters between Weisman and Rolf.
- In Sunwall Outpost, the two lores on level 2 and the two on level 3.
- The four Internment Camp reports. (This one was my primary motivation for this addon; IIRC, the order the prides are listed in the quest description is different from the order in which you need to do the prides to get the reports in the right order).
[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

Technical notes:
Code: Select all
Hooks:
ToME:load [to add our lore groups]
Superload:
mod.class.interface.PartyLore:
addLoreGroup() [added, to add lore groups (hence the name)]
getLoreGroup() [added, for use by Party:learnLore() below]
mod.class.Party:
learnLore() [to check for lore groups and change lore to be learned as needed]