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  



NWN SCRIPTS

- Jump to comments -
Title  Universal Experience System (Only 1 Experience Message & No Divide By Zero)
Author  Brian J. Kittrell
Submitted / Updated  03-04-2004 / 11-22-2006
Category  Scripting routines
Expansions  Works on all versions
Format  Code Only
Type  Type - Rewards
Includes  BioWare Standard
Description
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.

Files

NameTypeSizeDownloads
UniversalExpSystem1b.zipUniversalExpSystem1b.zip
Submitted: 03-04-2004 / Last Updated: 03-06-2004
zip6.55Kb624
--
SCORE OUT OF 10
10
1 votes
View Stats
Cast Your Vote!

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 (17):

Posted by TethyrDarknight at 2005-03-28 02:31:00    
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.

to prevent this the usual DoOnce routine helps.


if(!GetLocalInt(OBJECT_SELF, "DoOnce"))
{
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
SetLocalInt(OBJECT_SELF, "DoOnce", 1);
}
}


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;
}

That's it.

Cheers

Posted by TethyrDarknight at 2004-03-11 11:02:00    
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.

Posted by Mohobie at 2004-03-10 22:57:00    
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

Posted by TethyrDarknight at 2004-03-10 16:09:00    
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.

Posted by TethyrDarknight at 2004-03-10 15:36:00    
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.

Posted by Mohobie at 2004-03-10 11:47:00    
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

Posted by TethyrDarknight at 2004-03-08 15:18:00    
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).

Anywho, thanks for the feedback. :D

Posted by TethyrDarknight at 2004-03-07 11:42:00    
Well, for the longest time, I believed the same thing; "It cannot be done!" I happened upon the answer on accident, though.

Posted by TethyrDarknight at 2004-03-06 18:55:00    
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).

Posted by TethyrDarknight at 2004-03-06 13:38:00    
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!

Posted by TethyrDarknight at 2004-03-06 13:24:00    
Wanted to mention that if you leave the check out for PC altogether, you'll get a Divide by Zero error when an NPC kills another NPC.

Posted by TethyrDarknight at 2004-03-06 13:22:00    
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);
}

This should work, or you could use

object oMember = GetFirstFactionMember(oKiller);
if (GetIsObjectValid(oMember) == TRUE)
{
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.

 
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 Tutorials


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