Skip to content

[MOD] Classic Spellbook for BG:EE, SoD and BG2:EE

KilivitzKilivitz Member Posts: 1,459
edited February 2017 in UI Modding

This mod restores the functionality of the Mage and Priest screens to their classic pre-2.0 behavior.

- Compatible with BG:EE (with or without SoD) and BG2:EE
- Download link at the end of this post

image

It works exactly like in the original games:

- Left-click on a known spell memorizes it.
- Right-click on a known spell opens a new window with its description (and Erase button, if you're a Mage or Bard)
- Left-click on a memorized spell unmemorizes it.
- Right-click on a memorized spell also opens their spell description window.

This is for players who like me, were too used to the way spellbooks worked before the 2.0 patch. There is also a very good argument for the consistency of how screens work and what left or right-clicking on things do put forth by Adul in this post.

More Screenshots:

BG:EE:
image
image
image

SoD:
image
image
image

BG2:EE
image
image
image

How to Install:

1a) Download and extract the file attached to this post.

1b) Open the "Graphics" folder corresponding to the game you'll be modding. Copy those files to the "Override" folder of your game.

2a) Open the "Code" txt file corresponding to the game you'll be modding.

2b) Also open the UI.MENU file on the "Override" folder of your game. If you're new to messing with your game's UI and this step didn't make any sense, take a look at this thread.

3a) On your UI.MENU, find these lines:

`
function magePageInfo()
3b) Select everything from the lines above (including them) to these lines (including them, too):
			createPriestMemorizationSparkle(2, 0, 40, 40, 'bookListPriest', -1)
showPriestMemorizationFlash = true
priestScreen:MemorizeSpell( characters[id].priestSpells[currentSpellLevel][currentBookSpell].level, characters[id].priestSpells[currentSpellLevel][currentBookSpell].index )

"

}
}
3c) Paste the contents of Code.txt over the selected code on UI.MENU.

Final Notes:

This mod was built upon the Mage/Priest spells screen component of Lefreut's Enhanced UI and would not get made anytime soon (not by me, at least) without the help of his code.

Let me know if you find any bugs.
AstroBryGuyCrevsDaaklefreutNoobaccaelminsterAdulRavenslightagris

Comments

  • AstroBryGuyAstroBryGuy Member Posts: 3,437
    @Kilivitz - Is this compatible with your Revised Dragon Scale UI for SoD (V2) mod?
  • KilivitzKilivitz Member Posts: 1,459
    @AstroBryGuy yes it is. In fact I've tested it with V3, which I should have posted already.
  • AstroBryGuyAstroBryGuy Member Posts: 3,437
    Cool. Can't wait to see v3 of RDSUI!
    Kilivitz
  • AdulAdul Member Posts: 2,002
    Great and lovely work, I like it much better already. And I like it that it's easier to tell the difference between spell icons that are fully memorized and the ones that are only queued up for memorization (that are faded).

    I've noticed that your mod asks confirmation for unmemorizing a memorized spell as well as for deleting a known spell, even when the "More confirmation prompts" feedback option is turned off. Is there any way to incorporate that setting for those of us who prefer less prompts?

    One more thing: I personally prefer the original (1.3 and earlier) behavior of memorization slots where you had full control over which slot you want to memorize and unmemorize spells from. In contrast, the 2.0+ UI forces your spells into your memorization slots in alphabetical order (instead of letting you set the memorization order), and forces you to unmemorize spells that aren't fully memorized before it lets you remove actual memorized spells of the same type.

    Do you think it would be possible to restore the original behavior of the memorization slots?
    Kilivitz
  • KilivitzKilivitz Member Posts: 1,459
    Hi there @Adul, sorry about not replying to you sooner.
    Adul said:

    I've noticed that your mod asks confirmation for unmemorizing a memorized spell as well as for deleting a known spell, even when the "More confirmation prompts" feedback option is turned off. Is there any way to incorporate that setting for those of us who prefer less prompts?

    It seems the unmodded spellbook doesn't ask for confirmation even with "More confirmation prompts" turned on. In that case, I wouldn't know how to make it respond to that toggle.

    However, if you'd like to remove the prompt from your game, what you can do is find this line
    popup2Button(11824, 'DELETE_BUTTON', function() removeMageSpell(idx) end)
    and replace it with
    mageScreen:UnmemorizeSpell( bottomSpells[idx].level, bottomSpells[currentBottomSpell].memorizedIndex )
    That's for the Mage Book. For the Priest Scroll, replace this
    popup2Button(11824, 'DELETE_BUTTON', function() removePriestSpell(idx) end)
    with this
    priestScreen:UnmemorizeSpell( bottomSpells[idx].level, bottomSpells[currentBottomSpell].memorizedIndex )
    I haven't tested it extensively, but it seems to be working. Let me know if there are any problems.
    Adul said:

    the 2.0+ UI forces your spells into your memorization slots in alphabetical order (instead of letting you set the memorization order), and forces you to unmemorize spells that aren't fully memorized before it lets you remove actual memorized spells of the same type.

    Do you think it would be possible to restore the original behavior of the memorization slots?

    I've been searching around for a function related to this behavior but so far I have yet to find anything.
    Adul
  • AdulAdul Member Posts: 2,002
    @Kilivitz Thank you for the response! I've never noticed that the original UI doesn't ask confirmation for unmemorizing, even when it's supposed to be turned on. That's strange, could be a bug, I suppose.

    Thanks for the solution, I'll try it.
    Kilivitz said:

    Adul said:

    the 2.0+ UI forces your spells into your memorization slots in alphabetical order (instead of letting you set the memorization order), and forces you to unmemorize spells that aren't fully memorized before it lets you remove actual memorized spells of the same type.

    Do you think it would be possible to restore the original behavior of the memorization slots?

    I've been searching around for a function related to this behavior but so far I have yet to find anything.
    Now that I think about it, I'd be surprised if that behavior could be altered from UI.menu. Sadly, lower level functions like that are usually hardcoded, in my experience.
  • agrisagris Member Posts: 581
    edited November 2018
    Kilivitz said:

    3a) On your UI.MENU, find these lines:


    `
    function magePageInfo()
    3b) Select everything from the lines above (including them) to these lines (including them, too):
    			createPriestMemorizationSparkle(2, 0, 40, 40, 'bookListPriest', -1)
    showPriestMemorizationFlash = true
    priestScreen:MemorizeSpell( characters[id].priestSpells[currentSpellLevel][currentBookSpell].level, characters[id].priestSpells[currentSpellLevel][currentBookSpell].index )

    "

    }
    }
    3c) Paste the contents of Code.txt over the selected code on UI.MENU.

    FYI, for BG1:EE 2.5.17, 3b is out of date. This mod still works perfectly on it though, but 3b's quoted text block doesn't exist as is. You can find its 2.5 analogue by searching for priestScreen:MemorizeSpell, but crucially you need to replace a *lot* of lines after it, until you get to the final end-block bracket ("}").

    This corresponds to lines 7477 - 9716, or 7294 - 9533 for Lefreut's BG1 UI or UI_25.menu.

    I'm not actually sure what the difference is between the two .menu files, as Lefreut's mod installs both of them on 2.5, but I modified both with Kilivitz's BG1:EE code and it worked.

    @lefreut

  • lefreutlefreut Member Posts: 1,462
    agris said:

    I'm not actually sure what the difference is between the two .menu files, as Lefreut's mod installs both of them on 2.5, but I modified both with Kilivitz's BG1:EE code and it worked.

    My mod supports 2.3 and 2.5, this is why it ships with two UI.menu. When you install it on 2.5, UI_25.menu will be copied over UI.menu and both should have the same content. Anyway, the game only uses UI.menu so if you want to make changes, you only need to edit UI.menu.
    agris
  • agrisagris Member Posts: 581
    edited November 2018
    I have to temper my original post with this fact: the classic spellbook works without any problems in the spellbooks, but for some reason the modification causes a bug in the general dialogue window, despite the code not touching that aspect of it (afaik). When I don't use the classic spellbook code in Lefreut's BG1 UI mod, I don't have the bug.

    When talking to an NPC with the modded spellbook installed on top of @lefreut's BG1:EE UI mod, the top of the dialogue window is always scrolled up 2 lines when NPC text is printed there in dialogue. That includes their text when you first start conversation, and all subsequent text when you select dialogue options. Like this:



    When it should be this:



    This is with lefreut's UI_25.menu, in his mod's folder (LeUI-BG1EE\copy\) prior to being installed, modified with the classic spellbook code. To modify UI_25.menu, I:
    1. Opened the above-mentioned UI_25.menu, and deleted lines 7294 - 8810, encompassing the entire "function magePageInfo()" block.
    2. Deleted everything from lines (line numbers prior to deletion in #1) 8811 to 9533, encompassing the entire "function priestPageInfo()" block.
    3. Copied @Kilivitz's "Code_BGEE.txt" into UI_25.menu, ensuring that the "`" and "}" are at the start and end of each PageInfo block, respectively
    4. Proceeded to install lefreut's mod, along with the rest of my BG1:EE mods.

    Performing a --change-log on UI.menu after modding BG1 shows that in addition to lefreut's mod, only A7's hidden gameplay options modifies it.

    I've diff'd UI.menu, after installing all my mods, between the modified one and the regular one, and don't see any code differences that would impact the dialogue screen. I'm out of ideas, do any of you have one?

    UI.menu.lefreutOrig
    UI.menu.classicSB
    UI.menu.diff

    Lefreut, Kilivitz's code was written pre 2.5, around Feb 2017, which makes it based on a pretty old version of your UI mod. Did any of your releases ever have the bug that I described? What block of the .menu file controls text in the dialogue window and what lines it displays?


    edit: I'm using BG1:EE v2.5.17 (Steam).
    Post edited by agris on
  • prashrangerprashranger Member Posts: 5
    edited April 2022
    I can't find the 'Override' folder of the game, or the 'UI.menu' file.

    EDIT: nvm I think I've figured it out
Sign In or Register to comment.