Jump to content

Spell references


Recommended Posts

What assigns a given spell it's symbolic name and # in SPELL.IDS?

When viewing a spell file in NI I can see the name and number listed, but there's no field referencing it under the "edits" tab. So, I'm either missing it or it can't be changed.

What happens when two different names share the same # in SPELL.IDS? Many mods that add or edit spells append SPELL.IDS with this being the result. I have a hunch as to why this is done, but I don't want to speculate. 

Link to comment

The number in SPELL.IDS corresponds to the spell's file name. All such spells start with "SP". The next two characters depend on the first digit of that number; 1 for "PR", 2 for "WI", 3 for "IN", and 4 for "CL". After that, the three digits of the SPELL.IDS number are the remaining characters of the spell's file name. For example, IDS number 1111 (CLERIC_ARMOR_OF_FAITH in the BG series) corresponds to SPPR111.

Thus, the entry in SPELL.IDS matches a symbolic name to a number, and through that to a file name. You can't edit a spell's symbolic name directly, because it's not part of the spell's file; it's only defined indirectly through the IDS file lookup. And spells that don't have one of the 4000 possible file names this scheme encodes can't have symbolic names at all.

If two names share the same number, they point to the same spell. For example, the vanilla version of the file (BG2EE) has this pair of lines:

4414 SET_SPECIAL_SNARE_TRAP
4414 THIEF_SET_SPECIAL_SNARE

Two different names for the Bounty Hunter's special snares. If you were to use a script action such as Spell() with either of those two names, I expect it would work the same both ways. The game never needs to go the other way and turn resource IDs into symbolic names, so overlap like this should be harmless.

Link to comment
7 minutes ago, jmerry said:

Thus, the entry in SPELL.IDS matches a symbolic name to a number, and through that to a file name. You can't edit a spell's symbolic name directly, because it's not part of the spell's file; it's only defined indirectly through the IDS file lookup. And spells that don't have one of the 4000 possible file names this scheme encodes can't have symbolic names at all.

If two names share the same number, they point to the same spell. For example, the vanilla version of the file (BG2EE) has this pair of lines:

4414 SET_SPECIAL_SNARE_TRAP
4414 THIEF_SET_SPECIAL_SNARE

Two different names for the Bounty Hunter's special snares. If you were to use a script action such as Spell() with either of those two names, I expect it would work the same both ways. The game never needs to go the other way and turn resource IDs into symbolic names, so overlap like this should be harmless.

Thanks, this is what I suspected. I missed the correlation to file names. 

Link to comment

Worth mentioning to anyone just starting to play with this stuff: the number if available IDS numbers for wizard and priest spells is capped. A mod should use it sparingly, considering whether it is really necessary. E.g. a script that uses 

Spell(MY_NEW_AWESOME_SPELL)

Could usually just as easily use

SpellRES(XYNUSPL)
Edited by subtledoctor
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...