Hello,
I was wondering how to add custom spells to NWN2. I have a tutorial on how to do it but it was written for NWN1 and does not seem to work for NWN2. Does anyone know of a good custom spell tutorial for NWN2?
Hello,
I was wondering how to add custom spells to NWN2. I have a tutorial on how to do it but it was written for NWN1 and does not seem to work for NWN2. Does anyone know of a good custom spell tutorial for NWN2?
At a very high level overview
1) Make a new entry in spells.2da for your spell. Put spells.2da in your override folder.
2) You need a script for your spell. Your entry in spells.2da will point to your script
3) You need to use a custom TLK file for the spell description. Or edit the games default tlk file and override it.
If your totally new at this, one other method you might want to do is just pick a spell from spells.2da.
Go find the script in the toolset. You will get the script name from spells.2da.
Modify the script. Put something in it that sends a msg to you when you cast it or something like that.
It will give you a feel for how things work.
I am totally new at this. I have figured out how to adjusting the 2da and tlk files. I just need to know how to modify a spell script. I have tried to open a spell with the tool set, but nothing happened. Is there a plug in I need? Thanks.
No. Just look at spells.2da and find the spell you want, the look at the column for ImpactScript.
Open the Toolset, Make a new module (ideally use Save as Directory - always use directory mode) go to File->Open Conversation Script and enter the name of the script.
Edit the script and then hit save and compile. As it will be a core game script it will prompt you to save it to your module, so accept that.
Now assuming you want the modified script to work with all local modules, go to your Documents\Neverwinter Nights 2\modules folder, and inside the directory of your module (whatever name you save it with) copy the script (two files, one is .NSS (the plain text) one is .NSC (compiled version)) into your override folder.
As long as the module has no HAKs that also contained a modified version of that spell then it should work.
If you have other overrides which also modify the spell you want to change then you would want to either remove that from your override or replace it.
Thanks. This is the step I was missing. Modifying the spell is relatively easy. Creating one from scratch will be a challenge, maybe after I modify a lot of other stuff first.
- define the objects
- define the effects
- see who gets blasted.
I'm going to use baby steps. Trial and error, and a lot of reading guides and forums. Thanks for the input.
Spell scripts can be as simple or as complex as you like. Single-target spells that don't have saving throws or spell resistance checks are fairly easy. Area-of-effect spells that allow for saving throws, evasion checks and spell resistance get more complicated.
If you want to look at a complicated monster of a spell script, check out the Sleep spell. There are multiple loops in there to keep track of the number of creature hit dice the spell will affect.
I will look at the sleep spell after work. Right now, I am looking at pale master summon spells for a new class I am making. Thanks for the advice, should be interesting to see the code.
So I modified the summon undead spell to suit my new fighter class, with out caster level. The constant I used for the class was black guard, thus I used this in the modified spell to count levels to determine caster level. When I test this, the undead is summoned, then immediately unsummoned. The question I have is do I need to create a new constant for my new class in the nwscript.ncc? I have the latest kaedrins installed, and all of the new classes have new constants. I could not locate where these constants exist. If I update the nwscript.ncc and place it in override folder, will it conflict with kaedrin PrC pack? Thanks.
Constants often just point to a line number in a 2DA. You can usually use the line number directly without having to go through a constant.
For example; instead of using CLASS_TYPE_CLERIC in a function, you could use a value of 2 instead (the line number of the cleric entry in classes.2DA).
The reason the summoned creature disappears immediately is probably because the summon duration is based on the number of Black Guard levels you have. No BG levels = 0.0 seconds duration. If you replace the black guard constant in the summoning script with the 2DA line number of your new class, it should calculate the summon duration properly.
The 0 levels of black guard is what I had figured to be the problem. I will try the class number. Thanks.