This is a Creature OnDeath event which assigns custom experience based on the CR of the creature vs. the Average Party Levels. In addition, it fixes several things seen with most custom experience systems. 1) Divide By Zero errors are fixed. 2) The 'double message' for experience in the player window is fixed. For more information, see the box below concerning features, updates, fixes, and credits to others. Primary experience reward system credited to Helznicht & Mmealman for their work on the abandoned project 'DMG Style EXP Award' at http://nwvault.ign.com/Files/scripts/data/1026158289659.shtml. Should work just fine without HotU and should work on any version of NWN. If you can't import the installer due to an older version, use the Advanced Installer. The Advanced Installer is there for people who already have a custom experience system in place and just want to make it one experience message and take away the Divide By Zero errors.
Thanks. I have mostly been working on my old bank system. I appreciate you working on this, as I pretty much abandonned it. :) What you've posted looks pretty good.
Posted by BornNaked ( 217.81.xxx.xxx ) at 2004-11-24 19:42:00
Another thing with this script is that it fires the Death Event twice since that creature gets resurrected and killed immediately again.
And yes a third thingy I noticed is that it bypasses your customed XP calculation if you kill creatures with a trap. If you do so you get the XP that you would get normally.
This is surely funny if you are in a party together with a high level character who uses traps to kill off those critters that give many many XP :D
I have no solution for this yet though...
Posted by BornNaked ( 217.86.xxx.xxx ) at 2004-11-24 17:51:00
Hello there,
Nice script. I found a little bug though if creatures have a CR of less than 1.
this line:
float BaseMonEXP = GetChallengeRating(OBJECT_SELF) * BaseEXP;
will result in 0.125 xp for a 1/8 CR creature
which is fine but then in this line:
float AdjustValue = GetChallengeRating(OBJECT_SELF) / PartyAvgLvl;
you create an adjust value of 0.125 which finally in this line:
if (AdjustValue < 1.0) {
FinalMonValue = BaseMonEXP * AdjustValue; }
will end up in a result of 0,015625
that turns out as 0 xp for CR 1/8 which should be 3XP.
3 changes are needed to fix that quite quick though...
change this line:
float BaseEXP = 25.0;
to
float BaseMonEXP = 25.0;
comment out this one
float BaseMonEXP = GetChallengeRating(OBJECT_SELF) * BaseEXP;
and finally change
if (AdjustValue == 0.0) {
FinalMonValue = BaseMonEXP;
}
to
if (AdjustValue == 0.0) {
FinalMonValue = GetChallengeRating(OBJECT_SELF) * BaseMonEXP;
}
I believe that is something that is apparent with the DMG XP award script, the experience-generating part of the script. Therefore, if you implement the advanced installer instructions into your experience script, it will work as intended but without the double experience message.
I will think on a way to fix this problem in the meantime.
After futher testing I've found that it only occors when there is a group member outside of the area. Also there are times it seems hit or miss. Meaning even then there are a few times it works without divide error. Shadow Mountain is a new server but the new players tend to come back usually, so I must be doing something right. I hope this has helped you.
Mohobie _________________________ Shadow Mountain & Shadow Mountain 2: Riparia Link
I went to look for your PW, but no one was there, so I'll wait a bit to test it, I guess. I will just experiment about to see if I can determine a way to make it work properly.
I believe I have heard of this error before. I think it applies only to the ones who are not in the area at the present time. I will come by to see it in action, and I will try to think up a fix for it.
I'm running a PW module useing this code right now, however I have encountered a bug in the code. Players who join a party are given a divide by zero error. If you'd like to see it happen, simply join my 24/7 server posted under Alternative. It's called Shadow Mountain PW.
I love the script but for this small bump. I replaced default files and built it already. the problem only happens to players who are grouped. UNTESTED: I'm not sure if its just players who group with others in different areas, or if it happens when 2 players are grouped on same map, as I did not think to try that till now.
I'm running 1.62 with both expansions. _________________________ Shadow Mountain & Shadow Mountain 2: Riparia Link
I think the problem is a bit more widespread than one may come to realize right away. I hadn't even seen a fix listed for such until now, I don't recall.
The important thing is that old systems get updated with the removal of the double experience problem. I am glad someone / some people in the past had already been able to fix this problem; I didn't feel at all like a "pioneer" posting the fix (the game has been out so long, I figured someone *must* have fixed it in some way by now).
I also encourage anyone to post a link to their custom experience scripts that use this "bug fix" of sorts so people can get different experience systems.
If someone cannot script that well and make their own system, I'd like to have a way for them to find the kind of system more tailored for their needs (and I don't want them limited to just this one). Hopefully, this will be seen by the developers of all the custom experience systems so we can fix this bug once and for all. :)
Post your links below (or above, considering how comments are formatted).
Alright, should be updated now to cover the changes as mentioned below. :D
Posted by ScrewTape at 2004-03-06 13:32:15 Voted 10.00 on 03/06/04
This is the kind of submission that greatly helps the community - picking up where someone left off and ironing out the issues. Even better, includes instructions on how to fix common issues in similar scripts. Awesome!
I'll add in your suggestion for the fix as soon as possible. :) Couldn't test everything, and I really appreciate you testing it and informing us of that "slip through" of the system.
Will put that addition into the scripting and let everyone know when it has been updated. Big thanks for that input, though; I'm sure we all can benefit from that.
Posted by ScrewTape at 2004-03-06 13:13:00 Voted 10.00 on 03/06/04
Yup, just tested it and the above is true (won't bypass double XP if henchman was the one who delivered the final blow). I also tested my above fix, and with a bit of syntax correction, it fixes it nicely.
Here's the corrected version,
if (GetIsPC(oKiller) || GetIsPC(GetMaster(oKiller)))
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(),
OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_INSTANT,
EffectDamage((GetCurrentHitPoints()* 2)), OBJECT_SELF);
}
Posted by ScrewTape at 2004-03-06 12:43:00 Voted 10.00 on 03/06/04
AWESOME - BIG KUDO's for way to override the double XP message! If I understand correctly, this will also override the module's XP slider, so it won't matter where it is set to either.
I do see one corner case though where it won't work as intended (I believe). For example, if in single player, with a henchman, and the henchman actually does the killing blow, I think this is going to get bypassed. Depending on the XP system being used, it may still award XP, but it won't do the bypass on the double XP message, since the killer wasn't a PC. You could leave the check for PC out entirely, or use this instead:
int MAXHP = 90000;
If (GetIsPC(oKiller) || GetIsPC(GetMaster(oKiller))
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(),
OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_INSTANT,
EffectDamage(MAXHP, OBJECT_SELF);
}
GetFirstFactionMember only returns PC's by default. Provided the henchman/familiar/summoned/dominated creature is the same faction as the controlling PC. Are they???
Big Thanks!!
ScrewTape
You must be Logged In to post comments in this section.