Skip to content

Adding Spells as Innate to Other Class

FB4FB4 Member Posts: 6
edited March 2021 in General Modding
I've tried searching for an answer but came up with very little (as lots of content has been deleted or old links).

I'm using Near Infinity and was wondering how one goes about adding spells as innate abilities? I'm talking adding a purely wizard spell, like Spell strike and adding it as an innate ability to a fighter. Is this possible?

I have zero experience in programming etc. so any answer, the more rudimentary the better. I've found workarounds by doing trial games, comparing/contrasting, and then copying/pasting/deleting things like weapon proficiencies etc. But this one example has me lost again.

Is something like this even possible? I know some thing are hardcoded but know that certain things like Larloch's minor drain are used in mage classes as well as innate abilities.

I've tried adding lines with NI in the Known Spell and Memorization info lines respectively but nothing shows up. More editing beyond that seems to crash the game.

Comments

  • jmerryjmerry Member Posts: 3,829
    Whether a spell is innate, arcane, divine, or psionic is a property of the spell. You have to make a copy of the spell and then change that property in the copy.

    Then, where the spell shows up on the character is a separate property, belonging to the ability that does things. You can have an innate spell show up on the spellcasting button, or an arcane spell on the item button.
  • FB4FB4 Member Posts: 6
    jmerry wrote: »
    Whether a spell is innate, arcane, divine, or psionic is a property of the spell. You have to make a copy of the spell and then change that property in the copy.

    Then, where the spell shows up on the character is a separate property, belonging to the ability that does things. You can have an innate spell show up on the spellcasting button, or an arcane spell on the item button.

    Thank you, I had a feeling there was something like that. For perhaps an even more rudimentary question, so to embark on adding this as an ability, once I add a copy of the spell, I'm assuming I have to rename it and then select the "innate version spell" as the spell in the CRE file? Does the name I choose for the innate version of the spell matter? Is there something in the naming convention I need to pay attention to? Thanks again!
  • jmerryjmerry Member Posts: 3,829
    edited March 2021
    Yes, you would add your innate copy of the spell.

    The name (string field) is what you see in-game - no reason to change that stuff from the original spell. The code (resource ID/filename) mostly doesn't matter for what you're doing. The things to remember about it? You get at most 8 characters of ID before the dot. If you want your spell to show up automatically on priests' lists, it needs a SPPR### code; the first digit is spell level, and the last two must be in the 01-50 range. If you want the spell to be selectable by mages at character creation and sorcerers at level-up, it needs a SPWI### code; again, the first digit is spell level and the last two must be in the 01-50 range.

    Many mods add arcane/divine spells, and they generally use a WeiDu function that chooses the first available code that fits. Doing anything in those code ranges for personal use is fine; distributing it without using that WeiDu function to play nice with other mods is a bad idea.
    Post edited by jmerry on
  • FB4FB4 Member Posts: 6
    edited March 2021
    jmerry wrote: »
    Yes, you would add your innate copy of the spell.

    The name (string field) is what you see in-game - no reason to change that stuff from the original spell. The code (resource ID/filename) mostly doesn't matter for what you're doing. The things to remember about it? You get at most 8 characters of ID before the dot. If you want your spell to show up automatically on priests' lists, it needs a SPPR### code; the first digit is spell level, and the last two must be in the 01-50 range. If you want the spell to be selectable by mages at character creation and sorcerers at level-up, it needs a SPWI### code; again, the first digit is spell level and the last two must be in the 01-50 range.

    Many mods add arcane/divine spells, and they generally use a WeiDu function that chooses the first available code that fits. Doing anything in those code ranges for personal use is fine; distributing it without using that WeiDu function to play nice with other mods is a bad idea.

    So far I'm just changing things for personal/private use. So if I wanted say the file SPWI122 (magic missile) as an innate ability I would just add a copy of it and change the "Spell Type" and "Ability Location" parameters and just save? Or do I need to adjust the name of the copy to like SPWI122C and save it?

    Thanks again for the help and patience.
    Post edited by FB4 on
  • AllbrotherAllbrother Member Posts: 261
    Yes, you'll have to change the name if you don't want to replace the original with your copy. Improved alacrity is not in BG1EE. While you could bring it over from BG2EE and even grab its icon while you're at it, the name and description will point to a wrong string in dialog.tlk, likely some piece of dialogue or nothing if you're lucky. And you really don't want to touch strings without weidu. Which by the way, for your use case would really not be complicated. In fact, in this case, it's the easy part.

    I thought surely there was a tutorial for spell creation to refer you to, but I couldn't find one so here's a step by step for what you want to do.
    1.Create a new folder in your game directory (I'll call it gamedir going forward) and name it whatever you want. I'll refer to it as moddir.

    2.With near infinity, make the copies of the spells you want and give them unique names. You don't need to follow the SPWI#### naming convention for your innates. You still need to limit it to 8 characters or less.

    2.5.If you want to bring in spells from BG2EE (such as improved alacrity), at the top left corner of Near Infinity, click game->open game, locate your BG2EE gamedir and open chittin.key. This will load up the resources from BG2EE. Find the spells you want, click export and save them to your BG1EE gamedir/override, again with unique names just in case.

    3.Now go back to the BG1EE chittin.key and on your copies, on the spell details screen change spell type to innate (4) and then for every ability header change ability location to ability (4). You could make other changes if you want, go wild.

    3.While you're here, look inside kitlist.2da, find the row of the kit you want to add your abilities to and take note of the entry under the ABILITIES column. It's generally CLAB**##, where ** are the first 2 letters of the parent class and ## is a number. This is the name of the .2da file that's responsible for assigning abilities to your kit at every level. If you want to add these abilities to trueclass rather than kit, you won't see it here, but it'll be CLAB**01.

    4.Now find that clab**##.2da file (still in Near Infinity). Don't copy this one with new name, just open it and make your changes there. Each column after the first represents a level (which are the numbers on the first row) and all entries in it (below the # of the level) will grant the referenced spells to the character at that level. **** are blank. Spells assigned here need to be prefixed with GA_ (grant ability) or AP_ (apply). You don't care about about AP_ for your use case, so just go ahead and add the spells you want here by replacing **** with GA_spell. You don't have to (i think), but you can add the extra spaces after each one to make the next column line up correctly. It looks nice. Saving your changes will make a copy of it in the override folder.

    Now if you decided you don't need improved alacrity after all and skipped 2.5, we can call it a day here and go play with the new innates. Otherwise...

    5.Go to your gamedir/moddir and create a new folder. Call it lang. Open it and create another new folder. Call this one english and open it up. Technically we don't need all the nested folders here, but it's a good habbit to get into. Now in here create a new text file, name it the same as your moddir and change its extension to .tra

    6.Open it up with your text editor of choice and write the following:
    @1 = ~YourMod~
    
    @2 = ~Insert Spell 1 ingame name here~
    
    @3 = ~Insert Spell 2 ingame description~
    

    Then keep going with new @# for every spell name and description. You can see the names and descriptions on the spell details screen in NI and you can copy them from there. Save when you're done.

    7.Go to your gamedir/override, find the clab**##.2da and all of your spells and ctrl + x them. Go to your gamedir/moddir and paste them there.

    8.Now create a new text document here, name it the same as your moddir and change its extension to .tp2

    9.Open it up with your text editor of choice and write the following:
    BACKUP "moddir/backup"
    AUTHOR FB4
    VERSION "v1"
    LANGUAGE ~English~ ~english~ ~moddir/lang/english/yourmod.tra~
    
    BEGIN @1
    
    COPY ~moddir/clab**##.2DA~ ~override~
    COPY ~moddir/moddedspellname1.SPL~ ~override~
    SAY NAME1 @2
    SAY UNIDENTIFIED_DESC @3
    

    Then repeat the last three lines for every new spell, taking care to increment the the @s. They should be the same as defined in the .tra file

    10.Go back to your gamedir, find a setup-something.exe from one of the mods you have installed copy it and paste it in the same place. Rename the copy setup-yourmod.exe and run it.

    11.????

    12.Profit
  • FB4FB4 Member Posts: 6
    edited March 2021
    @Allbrother , so awesome! Appreciate the tutorial! Yeah, sometimes the issue I have is I find a thread with the answer I'm looking for but, given the age of the thread or poster, the links are dead or the user deleted the content.

    Now it "Step 6", for what I would type into the "yourmod" part...is that the name of the spell I "created" (or copy and pasted and renamed)? Or would that be something else?

    I'm running OSX (Mac), but I figure the procedure is the same.

    Luckily it's even simpler as I was just planning on keeping it strictly in BG2EE, but your tutorial definitely opens some doors. Thanks again and sorry if this is all painfully obvious to you, I have zero background/experience with anything remotely of this depth in terms of programming etc.
    Post edited by FB4 on
  • AllbrotherAllbrother Member Posts: 261
    FB4 wrote: »
    Now it "Step 6", for what I would type into the "yourmod" part...is that the name of the spell I "created" (or copy and pasted and renamed)? Or would that be something else?

    That specifically will just be what the installer will display when you're done (i.e. "Do you want to install [Whatever you put between the ~~ in the tra file will go here]?"), it can be whatever you want. The other places where I've noted "yourmod" need to be consistent with each other and "moddir" though.

    Also, I don't know if everything will hold up on mac as I've never used one
Sign In or Register to comment.