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).
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.
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. :)
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.
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. :)
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
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:
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.