Looks like an awesome tool I will definitely make use of in my next mod.
I will expand on this to create another couple of functions which I will need in the said mod, specifically:
One to build a 2DA map from spells to their scrolls
One to fetch the scrolls for a given spell resource
One to block an entire school from a kit
When I have these done, I can send them to you so you may add them to the tool, if you want.
Thank you for doing the lion's share of the work on this though, I must say I was kinda discouraged in making my mod because I couldn't find a satisfying way to block a school, and your tool comes in super handy!
Is there a way for tweak mods to access the spells/scrolls added through this library and if so, could you update the first post with the information how to query them?
EDIT: Oh, I've just noticed that everyone on the second page was pondering about this. Sorry about that. >_>
Is there a way for tweak mods to access the spells/scrolls added through this library and if so, could you update the first post with the information how to query them?
EDIT: Oh, I've just noticed that everyone on the second page was pondering about this. Sorry about that. >_>
I noticed you added extra code for something like kitted mages / sorcerers that are supposed to only cast spells from scrolls... However, it's not working as of now...
Tried with
LAF ADD_CLASS_SPELL
STR_VAR
excludeAllNormalWizardSpellsFromThisKit = ~DRAGON_DISCIPLE~
END
but Dragon Disciples are still able to select spells during Character Creation...
I noticed you added extra code for something like kitted mages / sorcerers that are supposed to only cast spells from scrolls... However, it's not working as of now...
Tried with
LAF ADD_CLASS_SPELL
STR_VAR
excludeAllNormalWizardSpellsFromThisKit = ~DRAGON_DISCIPLE~
END
but Dragon Disciples are still able to select spells during Character Creation...
Actually, that was meant for custom kits that had a selection of custom spells rather than normal wizard spells. I added this feature based on a request by @AionZ . All the normal spells should not appear during character creation unless you specifically let them learn particular spells with the tool.
So it's still not possible to make a kit that can only cast spells from scrolls and/or a kit that can only cast, say, level 1 and level 6 spells...?
Let us consider the following example:
If you list all level 1 spells as
kit_exclude = {'DRAGON_DISCIPLE'}
and then start a new game with a Dragon Disciple, you'll get stuck at Character Creation (because there's no level 1 spells to choose from...)
If there are no (or fewer than needed) available spells for a given level, then the tool just needs to create and auto-select a null spell to fill in the gaps.
May not work for mage/bard (the memorization step may require more), but I use such for a Shaman so far without issue, so Sorcerer should work as well.
Memorization works. My shadow adept multiclasses select from whatever spells they get during the learning process. I'm still in the process of distributing scrolls around the game in my mod but the parts around the tool seem to work fine.
I was hoping for some more help with this tool. So far most things work as intended, but I'm still having some issues. I'm not literate enough to understand exactly what's going on, but I'll try my best to explain.
The first thing is that the tool adds a bunch of priest spells that don't do anything that I assume is supposed to be some kind of filler and aren't supposed to be in the priest spellbook, but I can see and memorize them. I see their names are added to hidespl.2da, but are enabled under IS_REMOVED instead of IS_HIDDEN.
I noticed classes with scroll exclusion, in my case my shadow adept kits, become unable to drink potions or use any 'converse' action other than scribing the scrolls they are allowed to. I have a faint idea as to why this happens in regards to how scrolls are excluded but I have no idea how to fix it.
The last thing is that when I use this tool together with the newest pre-release of EEEx, which I just started experimenting with recently, all 'converse' options just stop working entirely. No one can scribe scrolls or drink potions at all. I'm not sure whether it's some kind of incompatibility caused by the update to EEEx and I don't even know who to bring this issue to, but it's made it unusable for me currently.
So it's still not possible to make a kit that can only cast spells from scrolls and/or a kit that can only cast, say, level 1 and level 6 spells...?
Let us consider the following example:
If you list all level 1 spells as
kit_exclude = {'DRAGON_DISCIPLE'}
and then start a new game with a Dragon Disciple, you'll get stuck at Character Creation (because there's no level 1 spells to choose from...)
If there are no (or fewer than needed) available spells for a given level, then the tool just needs to create and auto-select a null spell to fill in the gaps.
May not work for mage/bard (the memorization step may require more), but I use such for a Shaman so far without issue, so Sorcerer should work as well.
Is it possible to enable the 'DONE' button if there are no spells to choose from...?
I mean, a custom (modded) kit can click the 'DONE' if there are no proficiencies to choose from, so I was wondering if the same holds for Chargen Spells...
So it's still not possible to make a kit that can only cast spells from scrolls and/or a kit that can only cast, say, level 1 and level 6 spells...?
Let us consider the following example:
If you list all level 1 spells as
kit_exclude = {'DRAGON_DISCIPLE'}
and then start a new game with a Dragon Disciple, you'll get stuck at Character Creation (because there's no level 1 spells to choose from...)
Is it possible to enable the 'DONE' button if there are no spells to choose from...?
I mean, a custom (modded) kit can click the 'DONE' if there are no proficiencies to choose from, so I was wondering if the same holds for Chargen Spells...
@_Luke_: At least for the CHARGEN_CHOOSE_SPELLS menu, the following can be used to detect and bypass deadlocks. You have to trick the engine into thinking it has used all of the available spell picks.
Change the "Done" handling in CHARGEN_CHOOSE_SPELLS:
button
{
on return
area 438 718 206 44
bam GUIOSTUM
text "DONE_BUTTON"
text style "button"
clickable lua "createCharScreen:IsDoneButtonClickable()"
action "createCharScreen:OnDoneButtonClick()"
}
Turns into:
button
{
on return
area 438 718 206 44
bam GUIOSTUM
text "DONE_BUTTON"
text style "button"
clickable lua "B3ChargenChooseSpellsDoneButtonClickable()"
action "B3ChargenChooseSpellsDoneButtonClick()"
}
And put the following in UI.MENU or a M_*.lua file:
function B3ChargenChooseSpellsDoneButtonClickable()
local remaining = 0
for _, entry in ipairs(chargen.choose_spell) do
if not entry.enabled then
remaining = remaining + 1
end
end
if remaining < chargen.extraSpells then
return true
end
return createCharScreen:IsDoneButtonClickable()
end
function B3ChargenChooseSpellsDoneButtonClick()
if chargen.extraSpells > 0 then
local dummyChooseSpellEntry = {
["key"] = "B3DummyInvalidSpellResRef",
["enabled"] = false
}
chargen.choose_spell[-1] = dummyChooseSpellEntry
local curSpellBookLevel = spellBook[chargen.currentSpellLevelChoice]
curSpellBookLevel.B3DummyInvalidSpellResRef = {
["specialist"] = true
}
for i = 1, chargen.extraSpells do
createCharScreen:OnLearnMageSpellButtonClick(-1)
dummyChooseSpellEntry.enabled = false
end
curSpellBookLevel.B3DummyInvalidSpellResRef = nil
chargen.choose_spell[-1] = nil
end
createCharScreen:OnDoneButtonClick()
end
@_Luke_: At least for the CHARGEN_CHOOSE_SPELLS menu, the following can be used to detect and bypass deadlocks. You have to trick the engine into thinking it has used all of the available spell picks.
Change the "Done" handling in CHARGEN_CHOOSE_SPELLS:
button
{
on return
area 438 718 206 44
bam GUIOSTUM
text "DONE_BUTTON"
text style "button"
clickable lua "createCharScreen:IsDoneButtonClickable()"
action "createCharScreen:OnDoneButtonClick()"
}
Turns into:
button
{
on return
area 438 718 206 44
bam GUIOSTUM
text "DONE_BUTTON"
text style "button"
clickable lua "B3ChargenChooseSpellsDoneButtonClickable()"
action "B3ChargenChooseSpellsDoneButtonClick()"
}
And put the following in UI.MENU or a M_*.lua file:
function B3ChargenChooseSpellsDoneButtonClickable()
local remaining = 0
for _, entry in ipairs(chargen.choose_spell) do
if not entry.enabled then
remaining = remaining + 1
end
end
if remaining < chargen.extraSpells then
return true
end
return createCharScreen:IsDoneButtonClickable()
end
function B3ChargenChooseSpellsDoneButtonClick()
if chargen.extraSpells > 0 then
local dummyChooseSpellEntry = {
["key"] = "B3DummyInvalidSpellResRef",
["enabled"] = false
}
chargen.choose_spell[-1] = dummyChooseSpellEntry
local curSpellBookLevel = spellBook[chargen.currentSpellLevelChoice]
curSpellBookLevel.B3DummyInvalidSpellResRef = {
["specialist"] = true
}
for i = 1, chargen.extraSpells do
createCharScreen:OnLearnMageSpellButtonClick(-1)
dummyChooseSpellEntry.enabled = false
end
curSpellBookLevel.B3DummyInvalidSpellResRef = nil
chargen.choose_spell[-1] = nil
end
createCharScreen:OnDoneButtonClick()
end
Sorry, I forgot to ask the following:
Is it possible to learn innate/class (type=4) abilities in this way?
That is to say: is it possible to have a CHARGEN_CHOOSE_SPELLS menu for classes different from Wizard / Sorcerer / Cleric / Druid?
The answer is probably no (since you cannot track innate/class abilities), but just in case I'm missing something...
EDIT: well, now that I think of it, I could use the HLA screen... However, "lunumab.2da" is class-based, not kit-based, so I cannot restrict it to my custom kit... Unless you can achieve that with some Lua magic... If that's the case, then I once again need your help...
@_Luke_: CHARGEN_CHOOSE_SPELLS can only add mage / priest spells. Editing the HLA menu might be possible, but not easily. It would require efforts similar to this tool, and without investigating it further I can't say whether it would yield anything.
@_Luke_: CHARGEN_CHOOSE_SPELLS can only add mage / priest spells. Editing the HLA menu might be possible, but not easily. It would require efforts similar to this tool, and without investigating it further I can't say whether it would yield anything.
I see.
In case you manage to investigate it further, please let us know...
Okay, I just updated this tool to keep track of all spells added with it (along with the vanilla SPWI and SPPR spells that can be learned) in a series of .txt files: MEWI[1-9].txt for wizard spells and MEPR[1-7].txt for priest spells. They can be read using READ_2DA_ENTRY and similar functions.
I was hoping for some more help with this tool. So far most things work as intended, but I'm still having some issues. I'm not literate enough to understand exactly what's going on, but I'll try my best to explain.
The first thing is that the tool adds a bunch of priest spells that don't do anything that I assume is supposed to be some kind of filler and aren't supposed to be in the priest spellbook, but I can see and memorize them. I see their names are added to hidespl.2da, but are enabled under IS_REMOVED instead of IS_HIDDEN.
I noticed classes with scroll exclusion, in my case my shadow adept kits, become unable to drink potions or use any 'converse' action other than scribing the scrolls they are allowed to. I have a faint idea as to why this happens in regards to how scrolls are excluded but I have no idea how to fix it.
The last thing is that when I use this tool together with the newest pre-release of EEEx, which I just started experimenting with recently, all 'converse' options just stop working entirely. No one can scribe scrolls or drink potions at all. I'm not sure whether it's some kind of incompatibility caused by the update to EEEx and I don't even know who to bring this issue to, but it's made it unusable for me currently.
I think the current update should fix these issues.
Based on what I've heard, the newest version of this spell tool tracks arcane spells per spell level 0-39 but divine spells 0-59. Should this be?
What happens if there's another spell with the same filename? What about SP..x49 dummy spells with no headers? (Those were subtledoctor's newest concerns.)
Based on what I've heard, the newest version of this spell tool tracks arcane spells per spell level 0-39 but divine spells 0-59. Should this be?
What happens if there's another spell with the same filename? What about SP..x49 dummy spells with no headers? (Those were subtledoctor's newest concerns.)
Thankee!
The initial tracking of spells is simply meant to list the vanilla spells. Any spell that is added with the spell tool will also be tracked, regardless of its filename.
With the same filename as what?
And why would someone make a spell with no headers? Even if no one is meant to cast the spell, it's simpler for installers if every spell has a header.
Thank you for this tool But....
I don't understand. I've installed my mod which installs 3 level 9 spells with "ADD_SPELL" and 10 level 9 spells just copied and the corresponding 10 scrolls for mage/bard created.
I'm trying to get some of the 10 spells to appear in the sorcerer's spell selection list, and I'm using:
INCLUDE ~Derats_Magasin_2/ClassSpellTool.tpa~
COPY_EXISTING ~pxl2maid.spl~ ~override~
LAF ADD_CLASS_SPELL STR_VAR resref=~pxl2maid~ class_include=~{'MAGE_ALL', 'SORCERER', 'BARD'}~ END
COPY_EXISTING ~pxl2sqma.spl~ ~override~
LAF ADD_CLASS_SPELL STR_VAR resref=~pxl2sqma~ class_include=~{'MAGE_ALL', 'SORCERER', 'BARD'}~ END
COPY_EXISTING ~pxl2elxi.spl~ ~override~
LAF ADD_CLASS_SPELL STR_VAR resref=~pxl2elxi~ class_include=~{'MAGE_ALL', 'SORCERER', 'BARD'}~ END
None of these spells appear in the list of selectable spells when my test sorcerer reaches level 18 (my 3 spells with ADD_SPELL do).
I looked at Olvyn spell's TP2 to see how it install his spells, and it doesn't seem any different (except for the classes, simplified to a single number).
// Log of Currently Installed WeiDU Mods
// The top of the file is the 'oldest' mod
// ~TP2_File~ #language_number #component_number // [Subcomponent Name -> ] Component Name [ : Version]
~PX_CHANTELAME/SETUP-PX_CHANTELAME.TP2~ #1 #0 // Chantelame version 6, par Misdrha'al Hymmet, Deratiseur et Isaya: 6
~DERATS_OGRE/SETUP-DERATS_OGRE.TP2~ #1 #0 // The ogre and the dwarf, a blue story: Version 3
~DERATS_DAWAP/SETUP-DERATS_DAWAP.TP2~ #0 #0 // Fleau: v2
~DERATS_DAWAP/SETUP-DERATS_DAWAP.TP2~ #0 #2 // Psychotope: v2
~DERATS_DAWAP/SETUP-DERATS_DAWAP.TP2~ #0 #9 // Zap: v2
~DERATS_MAGASIN_2/SETUP-DERATS_MAGASIN_2.TP2~ #0 #0 // L'interplan, Articles magiques: v8 (100 new arcane spells)
So to see if it came from one of my mods (no reason, I kept them simple and didn't touch anything that could compromise other mods), I copied a fresh install of B2EE (without any mods) and installed ONLY my module. And it still doesn't work.
This is my MEWI9.txt in the override after installation:
That looks correct. Could you check your M_MEEXSP.lua? I've grabbed my simplest setups and those all work... although you might also need to use numbers.
LAF ADD_CLASS_SPELL STR_VAR resref=~ZGMW510~ scroll=~ZGMW510S~ class_include=~{202, 5, 19}~ END
LAF ADD_CLASS_SPELL STR_VAR resref=~ZGMEYEP~ class_include=~{204, 208, 3, 11, 21}~ END
LAF ADD_CLASS_SPELL STR_VAR resref=~ZGMEYEW~ scroll=~ZGMEYEWS~ class_include=~{202, 5, 19}~ END
I give up. To make sure it works, I've
Copied a brand new BG2EE 2.6 without any mods
Just put my mod
Modified my tp2 so that it installs NO spells with ADD_SPELL (in case this function interferes with the other one)
Added
COPY ~Derats_Magasin_2/Sorts/pxl2gnua.spl~ ~override~ SAY NAME1 @60911 SAY UNIDENTIFIED_DESC @60912
LAF ADD_CLASS_SPELL STR_VAR resref=~pxl2gnua~ scroll= ~pxl2gnus~ class_include= ~{202, 5, 19}~ END
And only that.
It doesn't work. The scroll isn't created, the spell isn't visible to a sorcerer arriving at level 18.
However, everything seems ok, here are my files:
M_MEEXSP.lua
me_numKitsChecked = 72
-- A kit in this list can only learn priest spells that have the kit under kit_include in the me_addSpellChoice list, regardless of what class_include says.
me_excludeAllNormalPriestSpellsFromTheseKits = {}
-- A kit in this list can only learn wizard spells that have the kit under kit_include in the me_addSpellChoice list, regardless of what class_include says.
me_excludeAllNormalWizardSpellsFromTheseKits = {}
-- New spell choices should be put in this list.
me_addSpellChoice = {
{
["resref"] = "pxl2gnua",
["scroll"] = "pxl2gnus",
["icon"] = "PXL2GNUC",
["groundicon"] = "PXL2GNUB",
["level"] = 9,
["type"] = 1,
["name"] = 104642,
["description"] = 104643,
["class_include"] = {1, 7, 10, 13, 14, 17, 5, 19, },
["kit_include"] = {},
["kit_exclude"] = {},
["alignment_exclude"] = {}
},
}
It's a shame. A function that adds spells outside the normal limit, that manages the creation of scrolls with prohibited schools automatically, that can create spells forbidden to certain kits/alignments, that's absolutely GENIUS. But as usual, I'm DAMNED.
Comments
I will expand on this to create another couple of functions which I will need in the said mod, specifically:
When I have these done, I can send them to you so you may add them to the tool, if you want.
Thank you for doing the lion's share of the work on this though, I must say I was kinda discouraged in making my mod because I couldn't find a satisfying way to block a school, and your tool comes in super handy!
Would your tool provide a standardized way to swap spontaneous caster spells in the Unearthed Arcana mods (Tome & Blood, etc.)?
Subtledoctor, author of said mods, wants to talk with you here about your proposed tool. Enjoy! Thankee!
Is there a way for tweak mods to access the spells/scrolls added through this library and if so, could you update the first post with the information how to query them?
EDIT: Oh, I've just noticed that everyone on the second page was pondering about this. Sorry about that. >_>
Regexp search in "M_MEEXSP.lua"...?
I noticed you added extra code for something like kitted mages / sorcerers that are supposed to only cast spells from scrolls... However, it's not working as of now...
Tried with but Dragon Disciples are still able to select spells during Character Creation...
Actually, that was meant for custom kits that had a selection of custom spells rather than normal wizard spells. I added this feature based on a request by @AionZ . All the normal spells should not appear during character creation unless you specifically let them learn particular spells with the tool.
I see, thanks for clarifying.
So it's still not possible to make a kit that can only cast spells from scrolls and/or a kit that can only cast, say, level 1 and level 6 spells...?
Let us consider the following example:
If you list all level 1 spells as and then start a new game with a Dragon Disciple, you'll get stuck at Character Creation (because there's no level 1 spells to choose from...)
May not work for mage/bard (the memorization step may require more), but I use such for a Shaman so far without issue, so Sorcerer should work as well.
To tell the truth, I need that for a FIGHTER_MAGE kit... So yes, memorization is involved...
Your spell tool seemingly invalidated Tome and Blood's Sorcerer spell selection ability.
Proposed solution.
The first thing is that the tool adds a bunch of priest spells that don't do anything that I assume is supposed to be some kind of filler and aren't supposed to be in the priest spellbook, but I can see and memorize them. I see their names are added to hidespl.2da, but are enabled under IS_REMOVED instead of IS_HIDDEN.
I noticed classes with scroll exclusion, in my case my shadow adept kits, become unable to drink potions or use any 'converse' action other than scribing the scrolls they are allowed to. I have a faint idea as to why this happens in regards to how scrolls are excluded but I have no idea how to fix it.
The last thing is that when I use this tool together with the newest pre-release of EEEx, which I just started experimenting with recently, all 'converse' options just stop working entirely. No one can scribe scrolls or drink potions at all. I'm not sure whether it's some kind of incompatibility caused by the update to EEEx and I don't even know who to bring this issue to, but it's made it unusable for me currently.
Is it possible to enable the 'DONE' button if there are no spells to choose from...?
I mean, a custom (modded) kit can click the 'DONE' if there are no proficiencies to choose from, so I was wondering if the same holds for Chargen Spells...
Summoning @Bubb for extra help...
Change the "Done" handling in CHARGEN_CHOOSE_SPELLS:
Turns into:
And put the following in UI.MENU or a M_*.lua file:
Thanks mate, that's much appreciated!
Sorry, I forgot to ask the following:
Is it possible to learn innate/class (type=4) abilities in this way?
That is to say: is it possible to have a CHARGEN_CHOOSE_SPELLS menu for classes different from Wizard / Sorcerer / Cleric / Druid?
The answer is probably no (since you cannot track innate/class abilities), but just in case I'm missing something...
EDIT: well, now that I think of it, I could use the HLA screen... However, "lunumab.2da" is class-based, not kit-based, so I cannot restrict it to my custom kit... Unless you can achieve that with some Lua magic... If that's the case, then I once again need your help...
I see.
In case you manage to investigate it further, please let us know...
Also...
@TheArtisan
I think the current update should fix these issues.
Thankee!
What happens if there's another spell with the same filename? What about SP..x49 dummy spells with no headers? (Those were subtledoctor's newest concerns.)
Thankee!
The initial tracking of spells is simply meant to list the vanilla spells. Any spell that is added with the spell tool will also be tracked, regardless of its filename.
With the same filename as what?
And why would someone make a spell with no headers? Even if no one is meant to cast the spell, it's simpler for installers if every spell has a header.
I don't understand. I've installed my mod which installs 3 level 9 spells with "ADD_SPELL" and 10 level 9 spells just copied and the corresponding 10 scrolls for mage/bard created.
I'm trying to get some of the 10 spells to appear in the sorcerer's spell selection list, and I'm using:
None of these spells appear in the list of selectable spells when my test sorcerer reaches level 18 (my 3 spells with ADD_SPELL do).
I looked at Olvyn spell's TP2 to see how it install his spells, and it doesn't seem any different (except for the classes, simplified to a single number).
What did I do wrong?
I've noticed that unlike regular spell components, ClassSpellTool spells need to come after kits to be added to every one of them.
So to see if it came from one of my mods (no reason, I kept them simple and didn't touch anything that could compromise other mods), I copied a fresh install of B2EE (without any mods) and installed ONLY my module. And it still doesn't work.
This is my MEWI9.txt in the override after installation:
Copied a brand new BG2EE 2.6 without any mods
Just put my mod
Modified my tp2 so that it installs NO spells with ADD_SPELL (in case this function interferes with the other one)
Added And only that.
It doesn't work. The scroll isn't created, the spell isn't visible to a sorcerer arriving at level 18.
However, everything seems ok, here are my files:
M_MEEXSP.lua
It's a shame. A function that adds spells outside the normal limit, that manages the creation of scrolls with prohibited schools automatically, that can create spells forbidden to certain kits/alignments, that's absolutely GENIUS. But as usual, I'm DAMNED.
How does this tool work for mods which have non-EE and EE spell versions like teleport without error?
Thankee!