Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

There's currently a forum problem with avatars not showing in reactions.
Neverwinter Nights: Enhanced Edition has been released! Visit nwn.beamdog.com to make an order. NWN:EE FAQ is available.
Soundtracks for BG:EE, SoD, BG2:EE, IWD:EE, PST:EE are now available in the Beamdog store.
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Select Spell [Opcode 214] Expansion

AquadrizztAquadrizzt Member Posts: 871
edited December 2016 in Feature Requests
Currently Select Spell allows only two modes: pick from all known (mage) spells and pick from a set list predefined in a .2da file.

It would be incredibly useful if an additional type could be added that allows use of the parameter to select from all known spells of a given level.

e.g. Opcode 214 with type = 2 [known of level], param = 3 [level 3 spells] would allow the caster to select any of their known 3rd level spells.

This has numerous uses, including the opportunity to more accurately replicate spontaneous casting progressions outside of the Sorcerer and Shaman classes.

EDIT: Per @kjeron, the following setup would be ideal:
kjeron said:

Similar format from Bonus Spells opcode:
Param1:
None = all
bit 1 = level 1
bit 2 = level 2
bit 3 = level 3
bit 4 = level 4
etc...
Param2:
none = 2da
bit1 = mage
bit2 = priest
bit3 = innate

Post edited by Aquadrizzt on
CrevsDaakGrammarsalad

Comments

  • subtledoctorsubtledoctor Member Posts: 9,523
    Would be great if there was also an option to select from all known priest spells.

  • OlvynChuruOlvynChuru Member Posts: 1,635
    How about this?

    2: Select from all known mage spells of [parameter] level
    3: Select from all known mage spells of [parameter] level or lower
    4: Select from all known priest spells
    5: Select from all known priest spells of [parameter] level
    6: Select from all known priest spells of [parameter] level or lower
    7: Select from all known innate abilities

  • kjeronkjeron Member Posts: 1,354
    Similar format from Bonus Spells opcode:
    Param1:
    None = all
    bit 1 = level 1
    bit 2 = level 2
    bit 3 = level 3
    bit 4 = level 4
    etc...
    Param2:
    none = 2da
    bit1 = mage
    bit2 = priest
    bit3 = innate

  • subtledoctorsubtledoctor Member Posts: 9,523
  • RaduzielRaduziel Member Posts: 3,208
    Does anyone know how is it going?

    @JuliusBorisov ?

  • subtledoctorsubtledoctor Member Posts: 9,523
    Not holding my breath...

  • AquadrizztAquadrizzt Member Posts: 871
    @Raduziel , although it probably won't be worked on officially, I do have something in the works that performs basically the same as the functionality I requested in the original post (if I've coded it properly...).

  • switswit Member, Translator (NDA) Posts: 401
    @Aquadrizzt, does your implementation work with UI.MENU lua code or it's a different solution? If the former - please post an example code here.

  • subtledoctorsubtledoctor Member Posts: 9,523
    edited October 6
    swit said:

    @Aquadrizzt, does your implementation work with UI.MENU lua code or it's a different solution? If the former - please post an example code here.

    I've got working solutions here and here and here. Nothing involving UI.menu - well, except for sequencers if and when I get around to them. (See below.)

    They are variations on a theme.
    - If necessary clone whatever spells you want spontaneous access to as wizard spells.
    - Create an .EFF using 171 to grant a wizard spell, and give it a spell RES at 0x90 and 0x94 (7 letters max, all uppercase - easiest to make it identical to the name of the .EFF itself).
    - Do that for every wizard spell/clone you want spontaneous access to.
    - Apply permanent 206 against all of those RES names for the EFFs, to your kit or character. There has to be a separate spell for each 206 effect, and then a single spell can use 146 to cast them all on the character.
    - When you "learn" a spell, you apply a spell which uses 321 to cancel the 206 spell relating to the spell you want to learn.
    - When you want to cast a spell, the ability uses 172 to remove every spell that is learnable in your system, and then applies 177 to apply all of those .EFFs you made. You have 206 protection against all of them except the one you have "learned." So your wizard spellbook will be instantly populated with your "learned" spells. The next effect is opcode 214, which polls your known wizard spells. Choose one and cast.

    (So, if your counting, this means that for every spell in the system, you need a related .EFF, a 206 spell, and a 321 spell. In the later versions the wizard spells are cloned as innates, which means another set. To make this work for the ~200 wizard spells, you need ~800 new files logically relating to them. And I've implemented this in parallel in 3 different mods! Adopt a robust mod-prefix/filename system!)

    That most basic version is how my psionics system works. Though, instead of having a single "cast" ability with all of the 177 effects, it has five different ones, one for each psionic discipline. Every time you use an ability it wipes out your spellbook, then populates it with the spells from that discipline and then lets you choose one of those to spell.

    That system works with unlimited casting - it's actually run from an item ability with zero charges. but keeping track of spell slots is harder because just looking at your available spells triggers the 214, which costs you a slot. So with Kjeron's help, I came up with a system to track virtual spell slots by using some of the upper bytes of two proficiencies. Just as I categorized the psionic spells into disciplines, for sorcerers I categorized spells by spell level, and made a "cast spell" ability for each level, which gets refreshed every tie you cast according the current stat value relating to that spell level. So you press"cast 3rd level spell" and it shows you all your known 3rd level spells, and the number of times you can do that corresponds to a stat which tracks your 3rd-level spell slots.

    As I refined the spell slot-tracking mechanism, I realized you don't need to use 214 at all - instead of temporarily populating your wizard spellbook every time you cast a spell, and choosing from those spells, you can simply use 171 to add all your known spells as innate abilities, in the amount corresponding to your spell slots for their spell level. Innate abilities can exist under the spells button (see the Innate HLAs mod), so you can actually add "learned" spells to your wizard spellbook indelibly, and zero out your actual spell slots, so looking at the mage spellbook is exactly like looking at a sorcerer's spellbook. And the spells that get added exist under the "cast spell" button, so when you press that button it shows you every thing you can cast, and how many slots you can use for each one, and it doesn't cost you a slot the way opcode 214 does. In other words, it looks and plays exactly like a sorcerer. And its use of the mage spellbook and the cast spell button means it works perfectly as a mage kit. So that's what I did for the Tome & Blood multiclass sorcerers. (It could work in the bard class too, therefore... but I got more ambitious and instead used this system to give spontaneous casting to a thief kit, thus creating a roguish, 3E-style version of bards (which happily allows for multiclass bards as well).

    The only thing left is to figure out how to "learn spells." It would be trivial to glom onto the 147 effects in scrolls and learn them like a mage, but that would be outrageously strong, and just kind of silly. Short of using UI modding to replicate the sorcerer's "learn spell" screen, which is beyond my time and abilities, I just adapted Aquadrizzt's excellent "learn by dialogue" code, which works wonderfully.

    I've got bonus-spell-slot items working with the spell slot tracking system, and hopefully soon I'll get dynamic stat-based bonus spell slots to work as well. Kjeron has given me some UI mod code that he says will make Sequencers functional with this new system (vanilla sequencers require memorized spells, but this type of caster has none). If that all works out, then the only intractable issue will be that it is impossible to make the Identify spell work with this spellcasting system. Frankly, I don't miss it. ;)

    That's a really quick explanation of the code I've been working on the past few weeks. Sorry if it's unintelligible. I assume this is for your work with adapting 3E rules for IWD2? If so, then the good news it this is pretty damn possible now. Here's the code for my 3E bards.

    Post edited by subtledoctor on
Sign In or Register to comment.