Neverwinter Vault

Expand AllContract All -Site -My Profile -Features

Neverwinter Nights 2

-NWN2 Files -NWN2 Game Info -NWN2 Resources -NWN2 Community

Neverwinter Nights

-NWN Files -NWN Game Info -NWN Resources -NWN Community

Vault Network
RPG Vault
VN Boards
IGN Vault
Vault Wiki
· Age of Conan
· Anarchy Online
· Asheron's Call
· Dark Age of Camelot
· City of Heroes
· D&D
· EVE Online
· EverQuest
· EverQuest 2
· Final Fantasy
· Guild Wars
· Lineage 2
· Lord of the Rings Online
· Middle Earth
· Neverwinter Nights
· Pirates of the Burning Sea
· Rise of the Argonauts
· Star Wars Galaxies
· Tabula Rasa
· The Matrix Online
· The Witcher
· Titan Quest
· Two Worlds
· Vanguard
· Warhammer
· World of Warcraft

Planet Network
Planet Hub

IGN
Games
Cheats
Entertainment

The Web   The Site  



NWN2 SCRIPTS

- Jump to comments -
Name  Spell Points System
Author  sdawm1
Submitted / Updated  01-05-2007 / 07-24-2007
Category  Rulesets
Type  Type - Magic
Format  Code Only
Patch  1.03
Description
==================================
THIS CODE IS NO LONGER SUPPORTED
==================================

Spell Points System v1.1
==========================
This system modifies the default 'spells per day' magic system used by NWN2 into a 'spell points' magic system. Each of the 7 spell casters (not including Warlocks b/c they have unlimited spells per day) is assigned a spell point amount based on their caster levels. Each time a caster casts a spell, spell points are subtracted from the casters available spell points. Once the caster has exhausted all of his spell points for the day he is unable to cast any more spells.

Change Log
============
- v1.1
Added a custom gui window that displays the current number of spell points for the selected character. More code clean up.

- v1.051
Integrated the systme with Even AI v.07357. More code clean up.

- v1.05
Added support for custom spell point items. Items with tag ending in _spsxx (where xx is a number from 0 to 99) will add that amount of spell points to the caster. For example a ring with a tag ring_sps25 will add 25 spell points to the character.

- v1.04
Got the world map transitions to work. Got the spell points to work when the caster is contolled by the AI. Got the spell point bonuses to work at the correct level. Got the ability bonus to get the correct bonus based on the current caster level.

- v1.03
Reworked the entry points for the system. Uses ExecuteScript at the rest/cast/equip/unequip events. This should make it easier to incorporate it anywhere you like. Gives casters bonus spell points based on their ability modifier up to the level of spells they can cast. Renamed and reorganized the files and functions to be easier to read and manage.

- v1.02
Did more clean up of the UDM code. Figured out how to do the OnEquip and OnUnequip checks.

- v1.01
Moved the restore spell points functionality from the onrest script into the my_inc_spellpoints to make it easier to add the spell points system to other modules. Cleaned up the UMD script sections a bit. Figured out why the onrest script that Even uses actually works in the OC, Duh.

- v1.0 beta
Initial Release

Files

NameTypeSizeDownloads
SPS_v1.1_w_Even_AI_v0.zipSPS_v1.1_w_Even_AI_v0.zip
Submitted: 01-05-2007 / Last Updated: 01-28-2007
zip1.4Mb742
--
SPS_v1.zipSPS_v1.zip
Submitted: 01-05-2007 / Last Updated: 01-28-2007
zip1.1Mb393
--
SCORE OUT OF 10
9.38
6 votes
View Stats
Cast Your Vote!
Voting FAQ

PORTFOLIO
Add this entry to your portfolio so you can track it
Manage your existing portfolios or create a new one.
SCREENS
No Images




You Must Be Logged In to Participate.
Comments (44):

  1  2 Next>

Posted by Lanessar at 2010-02-08 17:25:01    Voted 10.00 on 01/16/07
As far as I know, a visible spell points bar is not feasible in NWN1. The Spell Points system is, though - all of the scripts/etc. as well as the 2da edits can be re-created in NWN1.

The best solution for NWN1 is to just have floating text or a chatbox announcement to the player on "You have X spell points remaining".

I'm toying with updating this script system, but looking it over, it requires a lot of work. Especially with all of the Kaedrin's Class Packs, etc. out on the vault now. In approaching a new project, I still feel this is the best solution for ARCANE classes. In the hands of divine classes, it makes them so overpowered as to be ridiculous.

As a possible modification (simple modification), I may just have casting spells drain hit points, or set up a separate "Mana Pool" value - HP drain is surely the simpler of the two options, since bonus spell slots and whatnot increase wizard/sorc survivability.

I haven't quite puzzled this one out enough yet. But if I update the code (which is probably likely) I'll post it here when I'm done.
_________________________
Lan's Placeable Groups v1.5

Posted by JRVthatsME at 2008-08-08 12:48:18    
I love the idea of having a spell points system, and really love the idea of having a bar on the gui that shows how many spell points are left. Something I really really want to know however is, would it be possible to create this kinda spell points system in NWN1? I'm working on a module that pretty much depends on having spell points (And a visable spell points bar too if possible) but I don't quite know where to begin creating such a thing.

Posted by Raghnar Mefistus at 2008-03-31 14:48:23    Voted 9.00 on 03/31/08
It's an excellent mod, but if you use it for Mask of the Betrayer it's got some problem:
1- there aren't some new spell (the new power world 4 example)
2- Some Prestige classes and some classes aren't there more (like favoured soul)

Thanks again for this fantastic mod!!!

Posted by Guru Falcon at 2007-07-01 01:55:33    Voted 9.50 on 07/01/07
Very awesome script. This can really enhance some magic lore in a server aswell as making the gameplay much more exciting. Though I do wish this script had the ability for there to be mana poitions so you wouldn't have to rest to get spell points back. Maybe you could have a new property you can put on items that regenerate spellpoints over time. like 3 spell points every minute. just a thought. It would be very useful though.

Posted by sdawm1 at 2007-02-20 18:01:27    
Grumble... I will look into that straight away.

Posted by Lord_Ernie at 2007-02-20 09:18:44    Voted 9.00 on 01/10/07
Hrmm... I'm sorry to say, I think I've found a bug with items that add new spellpoints.

I'm not sure what or how it happens, but I've been using 'The Wanderer's Ring', the item that adds spell slots for levels 1-4. Both on me and Sand this resulted in us running around with 400+ spellpoints at level 16.

I suspect this has something to do with the script that fires upon leaving/entering an area, reapplying the bonus to spellpoints every time, but I'm not sure. Either way, the spell points stick around after unequipping the item, and continually mount if you keep wearing it.

Posted by sdawm1 at 2007-01-28 13:34:39    
I have added a small window that opens after you rest. It will display the number of spell points the currently selected character has.

Posted by SushiSquid at 2007-01-24 19:22:32    Voted 9.25 on 01/19/07
Sweet. Thanks again, man.

Posted by sdawm1 at 2007-01-24 14:50:23    
Oh yeah... Even's AI v0.7357 is included in the zip file. If you are already using Even's AI (and you should be) just get rid of that version and use the one inlcuded in this.

Posted by sdawm1 at 2007-01-24 14:48:19    
This update address the issue of companions attempting to cast spells even if they don't have enough spell points to do so. I integrated SPS with Even's most excellent AI. Now the companions will only attempt to cast spells that they have enough spell points to actually cast.

I have kept the regular version available just in case everyone does not want to use Even's AI.

Side note, as of v.1051 you need to set the HasInfiniteSpell column in the classes.2da and the sps_config.2da. Preconfigured versions of both files are inlcuded.

I have made major headway on displaying the available spell points for the selected caster. I am just having to work out the update and timing issues, but I think that should be along pretty soon as well. I will likely wait until the 1.04 patch comes out to finish since they are making UI changes.

Posted by sdawm1 at 2007-01-20 07:34:34    
SushiSquid - Thanks for the feedback. I will look into both of your requests.

Posted by SushiSquid at 2007-01-19 19:16:49    Voted 9.25 on 01/19/07
I love this so far, but I do have just a few problems with it.

First of all, I'd love if you added a script that checked how many points you had left, and if it was lower than enough to cast from a certain spell level, would shut off usage of that spell level. It's not so much a problem that I have with myself as it is a problem that my companions keep casting spells that they don't have enough points left for, and so they just sit around wasting time in battle. This is something I would think would be fairly doable for you, since it just requires a script.

For my other suggestion, you might need the help of someone skilled at editing the game's UI. I'd love if, right in the quick-cast menu, you could display the total number of spell points that character has left. It's hard to read how many points I have left during battle, when messages are flying by like crazy.


Now that I'm done complaining about what I don't like, let me thank you for even making this at all. I fully realize that it must have taken some time to write and test scripts like this, and I appreciate your work quite a bit more than the first half of the message might suggest. ;)

Posted by Lanessar at 2007-01-16 19:41:09    Voted 10.00 on 01/16/07
Thanks a lot. This is a pretty solid system now, and I definitely deel more builders should use it.
_________________________
Lan's Placeable Groups v1.5

Posted by sdawm1 at 2007-01-16 13:42:58    
You are correct it is just a recomplie of the spell scripts. I did not change any spell scripts. I just added a single line to the x2_inc_spellhook.nss. The spells needed to be recompiled to use the spellhook change.

Posted by Lanessar at 2007-01-16 10:51:56    Voted 10.00 on 01/16/07
Excellent. I think that works just as well.

So, quick question about the spell scripts included:

If I decide to install the scripts in the module (rather than override), are there any modifications needed to the spell scripts themselves? It appears just to be a recompile.
_________________________
Lan's Placeable Groups v1.5

Posted by sdawm1 at 2007-01-13 20:27:25    
Oops... I meant to say


This allows builders to make items that only give bonus spell POINTS.

Posted by sdawm1 at 2007-01-13 20:23:07    
Lanessar - I think I have handled the two item features you mentioned.

- I have set a config file the allows builder to control how items with bonus spell slots convert into bonus spell points on a class by class basis. By default all slot based casters do not get bonus spell points for items that add bonus spell slots. Bards and Sorcerers get bonus spell points since spell slots don't really mean anything to them.
- I have added support for items that add spell points. This can also be controlled on a class by class basis. This allows builders to make items that only give bonus spell slots. It supports bonuses up to 99. Since the bonus is determined by the items tag, it can be any item adn given any other item properties that the builder wants.

Posted by sdawm1 at 2007-01-13 13:41:20    
Zonzai - I am sorry to hear you are having trouble with my work. I assure you that what you describe is not how it is supposed to work. However, you have not given me enough information to assist you.

Posted by Lord_Ernie at 2007-01-13 04:46:52    Voted 9.00 on 01/10/07
Actually, things work perfectly for me. Loading and area transitions correctly store spellpoints, and resting restores them fully, as well. There is, of course, the matter of initializing them (meaning: rest ones after installing the mod), but since it works scriptwise, there's no way around that.

Great, great work, mate. I really like what the mod does, besides perhaps making the whole 'spontaneous casting' slightly less powerful (since you can basically spontaneously cast anything you memorize). Still, it replaces the memorization system gracefully, and could be used later on in making a full psionics system (not that I'm pro-psionics, but hey).

Posted by Zonzai at 2007-01-12 20:15:14    
I take it back, I have to reload the whole game to get any spell points at all. Lame. I am using 1.03 and have made sure that I don't have anything overwriting your mod.
_________________________
NWN2 Voting Standards - Tattoo it on your forehead.
10 - A Masterpiece, Genuinely Groundbreaking
9 - Outstanding, a Must Have
8 - Excellent, Recommended to Anyone
7 - Very Good, Deserves a Look
6 - Good, Qualified Recommendation
5 - Fair, Solid yet Unremarkable
4 - Some Merit, Requires Improvements
3 - Poor Execution, Potential Unrealized
2 - Very Little Appeal
1 - Not Recommended to Anyone

Posted by Zonzai at 2007-01-12 20:09:07    
The spell point restore is not working for me. It seems I have to rest after I enter every single zone to have any spell points.
_________________________
NWN2 Voting Standards - Tattoo it on your forehead.
10 - A Masterpiece, Genuinely Groundbreaking
9 - Outstanding, a Must Have
8 - Excellent, Recommended to Anyone
7 - Very Good, Deserves a Look
6 - Good, Qualified Recommendation
5 - Fair, Solid yet Unremarkable
4 - Some Merit, Requires Improvements
3 - Poor Execution, Potential Unrealized
2 - Very Little Appeal
1 - Not Recommended to Anyone

Posted by sdawm1 at 2007-01-11 19:16:16    
Let there be much singing and dancing! I think I got everything working!
- Spell Points restore with the World Map transitions (tough nut to crack).
- Spell Points should still work even if the AI is controlling the character (not enemy casters though, they work normally).
- Bonus Spell Points based on the ability modifier are done correctly (not all at once like I was doing).
- Slots per day caster do not get bonus Spell Points from items (only Bards and Sorcerers get bonus spell points).

I have set the system up so it can be activated on a class by class basis. Just set the HasInfiniteSpell column in classes.2da to 1 for any of the seven caster classes and they will use spell points. Leave it set at 0 and they will use the standard spells per day system. This means that you can have some classes use spell points and others use spells per day in at the same time.

To change the spell point amount given to each character, just modify the sps_.2da files. There are three of them and they are easy enough to understand.

If you want to make changes to how the system works, you will only need to modify the sps_inc_spellpoints and recompile the other 4 sps_ files. All of the logic is in the sps_inc_spellpoints. No other file would need to be recompiled. The other files are just wrappers and interfaces. This allows for very easy upgrade once installed.

I was forced to recomplie all of the spell scripts from the game. I did not change any of them. I just recompiled them. If you us a custom version of any spell (or any custom spells) you will need to recompile the spell(s) with the x2_inc_spellhook that I have included in the zip file.

All of the game files that have been modified only have on line added to them. ExecuteScript("sps_script", oTarget); Or something like that. If you need to add this to any other events or custom scripts, that is all you have to add. Easy enough.

Posted by sdawm1 at 2007-01-10 20:22:34    
I have figured out what causes the AI to skip the UMD check. That would be good news except for the fact that the problem is in the spellhook itself. Having said that, I have figured out how to make it work... but I would have to change the spellhook and that means recompling all the spell scripts. I would not have to change any of the spells I would just need to recompile them. And that is exactly what I didn't want to do, but that is the only way to make this thing work for AI controlled characters. So, I guess that is what I will do.

Posted by Lord_Ernie at 2007-01-10 14:48:25    Voted 9.00 on 01/10/07
I'm sorry to hear about the issues you're having... I figured it would have something to do with AI functionality, but as I'm not an expert on any area of NWN (the furthest I've gotten is some modification of existing mods), so I fear I won't be of much help to you. If you ever come round to fixing the problem, I'd still be interested. :)

As it stands, though, the system is still very much useful to PW's who'd like to use it. A nice piece of work. I'll rate it 9 as it stands :).

Posted by sdawm1 at 2007-01-10 08:06:55    
lerathel - So, you would want to mix the spell slots per day with the spell points per day?

Well, making the spell points per day only work if the InfiniteSpells column in the classes.2da would be easy enough (I think). Then you could actually make it work for some classes and not others. For example, Clerics could use spell slots per day and wizards use spell points per day.

As for just letting the players choose... I am not sure what would happen in a multiplayer game if the players had two different classes.2da. If one Wizard had InfiniteSpells set to 0 (no) and another wizard had it set to 1 (yes). IIRC, the 2da files are resolved at the client. If that is true, then it could work.

I will attempt to test that and let you know.

Posted by lerathel at 2007-01-10 03:50:24    
At last ! I alway used the spell point system in D&D second edition the rule was in optionnal book, and the system exist for 3.5 too, again in an optionnal book, I would like to add this to my persistent world but the player need to be able to choose between standar system and this one, could you do this ? like choosing a feat to use this sytem ? thank you I cant wait to try it :)

Posted by sdawm1 at 2007-01-09 20:28:59    
Well, I have been working on this thing for a good bit of time and here is what I know...

Lord_Ernie, I have figured out why Amie, Sand or whoever can cast spells all day long. It seems like the AI does not do the spellhook check, more specifically the UMD check. I am doing everything through the UMD as to not have to touch the spells themselves and they are just skipping that part. That means that as long as you have the caster selected (anyone) it will do what it is supposed to do, but once you select another character the AI takes over and it stops working right. Aaagghhh! There were a couple of other things too, but I have corrected them.

Of course I have no idea how to fix that at the moment. I have been looking though the AI code and it is making my brain hurt. I will have to try to get in touch with someone that understands how the AI works and see if there is even a way to do what I am attempting. I know Even has made an AI for NWN2 (I happen it use it and like it very much) so I will see if he has any time to assit me.

I have managed to fix the ability bonus issue. No more level 1 sun elf wizards with 17 spell points. The get the correct amount now. And as you increase in level you get the correct bonus from a high ability score. For kicks I even put in a bit more feedback to let you know what was happening.

Basically, this would have work well in NWN since you could only ever control the PC. But since NWN2 lets you control your companions, it kind of... well... I guess it sucks. I suppose it would work in NWN2 if you didn't use companions, but that is kind of lame... Unless you were dueling or playing a mod with no controlable companions.

Lanessar, I take your point about the items granting extra spell points and extra slots. Making that adjustment is easily done. That would mean that only Bards and Sorcerers would get extra spell points. All the other caster classes would get extra spell slots. That makes a lot of sense to me and I think I will go ahead and make that change... or perhaps make it an option.

As far as tweaking it... by all means do. With this latest version (1.03) and despite the above limitations, I think it is a decent framework for a more advanced and robust system. I have completely redone how game events can access the system. It should be really easy to add this (or something derived from it) into another mod or PW. And since I switched to using 'ExecuteScript("sps_onrest", OBJECT_SELF)' in the all the events I should be able to make updates without having to recompile any other files.

Anyway... I am still looking at getting this thing working correctly for companions. I will make the change for slot based casters asap. And I am still looking into the world map transition issue. It is just a matter of finding the correct place to drop the ExecutScript command.

It may take a few days, as my real life does not seem to understand the importance getting this issue corrected.

Posted by Lanessar at 2007-01-09 16:02:25    Voted 10.00 on 01/16/07
On the spell points matter, I do suggest doing a variable on the item which sets bonus spell points (or at least offering that variation).

Here's why:

Wizards and other slot-based casters (not sorcerers) use those slots in this system for additional spells. This expands their repertoire of spells.

Spell points grant further use of existing spells.

Those are two different and quite powerful abilities. To grant both to a wizard without any seperation will create a bit of an imbalance.

Here's the example:

A wizard (level 8) with 36 spell points finds an item with a bonus level 4 spell slot. This then gives him an additional spell to memorize for level 4 (say, ice storm on top of stoneskin) and another four spell points for a total of 40.

The sorcerer gains... four spell points, for a total of ~60. He does not gain an additional "spell" to use with this system.

If you seperate it out, it creates a much more balanced and robust system.

I suppose I can just modify your work to achieve what I want to do, though. I just wanted to bring up that you've created a totally alternate spell casting system, quite powerful, for persistent worlds and the like.
_________________________
Lan's Placeable Groups v1.5

Posted by Lord_Ernie at 2007-01-09 02:07:13    Voted 9.00 on 01/10/07
You're welcome. :) I'm sorry I can't help with fixing this, but looking into the details of NWN coding is unfortunately beyond my schedule at the moment.

Anyway, as said before, if you do find what's wrong, this definitely is an interesting system.

Posted by sdawm1 at 2007-01-08 12:14:25    
I know I tested that very case... I must have messed something up when I was cleaning up the code. (Mental Note: Do regression testing.) Thanks for the help.

  1  2 Next>

You must be Logged In to post comments in this section.

10 - A Masterpiece, Genuinely Groundbreaking
9 - Outstanding, a Must Have
8 - Excellent, Recommended to Anyone
7 - Very Good, Deserves a Look
6 - Good, Qualified Recommendation
5 - Fair, Solid yet Unremarkable
4 - Some Merit, Requires Improvements
3 - Poor Execution, Potential Unrealized
2 - Very Little Appeal
1 - Not Recommended to Anyone

 
Most recent posts on the MMO General Boards
Analyst: Star Wars: The Old Republic Could...Analyst: Star Wars: The Old Republic Could Sell 3M: more numbers
- last reply by Acao on Aug 15, 2011 06:15 PM
which class will your first character be
- last reply by Blisteringballs on Aug 15, 2011 05:50 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 05:00 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 04:00 PM
NWN Idea Database Update
- posted by Vault_News on Aug 15, 2011 03:46 PM
Missing Votes for NWN2 Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:40 PM
Missing Votes for NWN Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:39 PM
Random Questions and game altering suggest...Random Questions and game altering suggestions!!!
- last reply by ArkadyTepes on Aug 15, 2011 03:22 PM
State of the game?
- last reply by LyricOpera on Aug 15, 2011 01:37 PM
Yesterday streaming, now demanding downloa...Yesterday streaming, now demanding download :(
- last reply by Sinane-tk on Aug 15, 2011 10:23 AM
 

   


IGN Entertainment
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2011, IGN Entertainment, Inc. | Support | Privacy Policy | User Agreement | RSS Feeds
IGN’s enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.


NWN2 Hall of Fame

HOF NWN2 UI


View all Hall of Fame entries


Neverwinter Nights 2

TOP NWN2 Modules

NEW Modules

NEW Reviews

NEW INTL. Modules

TOP Hakpaks

TOP Gameworlds

TOP Tutorials

TOP Prefab:Areas

TOP Blueprints

TOP Plugins

TOP UI

TOP Other

TOP Visual Effects

TOP Scripts

TOP Tools

TOP Movies

TOP Models

TOP Characters





Hall of Fame

HOF NWN Modules


View all Hall of Fame entries


TOP NWN Modules

NEW NWN Modules

NEW Reviews

TOP Intl. Modules

TOP NWN Hakpaks

TOP NWN Gameworlds

TOP NWN Models

TOP NWN Portraits

TOP NWN Scripts

TOP NWN Prefabs

TOP NWN Other

TOP NWN Movies

TOP Sounds

TOP NWN Textures

TOP NWN Creatures

TOP NWN Characters