Jump to content

Need help with adding Sequencer-type spells in EE


Angel

Recommended Posts

So for an upcoming mod, I want to add a new sequencer-type spell: Spell Matrix.  (5th level, stores two 3rd level spells, adapted from 3.5e Player's Guide to Faerun)

I started with editing a copy of spwi420, Minor Sequencer.  In addition to the base spell, EE also has spwi420d and spwi420p, the latter is missing in non-EE BG2.  So I copied those as well. I edited spwi420 to be fifth level and allow up to 3rd level spells, and everything works as expected in EE.

Of course I don't want to alter Minor Sequencer but I want to have my own spell.  So I renamed my copy of spwi420 in override to spwi529, the first free slot in my setup.  I renamed spwi420d and spwi420p as well, and then I went through all the resource fields in the spell effects of all three spells and changed those accordingly as well.  Literally nothing else was changed.

However, when I try it in BG(2)EE, I get a crash to desktop.  But if I put the same files in non-EE BG2 it works perfectly.  As stated above I did catch the extra <spellname>p.spl file that non-EE BG2 doesn't have (same as <spellname>d.spl except that it targets an area instead of a creature), but something else must be missing.  Does anyone know what?

Link to comment

The UI needs a few strings to display while the sequencer is being selected.

OUTER_SET tip = RESOLVE_STR_REF (@1234)

APPEND    ~BGEE.LUA~    ~mageBookStrings['%resref%'] = {tip = %tip%, title = '%resref%_SEQUENCER_TITLE', action = "%resref%_SEQUENCER_LABEL"}~
// or
APPEND    ~BGEE.LUA~    ~mageBookStrings['%resref%'] = {tip = %tip%, title = 'Custom Sequencer Spell', action = "Select spells to Sequence"}~

%resref% = your spells resref

%tip% = string reference (integer) from dialog.tlk (description)

title = string label from "L_en_US.lua" (or appropriate language) OR "Text" (title)

action = string label from "L_en_US.lua" (or appropriate language) OR "Text" (sub-title)

If you just want to copy these strings from an existing sequencer/contingency:

APPEND ~BGEE.LUA~ mageBookStrings['%resref%'] = mageBookStrings['SPWI420']~

 

Edited by kjeron
Link to comment

Mm, just appending to bgee.lua does not work, but a little further poking does show that the crash is indeed related to this file.  If I manually add an entry (just copy the line for spwi420 and change it to spwi529) it works.  Guess I'll now have to figure out how to weidu-ize it.  There seems to be precious little documentation on bgee.lua though.

Link to comment

Alright, I got it working.  After much fiddling around, this seems to do the trick:

OUTER_SPRINT spell_res_upper "%spell_res%"
ACTION_TO_UPPER spell_res_upper


COPY_EXISTING "bgee.lua" "override"
  REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH ~mageBookStrings = {~
  ~mageBookStrings = {
      %spell_res_upper% = {tip = 24616, title = 'SPELL_SEQUENCER_TITLE', action = "ADD_SPELLS_SEQUENCER_LABEL"},~

 

Link to comment

Not much choice there, I'm developing on Linux.  The game itself is very inconsistent with case too, sometimes it uses lower, sometimes upper and sometimes even mixed.  But this is actually the first time I encountered a situation where it matters, it seems to work fine for all my items and spells.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...