Jump to content
Sign in to follow this  
DavidW

IDS entries for SR spells

Recommended Posts

I'm revising the section of SCS that pays attention to SR, both to catch up with SR changes over the last few years and to try to more deeply integrate SR's magic system into my AI. Doing that requires me to assign SPELL.IDS entries to SR spells, since SCS mostly references spells by their IDS entry rather than their filename - none of the new ones have an IDS entry, and some of the ones occupying previously-used slots have really misleading ones that are an invitation for me to make a mistake.

 

Since other mods might want to do the same (indeed, SR might want to do the same in due course) I thought I'd make the code, and more importantly my choice of public here. The main goals are (1) use the same ids entries as IWD:EE does (and as IWDification does) when an SR spell is a conversion of an IWD spell; (2) make sure names are not radically misleading.

 

Most of the IDS entries added are for entirely new spells. About 20 overload existing spells (so that WIZARD_EXPEDITIOUS_RETREAT and WIZARD_PROTECTION_FROM_PETRIFICATION both point to SPWI108, for instance). Ideally I wouldn't do this as there are one or two places where it can cause some confusion, but I think it's the least worst option without editing SR itself. Ideally, SR should be changed so that those 20 spells get put in via ADD_SPELL, and the existing spells are hidden via HIDESPL but left in the game. But that's not something I can do in post-SR code, given that SR destructively overwrites the spells.

 

This is coded as a function. It should be safe to run it multiple times.

DEFINE_ACTION_FUNCTION spell_rev_ids BEGIN
  SILENT
  // removing or changing of obsolete labels
  
  COPY_EXISTING "spell.ids" override
     PATCH_IF INDEX_BUFFER ("CLERIC_PROTECTION_FROM_FIRE_DEPRECATED") <0 BEGIN
            REPLACE_TEXTUALLY "CLERIC_PROTECTION_FROM_FIRE" "CLERIC_PROTECTION_FROM_FIRE_DEPRECATED"
     END
     PATCH_IF INDEX_BUFFER ("CLERIC_PROTECTION_FROM_LIGHTNING_DEPRECATED") <0 BEGIN
            REPLACE_TEXTUALLY "CLERIC_PROTECTION_FROM_LIGHTNING" "CLERIC_PROTECTION_FROM_LIGHTNING_DEPRECATED"
     END
     PATCH_IF INDEX_BUFFER ("CLERIC_STALKER")<0 BEGIN
            REPLACE_TEXTUALLY "CLERIC_CONJURE_EARTH_ELEMENTAL" "CLERIC_STALKER"
     END
     REPLACE_TEXTUALLY "CLERIC_SPACE_WARP" "CLERIC_ANIMAL_SUMMONING_4"
     REPLACE_TEXTUALLY "WIZARD_HOLD_PORTAL" "WIZARD_DIMENSION_JUMP"

  // new spells

  ACTION_DEFINE_ASSOCIATIVE_ARRAY sr_ids BEGIN
  // new cleric spells
  1116 => CLERIC_SUNSCORCH
  1117 => CLERIC_REGENERATE_LIGHT_WOUNDS
  1118 => CLERIC_GOODBERRY_DRUID_VERSION
  1119 => CLERIC_CAUSE_LIGHT_WOUNDS
  1120 => CLERIC_ANIMAL_SUMMONING_SR_1
  1121 => CLERIC_OBSCURING_MIST
  1210 => CLERIC_RESIST_ELEMENTS
  1215 => CLERIC_CURE_MODERATE_WOUNDS
  1216 => CLERIC_FIRE_TRAP
  1217 => CLERIC_REGENERATE_MODERATE_WOUNDS
  1218 => CLERIC_GUST_OF_WIND_DRUID_VERSION
  1219 => CLERIC_CAUSE_MODERATE_WOUNDS
  1220 => CLERIC_ANIMAL_SUMMONING_SR_2
  1320 => CLERIC_ANIMAL_SUMMONING_SR_3
  1321 => CLERIC_CAUSE_MEDIUM_WOUNDS // I know it's called "Cause Serious Wounds" in SR, but this matters for IWD compatibility
  1322 => CLERIC_STORM_SHIELD
  1323 => CLERIC_REGENERATE_SERIOUS_WOUNDS
  1324 => CLERIC_MAGIC_FANG
  1325 => CLERIC_SPIKE_GROWTH
  1326 => CLERIC_ICELANCE
  1418 => CLERIC_ICE_STORM
  1419 => CLERIC_REGENERATE_CRITICAL_WOUNDS
  1520 => CLERIC_PROTECTION_FROM_ACID
  1521 => CLERIC_PROTECTION_FROM_COLD
  1522 => CLERIC_PROTECTION_FROM_LIGHTNING
  1523 => CLERIC_PROTECTION_FROM_FIRE
  1524 => CLERIC_MASS_REGENERATE
  1525 => CLERIC_ANIMAL_GROWTH
  1619 => CLERIC_REGENERATION_DRUID_VERSION
  1620 => CLERIC_BANISHMENT
  1621 => CLERIC_CONJURE_AIR_ELEMENTAL
  1621 => CLERIC_CONJURE_EARTH_ELEMENTAL
  1623 => CLERIC_ANIMATE_SKELETON_WARRIOR
  // new wizard spells
  2226 => WIZARD_MONSTER_SUMMONING_SR_2
  2327 => WIZARD_ICELANCE
  2426 => WIZARD_PROTECTION_FROM_ELEMENTAL_ENERGY
  2427 => WIZARD_VITRIOLIC_SPHERE
  2526 => WIZARD_MESTILS_ACID_SHEATH
  2724 => WIZARD_MONSTER_SUMMONING_5
  2802 => WIZARD_MIND_BLANK
  2819 => WIZARD_MONSTER_SUMMONING_6
  2906 => WIZARD_MONSTER_SUMMONING_7
  // overloading of existing cleric spells
  1114 => CLERIC_FAERIE_FIRE
  1115 => CLERIC_STRENGTH_OF_STONE
  1311 => CLERIC_CONTAGION
  1318 => CLERIC_GUST_OF_WIND
  1515 => CLERIC_REPULSION
  1703 => CLERIC_SUMMON_DEATH_KNIGHT
  1706 => CLERIC_SYMBOL_WEAKNESS
  // overloading of existing wizard spells
  2106 => WIZARD_OBSCURING_MIST
  2107 => WIZARD_MONSTER_SUMMONING_SR_1
  2108 => WIZARD_EXPEDITIOUS_RETREAT
  2111 => WIZARD_TRUE_STRIKE
  2223 => WIZARD_SOUND_BURST
  2501 => WIZARD_SUMMON_SHADOW
  2508 => WIZARD_WAVES_OF_FATIGUE
  2510 => WIZARD_DISPELLING_SCREEN
  2619 => WIZARD_MONSTER_SUMMONING_4 // special case, we want IWDification and the like not to install this
  2623 => WIZARD_ANIMATE_SKELETON_WARRIOR
  2707 => WIZARD_SUMMON_DEATH_KNIGHT
  2811 => WIZARD_SYMBOL_WEAKNESS
  END

  ACTION_PHP_EACH sr_ids AS key=>value BEGIN
       APPEND "spell.ids" "%key% %value%" UNLESS "%key% +%value%"  
  END


END
Edited by DavidW

Share this post


Link to post

I believe switching the newly added spells to use ADD_SPELL is on the "to-do" list, but it will likely be a while before anyone gets to it.

 

My very short and likely unhelpful suggestion would be, for spells that don't have IDS names, use precisely the same ones as in IWDification, and in the SHS forum thread where a bunch of modders got together to agree on uniform rules for IDS names. That way, if and when SR does switch over to ADD_SPELL, the IDS names will be unchanged.

 

As for the spells which overwrite existing spells, I would consider whether it might not be best to leave them alone. My rough understanding is that Demi very carefully decided what should overwrite what, with an eye to allowing SCS AI to use the new spells just as it did the old ones. Some replacements are different in application - Blindness and Pro Petrification stand out - but IIRC those are exceptions rather than the rule. IIRC.

 

Some of my mods accept Demi's overwriting and depend on the old IDS names. Maybe others do, I'm not sure. Of course, most of them are designed to be install before SCS so maybe it doesn't matter... much. But if you do change them, it might be nice to leave a record of the conversions - perhaps a 2da file listing the changes, or something.

Edited by subtledoctor

Share this post


Link to post

I believe switching the newly added spells to use ADD_SPELL is on the "to-do" list, but it will likely be a while before anyone gets to it.

That was my working assumption, which is why I thought I'd do something myself now rather than waiting. (I can't really incorporate SR in SCS properly without IDS entries.)

 

My very short and likely unhelpful suggestion would be, for spells that don't have IDS names, use precisely the same ones as in IWDification, and in the SHS forum thread where a bunch of modders got together to agree on uniform rules for IDS names. That way, if and when SR does switch over to ADD_SPELL, the IDS names will be unchanged.

I'm pretty sure I am following the IWDification rules (which in turn are the rules used in IWD-in-BG2, which were also inherited by IWD-EE when I gave Beamdog the core IWD-in-BG2 converter). The others are mostly common-sensical, though if you can give me a link to a thread with some kind of consensus discussion, I'm probably happy to adapt to the consensus.

 

As for the spells which overwrite existing spells, I would consider whether it might not be best to leave them alone. My rough understanding is that Demi very carefully decided what should overwrite what, with an eye to allowing SCS AI to use the new spells just as it did the old ones. Some replacements are different in application - Blindness and Pro Petrification stand out - but IIRC those are exceptions rather than the rule. IIRC.

The ones where I've given a new IDS name are the ones that are sufficiently different from vanilla (mostly in the pattern of resistances and party-friendliness) that I think they do have to be treated separately. (I've just been through fairly carefully - many overwrites are fine and aren't included, but these ones change fairly drastically - but if you think I've made a mistake in a particular case, do say. There are of course some debatable cases.)

 

Some of my mods accept Demi's overwriting and depend on the old IDS names. Maybe others do, I'm not sure. Of course, most of them are designed to be install before SCS so maybe it doesn't matter... much. But if you do change them, it might be nice to leave a record of the conversions - perhaps a 2da file listing the changes, or something.

I'm not removing the old IDS names, just adding new ones. (And I'm certainly not moving the actual spells.) SPELL.IDS contains both 2108 WIZARD_EXPEDITIOUS_RETREAT and 2108 WIZARD_PROTECTION_FROM_PETRIFICATION, for instance. So if you (e.g.) use IDS_OF_SYMBOL to find the file corresponding to a spell, or put an ids entry into a script, it won't be affected at all. There are some esoteric cases where overloading can cause problems (mostly involving systematic search-and-replace on decompiled scripts). I strongly doubt those are going to come up - but if you think that's wrong or I'm missing a problematic case, let me know what you have in mind. If necessary there are other workarounds I can use, but they're painful, and/or bug-risking, enough that I'd rather not unless I really have to.

Share this post


Link to post

Oh, I didn't realize the file would contain both. I dunno if that would mess up NAME_NUM_OF_SPELL_RES et al. but like I say I'm not sure anyone will be using that in a mod that comes after SCS.

 

I think this is the thread:

http://www.shsforums.net/topic/46717-add-spell-in-spell-mods/?fromsearch=1

 

Not necessarily prescriptive, just people listing the names they have used, so that others can adopt the same conventions.

Edited by subtledoctor

Share this post


Link to post

Yeah, I remember that thread on SHS. One thing I'd point out is that we do have to worry about mods that come before SCS, because ideally/eventually, this info will be provided by SR, not SCS.

 

Overall, the list looks good.

  1. What's CLERIC_STALKER? I thought this spell was Summon Shambling Mound.
  2. For the animal and monster summoning spells, I would prefer a neutral/consistent set of identifiers, like:
MONSTER_SUMMONING_I
MONSTER_SUMMONING_II
MONSTER_SUMMONING_III
MONSTER_SUMMONING_IV
MONSTER_SUMMONING_V
MONSTER_SUMMONING_VI
MONSTER_SUMMONING_VII
MONSTER_SUMMONING_VIII
MONSTER_SUMMONING_IX

The original MONSTER_SUMMONING_1 through MONSTER_SUMMONING_4 could remain as aliases for III through VI.

Share this post


Link to post

What's CLERIC_STALKER? I thought this spell was Summon Shambling Mound.

"Stalker" is a level 7 druid spell in Icewind Dale (and hence, in IWD:EE, and IWDification) which summons two shambling mounds. It's a slightly odd name, I agree, but since "STALKER" is established in one of the core IE games, and since I take it we don't want two 7th level druid spells that summon shambling mounds to be installed on a multimod install, it seems to make sense to keep STALKER for this, and get used to the slightly odd name.

 

For the animal and monster summoning spells, I would prefer a neutral/consistent set of identifiers, like:

MONSTER_SUMMONING_I

MONSTER_SUMMONING_II

MONSTER_SUMMONING_III

MONSTER_SUMMONING_IV

MONSTER_SUMMONING_V

MONSTER_SUMMONING_VI

MONSTER_SUMMONING_VII

MONSTER_SUMMONING_VIII

MONSTER_SUMMONING_IX

 

The original MONSTER_SUMMONING_1 through MONSTER_SUMMONING_4 could remain as aliases for III through VI.

It partly depends on how you feel about aliases in the ids file - I was assuming that in the fullness of time it would be good to eliminate them - though I accept that's pretty theoretical, since it requires 20-odd SR spells to be moved to different slots.

 

The other advantage of piggybacking on the extant naming structure is that we presumably don't want two different monster-summoning hierarchies to coexist. If you install SR and then subsequently install IWDification or another mod that brings across IWD spells, you oon't want that latter mod to install its versions of MS 5-7. Using MS 5-7 to mark those slots gets around that.

 

Having said that, if we're content to tolerate aliases, the two schemes can coexist. Introduce MSI-MSIX, and then MS1-7 can remain as aliases. (Indeed, someone could put an MSI-IX overlay on top of my function without problems.)

Edited by DavidW

Share this post


Link to post
  1120 => CLERIC_ANIMAL_SUMMONING_SR_LEVEL_1
  1220 => CLERIC_ANIMAL_SUMMONING_SR_LEVEL_2
  1320 => CLERIC_ANIMAL_SUMMONING_SR_LEVEL_3

This seems awkward. Why not just "CLERIC_ANIMAL_SUMMONING_SR_1?"

 

Incidentally and unrelatedly, I suddenly find myself with a need to add IDS names to a couple SR spells. (Those three, in fact.) If I use an abbreviated form of the function - cut out everything from the array except those three entries - would it play nice with the full function being reapplied later in SCS?

 

EDIT - I looked at it more closely and I guess the answer is yes.

Edited by subtledoctor

Share this post


Link to post

Just to say that I’ve implemented this in SCS v32, with Subtledoctor’s streamlining of the summoning.

Share this post


Link to post

Just to say that Ive implemented this in SCS v32, with Subtledoctors streamlining of the summoning.

My preference is for the neutral set of identifiers without the mod name included - e.g. ANIMAL_SUMMONING_I, ANIMAL_SUMMONING_II, ANIMAL_SUMMONING_III.

Share this post


Link to post

Just to say that I’ve implemented this in SCS v32, with Subtledoctor’s streamlining of the summoning.

Whoops, I'm already shipping a mod with the other names, I'll have to change it.

 

EDIT - whatever people decide to use, I'll change my mod to match it whenever SCS 32 is released into the wild. It's an easy change. I don't really have a strong opinion about the matter. Though the fact that the two numbering systems appear so similar but are in fact functionally so different, suggests to me that it might be best to reference the mod in the SR versions. Could be a bit confusing otherwise if someone who isn't as familiar with the mod checks their SPELL.IDS and doesn't know which is which...

Share this post


Link to post

The reason I am against including mod names in SPELL.IDS is because it renders ADD_SPELL useless for merging duplicates.

Share this post


Link to post

The reason I am against including mod names in SPELL.IDS is because it renders ADD_SPELL useless for merging duplicates.

Meaning? Cause to me... it doesn't matter if the spell.ids has these:

1120 CLERIC_ANIMAL_SUMMONING_SR_LEVEL_1
1120 ANIMAL_SUMMONING_1
1120 SUMMONING_JAKKAL

As they are the same spell. Doesn't matter what adds it into the game.

Share this post


Link to post

ADD_SPELL can replace an existing spell if it matches the identifier you're trying to add. This avoids having multiple copies of the same spell in your spellbook, all added by different mods. It's preferable to just have one version of the spell - the one added by the last installed mod.

 

If mods incorporate their mod name into their identifiers, then this matching won't happen. SR_FAERIE_FIRE would be installed alongside TDD_FAERIE_FIRE and all the other versions installed by other mods.

Share this post


Link to post

The reasons I'm avoiding the I-IX monster-summoning IDS entries are (a) Icewind Dale conventions, and (b) logical consistency with the vanilla system.

 

I appreciate that on the SR forums people are focused around multiple-spell-mod compatibility. But I actually need to script for these spells (and, ultimately, spell.ids is in the first instance there for scripting purposes). I want a unified command that will cast the 5th-level MS spell, irrespective of which if any spell mod is installed, and I want a unified command that will cast the 8th-level monster summoning spell, whether IWDification or SR is installed. I could use Mike's suggested SR conventions throughout, but ultimately I'm thinking in terms of the vanilla system as primary, so I don't want to have to change the IDS there even if SR is not installed. I guess I could use MONSTER_SUMMONING_I and MONSTER_SUMMONING_II for the first- and second-level spells since they only appear in SR, but it is an obvious recipe for bugs to have to distinguish between MONSTER_SUMMONING_I and MONSTER_SUMMONING_1.

 

I agree that in general it is a bad idea to include mod prefixes in the ids entry, for exactly Mike's reason. But in the particular case of monster summoning, Demi chose to change the vanilla-game conventions, so that there is a genuine conflict between spell system naming rules. We have a vanilla/AD&D convention (Monster summoning counts up from level 3, animal summoning from level 4) and a Spell Revisions / 3e convention (both count up from level 1). I suppose I could have gone for MONSTER_SUMMONING_3E_1 but so far as I know no other mod implements the SR conventions, and in practice I think referring to the convention by the name of its signature mod is clearer.

 

 

In any case, since we're fairly committed to overloading spell.ids, if someone wants to superimpose the I-IX conventions for their own use, nothing is stopping them.

Share this post


Link to post

Incidentally, if anyone wants to do an automated conversion of the SR spells to ADD_SPELL and isn't scared of advanced WEIDU, the IWDSpells package I posted last month on GitHub will probably work with minimal modification. It's designed to run in your IWDEE install, take a list of spells, collect their resources recursively, and then prep to install them on a BG2EE install, but you could pretty easily adapt it to take an SR install as input. You'd need to issue IDS entries to the SR resources first.

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...