Angel Posted March 30, 2019 Posted March 30, 2019 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? Quote
kjeron Posted March 30, 2019 Posted March 30, 2019 (edited) 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 March 30, 2019 by kjeron Quote
Jarno Mikkola Posted March 30, 2019 Posted March 30, 2019 So the crash happens because there's no strings attached to the file, associated with the new spell ? Erhm, any comment about the non-EE BG2 versions "Crash" ? Quote
Angel Posted March 30, 2019 Author Posted March 30, 2019 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. Quote
Angel Posted March 30, 2019 Author Posted March 30, 2019 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"},~ Quote
kjeron Posted March 30, 2019 Posted March 30, 2019 (edited) Yes - you shouldn't use lower case resource references anyway, as some resource fields do not accept lower case letters. Edited March 30, 2019 by kjeron Quote
Angel Posted March 30, 2019 Author Posted March 30, 2019 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. Quote
Recommended Posts
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.