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  Farchilde's XP Chat Function.
Author  Farchilde
Submitted / Updated  09-29-2008 / 09-29-2008
Category  Scripting routines
Expansions  HOTU-1.69
View Code  

Select All Text | View Code in separate window
Format  Module and Code
Type  Type - Other
Description
One thing I always hated doing in NWN was checking my char sheet while hunting to see how much XP I need to get to the next level.

Mainly because this takes half your screen out of clicking range and can mess you up bad in mobs. So... I wrote a script to solve this.

It is used on the "OnPlayerChat" event.

Anyway, is is simple, just type "-xp-" without the " ",s in in the chat bar, (doesn't matter the volume of chat) and viola, your -needed XP for next level- appears as a floaty string above your PC's head.

Here is the script, it is extremely long (Bioware wasn't nice enough to make a GetNeededXP function so I had to improvise), but since it is "if" statements, it is basically lag free.

Just DL the erf provided and set your OnPlayerChat event to "far_xpchat", the code is posted as well to look at, (Due to an interesting discussion on the Bioware scripting forums).

Enjoy. :)

Files

NameTypeSizeDownloads
far_xpchat.erffar_xpchat.erf
Submitted: 09-29-2008 / Last Updated: 09-29-2008
erf13.46Kb56
--
SCORE OUT OF 10
7
5 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 (13):

Posted by Realms_of_Mythology at 2010-09-21 17:18:54    Voted 10.00 on 09/21/10
Based on usefulness to me, I�m going to vote a 10 here. I really like the idea.

However, yeah� I�m not using that code. You are going to have me twitching for a couple hours after looking at that, Farchilde.

Still, I love the idea behind it and have added it to the chat commands for our PW. Thanks for sharing your intellectual property.

-- Mistress

Posted by Farchilde at 2008-09-30 11:45:16    Voted 10.00 on 09/29/08
An average mob... say 15 players hunting killing 5 creatures per minute. That's why.

And I would use your GUI AD, if I didn't use the POTM one already (I love that one):)

Posted by Qlippoth at 2008-09-30 10:57:53    
I was wondering, why don't you simply run this in the OnDeath of any creature you kill? This shouldn't happen TOO often if the mobs are balanced and you don't have to type anything.

- Qlippoth

Posted by The Amethyst Dragon at 2008-09-30 10:14:25    Voted 7.00 on 09/29/08
Of course, if you want to see what's happening in the game while your character sheet is open, you could always go with a transparent GUI... :)
_________________________
World of Aenea (Hall of Fame PW and the origin of all my works)
Vault Entries: The Complete List (50+ entries, including 17 Hall of Fame awards)

Self-Promotional Honesty: If you have opinions on stuff I've made, or if you use any of it (as a player or builder), I like comments/votes/feedback...so do other content makers and builders. Keep us motivated. :)

---------------------------- Neverwinter Nights Community Site: The Unofficial Homepage for NWN ----------------------------

Posted by Farchilde at 2008-09-29 21:57:54    Voted 10.00 on 09/29/08
Thanks A.D, that is constructive criticism. I mainly post things to the vault to share and spread ideas, even if they are somewhat "borked" in most's eyes.

I could make yet another housing system, yet another XP system, yet another crafting system, etc, and put them up, but why?

NWN is six years old, people got dozens of those to choose from, this is new and something I felt was useful, even if just for the idea.

Besides, think of it this way, I just demonstrated that basic math can be done via a simple list of ints and one set of comparisons.

Alternate route to the same effect, I think that has merit.

Posted by The Amethyst Dragon at 2008-09-29 21:30:11    Voted 7.00 on 09/29/08
Useful, simple idea. I think I'll run with it and make a similar function for the VC command system in my PW.

Code could be shorter, but that discussion has already taken place.

I'd have given this a higher score if it was designed to easily slip this into a pre-existing OnPlayerChat script. The score would also have been a bit higher if it also gave the current XP, not just how much more is needed for the next level.
_________________________
World of Aenea (Hall of Fame PW and the origin of all my works)
Vault Entries: The Complete List (50+ entries, including 17 Hall of Fame awards)

Self-Promotional Honesty: If you have opinions on stuff I've made, or if you use any of it (as a player or builder), I like comments/votes/feedback...so do other content makers and builders. Keep us motivated. :)

---------------------------- Neverwinter Nights Community Site: The Unofficial Homepage for NWN ----------------------------

Posted by Kilana at 2008-09-29 20:24:30    Voted 4.00 on 09/29/08
1. Would make more sense to wrap the code in a function. It's likely that a module would want to offer several chat commands via onPlayerChat, and the way this is set up makes adding additional commands very messy.

2. Going backwards in the exp chain makes the comparisons simpler

if(iXP >= i40) Max Level Message code
else if(iXP >= i39) Level 39 Message code
else if(iXP >= i38) Level 38 Message code
...

3. A big if/else IS more inefficent than a formula. Maybe one poorly written script wont make a performance difference, but a hundred or two hundred like this would.
_________________________
"Gentle child, slumber in peace; dragons and centaurs will guard your sleep.
Stars in heaven shining oh so bright will be your guiding light."

Posted by Farchilde at 2008-09-29 18:22:09    Voted 10.00 on 09/29/08
And and just for that, the idea isn't "good" it kicks ass, you know how many times I have died because of that damn character sheet?

I'll give myself a 10 and a cookie! :P

Posted by Farchilde at 2008-09-29 18:04:42    Voted 10.00 on 09/29/08
And just for that... I am -never- going to use that or any simple "formula". :P Ever, in any of my scripts, nope nope nope, copy paste rules forever!!!!!!!!!! :P :P :P

One thing I love about coding, 1000 ways to do something with the same result each way.

rates scripts on how well the work, not how good they look. ;)

Posted by Farchilde at 2008-09-29 17:53:58    Voted 10.00 on 09/29/08
How can one possibly rate a perfectly good script a zero just because it is "long" who cares, it does one thing and one thing alone?

I really don't care about my ratings, I posted stuff that half works up and leave it up (see my banking system) just because maybe someone else will get an idea from it.

To me this was so easy, I wrote a few lines of code in a simple fashion and copied and pasted, and changed the values in each line.

because it is long it isn't "good", show me the flaws?

Posted by ShaDoOoW at 2008-09-29 17:51:57    Voted 4.00 on 09/29/08
Well, out of space i guess, so I think my new functions would be enough:

int GetXPToLevel(int nLevel)
{
return --nLevel
_________________________
[Boost System] [Door System] [Devastating Critical Immunity] [HIPS remake] [Circle Kick Mode] [1.69 Full 2da Source]

Posted by ShaDoOoW at 2008-09-29 17:47:01    Voted 4.00 on 09/29/08
4.00 for idea
0.00 for script

There is my solution:

int GetLevelByXP(object oCreature)
{
return FloatToInt(0.5+sqrt(0.25+(IntToFloat(GetXP(oCreature))/500)));
}

int GetXPToLevel(int nLevel)
{
return --nLevel
_________________________
[Boost System] [Door System] [Devastating Critical Immunity] [HIPS remake] [Circle Kick Mode] [1.69 Full 2da Source]

Posted by Link6746 at 2008-09-29 17:10:03    
good idea, I say.
_________________________
__________________________________________________
Megadeth has a very intelligent way of talking about governments and religions: Either they bullshit you or try to kill you for not being one of them. I wholeheartedly agree.
(Note: Just because Mustaine is christian doesn't mean he believes EVERYTHING the bible tells him.)
__________________________________________________

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 Plug-Ins


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