Method of tracking spell usage and memorisation over logout/login updated for HotU, persistent over server travel/resets/crashes. Runs off the spellhook, OnPlayerRest and OnClientEnter events. Simply unzip the .erf and import the files into your module. Instructions included in the .erf. Feedback is welcome. See the text file below for details.
Posted by Pumuki at 2012-02-06 22:55:26 Voted 8.00 on 02/06/12
A bit dificult to use for people who don´t know to write scritps. I´ve got the sensation of cast and polymorph feats got a little chance of get canceled...But good work!
Sorry for my english :(
Posted by ikkis ( 62.254.xxx.xxx ) at 2005-07-29 16:27:57
ok it's totally messed up my comment posting here.
Check those lines in the script though - there is a short-circuit error in the if statement where there is just a nonzero value as an or condition, rather than an equality check against nID
Posted by ikkis ( 62.254.xxx.xxx ) at 2005-07-29 16:27:04
the 324 will mean that this if always evaluates true, as it is nonzero. There should be a nID == here, the error is also on line 100
Posted by ikkis ( 62.254.xxx.xxx ) at 2005-07-29 16:25:41
there is an error in script file st_inc
line 124 is an if conditional which starts:
if((nID >= 0 && nID = 0 && nID
Posted by Sir_Elric at 2005-06-29 17:50:39 Voted 7.00 on 06/29/05
Laggy and doesn't address swaping spells. _________________________ City of Melnibone
ausnwn.dyndns.org:5121
Posted by Mermut at 2005-05-17 14:35:26 Voted 8.50 on 05/17/05
The system is well done. One of the few systems that takes advantage of the spellhook system. I found it every easy to follow as well as intergrate into my existing systems. _________________________ I am willing to suspend my disbelief,
But not hang it by the neck until dead.
Posted by Lucky Day ( 63.13.xxx.xxx ) at 2005-01-09 15:04:00
SE what other script did you use? Was it a custom one of your own?
Posted by Lucky Day ( 63.13.xxx.xxx ) at 2005-01-09 15:04:00
SE what other script did you use? Was it a custom one of your own?
Posted by The Incredible Hulk ( 195.204.xxx.xxx ) at 2004-12-22 02:44:00
I know what im going to ask is what you are "fighting" to make unessesary, but does anyone have a working strip-memorized-spell-on-join script?
I just need this while im trying to figure out how to insert this other script.
Please help me out.
-Hulken
Posted by Sir_Elric at 2004-11-01 21:14:00 Voted 7.00 on 06/29/05
FYI I found this system to be quite laggy in the end and had to remove it in favour of another one.
When players were resting there was a pause at the end of resting and also when players were logged in there were severe lag spikes.City of Melnibone - PW
ausnwn2.dyndns.org:5121 _________________________ City of Melnibone
ausnwn.dyndns.org:5121
Posted by Lucky Day ( 63.13.xxx.xxx ) at 2004-10-28 12:00:00
gah - its these boards that can't handle my post. I posted right the first two times
in fact that is likely what happened to your code sir elric
st_inc.nss(122): ERROR: NO SEMICOLON AFTER EXPRESSION
these boards can't hadnle a properly formated "for" loop and its combining the for and the if statements together.
Posted by Anonymous ( 63.13.xxx.xxx ) at 2004-10-28 11:53:00
man!
I can't sem to post right today
one more time :P
Sir Elric:
the whole line
for(nID=0;nID= 0 && nID = 340 && nID = 363 && nID = 387 && nID = 414 && nID = 429 && nID = 512 && nID = 636 && nID = 0 && nID = 340 && nID = 363 && nID = 387 && nID = 414 && nID = 429 && nID = 512 && nID = 636 && nID = 0 && nID = 340 && nID = 363 && nID = 387 && nID = 414 && nID = 429 && nID = 512 && nID = 636 && nID
Posted by Lucky Day ( 63.13.xxx.xxx ) at 2004-10-28 11:50:00
sorry
the whole line
for(nID=0;nID= 0 && nID = 340 && nID = 363 && nID = 387 && nID = 414 && nID = 429 && nID = 512 && nID = 636 && nID = 0 && nID = 340 && nID = 363 && nID = 387 && nID = 414 && nID = 429 && nID = 512 && nID = 636 && nID
Posted by Lucky Day ( 63.13.xxx.xxx ) at 2004-10-28 11:40:00
Sir E
you forgot ;nID++ in the line
for(nID=0;nID= 0 && nID = 340 && nID = 363 && nID = 387 && nID = 414 && nID = 429 && nID = 512 && nID = 636 && nID
Posted by Frang ( 151.205.xxx.xxx ) at 2004-09-10 07:20:00
anyway you can update the file its not working.
says the spelltrackv1_3.erf header is corrupt. and wont let me unzip it
Posted by Sir_Elric at 2004-09-04 10:43:00 Voted 7.00 on 06/29/05
The fix I created for my earlier post is this for anyone that's interested.
Open st_inc and scroll down to...
// Check if a spell was memorised legally (with resting)
nLegal = st_GetInt(oCaster,"st_SpellCastLegal_"+IntToString(nID)+"_");
if(nLegal)
{
// Remove any castings of the spell already used
nCasts = st_GetInt(oCaster,"st_NumSpellCast_"+IntToString(nID)+"_");
st_LegalLoopDecrement(oCaster, nID, nCasts);
}
//Check for more of the same spell if so decrement them
if (nSpell>nLegal)
{
int iRemove = nSpell - nLegal;
st_LegalLoopDecrement(oCaster, nID, iRemove);
}
change it to...
// Check if a spell was memorised legally (with resting)
nLegal = st_GetInt(oCaster,"st_SpellCastLegal_"+IntToString(nID)+"_");
if(nLegal)
{
// Remove any castings of the spell already used
nCasts = st_GetInt(oCaster,"st_NumSpellCast_"+IntToString(nID)+"_");
st_LegalLoopDecrement(oCaster, nID, nCasts);
//Check for more of the same spell if so decrement them
if (nSpell>nLegal)
{
int iRemove = nSpell - nLegal;
st_LegalLoopDecrement(oCaster, nID, iRemove);
}
}
HTH
SECity of Melnibone - PW
ausnwn2.dyndns.org:5121 _________________________ City of Melnibone
ausnwn.dyndns.org:5121
Posted by Sir_Elric at 2004-08-30 04:46:00 Voted 7.00 on 06/29/05
One other thing I have found is if you swap used spells for spells that you already had these will not be decremented if you log in and log out.
ie: 5th level wizard spells have 3 firebrands and 3 hold monsters cast all 6 spells replace the hold monster with 3 more firebrands log out and back and you have the 3 new firebrands ready to use :S
SECity of Melnibone - PW
ausnwn2.dyndns.org:5121 _________________________ City of Melnibone
ausnwn.dyndns.org:5121
Posted by Sir_Elric at 2004-08-28 18:32:00 Voted 7.00 on 06/29/05
Easiest way to log spells on first log in rather than decrement them all is to use your st_OnRestCompleted(oPC); function with a delayed SetLocalInt().
#include "st_inc"
void main()
{
object oPC = GetEnteringObject();
if (!GetLocalInt(oPC, "ENTERED"))//First log in?
{
st_OnRestCompleted(oPC);//Log all current spells
}
else
{
st_HideCheck(oPC);
DelayCommand(0.8,st_SpellCheck(oPC));
}
DelayCommand(10.0, SetLocalInt(oPC, "ENTERED", TRUE));
}
Cheers
SECity of Melnibone - PW
ausnwn2.dyndns.org:5121 _________________________ City of Melnibone
ausnwn.dyndns.org:5121
Posted by Sir_Elric at 2004-08-28 01:30:00 Voted 7.00 on 06/29/05
Excellent stuff just about to add it to my PW.
One thing I added was setting a delayed local on the player as they enter in the OnEnter script.
void st_SpellCheck(object oCaster)
{
if(GetIsPC(oCaster) && !GetIsDM(oCaster) && !GetIsDMPossessed(oCaster))
{
int nID, nSpell, nLegal, nCasts;
for(nID=0;nID= 0 && nID = 340 && nID = 363 && nID = 387 && nID = 414 && nID = 429 && nID = 512 && nID = 636 && nID _________________________ City of Melnibone
ausnwn.dyndns.org:5121
Posted by Case at 2004-08-05 03:20:05 Voted 8.25 on 08/05/04
Posted by Harkinian at 2004-06-19 05:52:57 Voted 9.00 on 06/19/04
Excellent system. Well coded and thought out. Very user friendly.
Posted by Tobur ( 212.119.xxx.xxx ) at 2004-06-14 03:20:00
Excelent work! I used this spell tracking in persistence world. Very simple and easy use.
Bug with domain spell is common problem.
Not domain spells, just regular spells. Someone mentioned it in passing a while back, and when I checked Endurance (mage and cleric spell) sure enough it was missing the spellhook function. No list sorry.-
Ignorance is only a curse to those who believe it isn't.
Posted by NWNFan ( ..xxx.xxx ) at 2004-03-29 17:14:00
I'll take a look at the new version :)
If you want them to have all their spells at first log in only (after a server restart) without worrying about Hide persistance, you can run the rest completed script on them on their first enter, and set a variable on them so when they relog, this script it bypassed.
Some cleric domain spells don't include the spell hook? Damn. Do you have the list handy somewhere? Have you added in the hook in your own mod? It could be a cause of domain problems for me at least.
Hmm...I've been told that several clerical spells do not have the spellhook checks included in their scripts, and I know that Endurance is one of them, are the X2PreSpellCast() and the x2_inc_spellhook include both added to your nw_s0_endurce.nss (sorry, know you said you added them but have to ask)? It might also have something to do with the problems NWNFan mentioned with Spontaneous healing, though I haven't been able to duplicate them so I'm not certain about that.
As far as the CEP affecting this, again I'm not certain as the worlds I play in don't use it. If it affects the spells in some way, either adding custom's or alterations to spells.2da etc, then that may well be the case.
As for a forum, afraid not, so I do appreciate the bug reports getting posted here.-
Ignorance is only a curse to those who believe it isn't.
Ahhh, ok. (on the first problem). I read that and misinterpreted it. I thought that placing the variable on the module would work while it was running, and that after a crash the player would just have all of their spells back. I see what you mean now.
On the second problem, I used to have the hard core spell installed, but have since removed all references to them. So the system has reverted back to the bioware original. The spells I have modified, I've added in the spell hook to the beginning of each of them. Also, I am using the Community Expansion Pack. Would that cause any weirdness?
On a side note:
I did find one thing that was odd in my personal testing. The character was a level 8 cleric, using normal spells. If I cast all of my spells and relog, When I log back in, I have Endurance back on my list. Everything else worked fine.
BTW, do you have a forum, or do you prefer that we report possible bugs here? _________________________ Borgo Pass PW Link
The first problem I can answer straight away, and I think I mention this in the readme but perhaps I should add a more complete explanation. There are three options (in the current version - 1.3, two in 1.2 and previous) for storing the tracking variables.
1. The first, and default, method is simply using the module to hold the variables. That means they are persistent only so long as the server remains up and running, and are not stored over server crashes or reboots. Unless you have altered the value of the constants in the st_inc include this is the method you will be using in your module.
2. The second method (in 1.3 only) is to use a non-drop item common to ALL players (such as an emote ball/wand) to store the variables. This ensures that they will be persistent even over server crashes/reboots, and will solve your sorcerer player's problem.
3. The third (second and only other option in 1.2 and previous) uses a creature hide item on the player to store the variables. This also ensures persistency over server crashes/reboots, though I would only use this if you do not wish to use a non-drop item to hold the variables.
My suggested course would be to use method number two, and there are fairly clear instructions in the st_inc include on how to do this. It simply involves entering the tag of the desired object (to store the variables on) to the constant declarations, and altering the value of the other declared constant to 1.
As far as the second problem with the cleric spells, I'm not certain what the cause of that could be, as I have specifically tested one of those and had no troubles with it. Have you modified those spells at any time previously, or the spells.2da, or any other similar files? Hopefully, more details will make it simpler to track down the cause.
-
Ignorance is only a curse to those who believe it isn't.
I just installed your spell tracking system and have a few reports from the players to send your way. BTW, I'm really happy you made this system, since it's focused on the spell hook. Here is one of the reports I received:
/////////////////////////////////////////////
I have problems since spell tracking was added. Everytime a server resets you start with all spells lost? Even if you rested before the server reset and should have full spells. This is really deadly for my Sorceress since she is totally lost without spells.
My Cleric has another more strange problem. The first rest after a server reset does not give all spells back. More precisely my 2 copies of Bull's strength and my one extended bless are not returned. I need to rest twice to get those. Its highly annoying. Please look into that.
///////////////////////////////////////////// _________________________ Borgo Pass PW Link
Right, managed to duplicate the TMI error, and after a few alterations to how spells are decremented it seems to be fixed. Also fiddled with the storage functions to both tidy things up and make it easier for folks to change how variables are tracked.
However I'm having trouble finding problems with spontaneous casting being incorrectly tracked, as myself and the folks I dragoon into helping me haven't come across any problems with it as yet. Can you give more details on that?
As far as domain spells go, there just isn't much I can do about that at the moment. Oddly enough, level one clerical domain spells can be tracked and decremented, but none higher.
Hope you can test this one out as well NWNFan, and provide more feedback.-
Ignorance is only a curse to those who believe it isn't.