Author Topic: NWN Lexicon  (Read 6721 times)

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
NWN Lexicon
« Reply #15 on: June 12, 2011, 07:38:54 pm »


               Here is a fix for the function i wrote above.  Lightfoot did a better job at making it smaller and simpler.  Thanks lightfoot8

Script Below:

//lighfoot fix:
// Return TRUE if weapon does bludgeoning damage
// Uses Get2DAString

int GetDoesBludgeoningDamage(object oWeapon)
{
int nBaseType = GetBaseItemType(oWeapon);
return (Get2DAString("baseitems","WeaponType",nBaseType) == "2");
// 2 = bludgeoning
}
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
NWN Lexicon
« Reply #16 on: December 13, 2011, 12:11:50 pm »


               I found out some quirks that wasnt documented in lexicon, might be usefull:

SetBaseAttackBonus
- works on player characters

ActionOpen/CloseDoor
- when the door are already opened/closed the OnOpen/OnClose event is still fired

SetLocked
- when the object is already (un)locked, the On(Un)locked event is still fired

SetImmortal
- (I made a big research few year ago about immortality also granting an immunity to many effect, however I lost it, it is somewhere in old bioware scripting forum...)

GetStringLower/UpperCase

- can't handle non-english characters, when characters like ÚĚČžýá encountered, it that case functions returns input

GetSpellId
- returns -1 if called inside of AOE script, GetEffectSpellId(EffectDaze()) will workaround this

GetSpellSaveDC
- if used in spellscript that fired from feat (feat that triggered spell) and the caster has his primary ability for that feat below 10, then this function returs very odd values beyond 100
x works correctly in AOE scripts, at least in 1.69

ResistSpell
- passes into consideration spell info from caster's last cast spell, thus for example immunity to AoE spell is not possible to guarantee and may be exploited

GetResRef
- works correctly on areas
- returns empty string when used on doors

EffectAttackIncrease
- ATTACK_BONUS_ONHAND and OFFHAND does not stacks with weapon's attack/enhancement bonus

GetCreatureTalentBest and GetCreatureTalentRandom
- specifying category 1 actually returns talents of category 11 and vice versa
- returns invalid talent if the creature is immobilized (toolset speed setting, entangle effect or cutscene immobility)
- random doesn't return truly random talent but rather random within best CR (EDIT: not sure about this anymore, my recent tests didnt confirmed it)
- best, if CR = -1 works like random, CR = 0 returns potions, scrolls and other items, spell has CR equal to (InnateLevel*2)-1, feats probably 0 as well
- if category = 0, returns anything without category, known feats (but not with 0 uses) and skills

EffectSpellResistanceDecrease
- cannot decrease spell resistance gained from Diamond Soul feat, not even if applied permanently/supernaturally

EffectNegativeLevel
- limit is indeed 100
- lexicon description is missing parameter int bHPBonus, but this parameter is ignored anyway

GetFirst/NextInShape
- returns placeables correctly despite what lexicon says

EffectSeeInvisibility
- cannot be used in conjuction with EffectVersus*
EffectTrueSeeing has probably the same issue

GetLastSpellHarmful()
- returns exact value passed into EventSpellCastAt function (this can be usefull for custom behavior)

GetTurnResistanceHD
- works on non-undead creatures
- doesnt work on player characters except possesed DM/familiar

GetAILevel
- on creature with unset AI level or ai level set to -1 (default or invalid), function returs AI_LEVEL_LOW when there is a player character in same area as creature or AI_LEVEL_VERY_LOW when not

SetAILevel
- setting AI_LEVEL_VERY_HIGH or any custom value higher than 3 results into AI_LEVEL_HIGH (3)

DecrementRemainingSpellUses
- cannot decrement spell that creature have memorised but shouldn't be able to use, for example if creature has a sixth level memorised under Spells tab but has caster ability only 15 or less, this function fails. Same spell given as Special ability is decremented properly.
- function decrements spontaneuos spell uses properly

GetHasSpell
- returns 1 for each spontaneou use when looking for cure/inflict spells cast by cleric


Not internal functions done by Bioware. Note the remarks Ive written are fixed and corrected in latests Community Patches.

GetIsMagicStatBonus (x2_i0_spells)
- returns strength bonus for target without any caster class
- this function should be avoided as it doesn't function correctly when target has more casting classes, only one spellscript uses this function and thats Shelgarn's persistent blade

GetShouldNotCastSpellsBecauseofArmor (nw_i0_generic)
- doesn't consider bards, doesn't consider autostill spell feat or using still metamagic

chooseTactics (nw_i0_generic)
- missing ClearActions before using rage feat causes not using this feat when caller doing something in that moment
- while checking for rage effect when determining whether to use spells at all, it doesn't check for Mighty rage effects.

DetermineclassToUse (nw_i0_generic)
- if creature has two classes, the function often returns (third) invalid class

CountEnemiesAndAllies (x0_i0_enemy)
- counts dead PCs and henchmans

IsOutOfAmmo (x0_i0_equip)
- doesn't considering throwing weapons correctly, thus default AI thinks its out of ammo and unequips them

WiseToDualWield (x0_i0_equip)
- doesn't considering ranger's dual wield feat

bkEquipMelee (x0_i0_equip)
- considering unidentified weapons and shields even when caller(henchman) cannot equip unidentified items
- considering weapons and shield that cannot equip due to the missing proficiences or size category
- function might equip inappropriate weapon for monk characters
- right hand (oRight) is switched for left hand (oLeft) causing character to equip new shield from inventory while already using shield

VerifyCombatMeleeTalent (x0_i0_match)
- considering vermins to be generally immune to stunning fist
- attempting to use smite to neutral targets

TalentHealingSelf
(x0_i0_talent)
- inapropriate use of bkTalentFilter when trying to use the spell on self - causes using heal spells on self when caller is undead

TalentUseTurning (x0_i0_talent)
- considering animal domain power as qualify for using turn undead on vermins

TalentSneakAttack (x0_i0_talent)
- doesn't consider death attack or sneak attack from BG class

TalentSeeInvisible
(x0_i0_talent)
- doesn't check for true seeing itemproperty
- doesn't consider already existing true seeing, see invisibility effects which might lead into casting the TS over and over

TalentBardSong (x0_i0_talent)
- doesn't check silence which might lead into being stucked
- doesn't check deafness which might lead into repeating this talent over and over

SetLastGenericSpellCast (x0_i0_generic)
- delayed deleting variable in fact leads into casting one spell over and over

bkTalentFilter (x0_i0_generic)
- when checking for PW: Death, the spell is decremented twice

bkRespondToHenchmenShout (x0_i0_henai)
- clearing actions before calling DetermineHenchmanRound might lead into never finishing spellcasting

BehDoFireBeam (x2_inc_beholder)
- BEHOLDER_RAY_FEAR has incorrect value

CICraftBrewPotion
and CICraftScribeScroll (x2_inc_craft)
- removes full stack, if CC allowed empty potions to stack
               
               

               


                     Modifié par ShaDoOoW, 30 juillet 2012 - 11:31 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
NWN Lexicon
« Reply #17 on: December 13, 2011, 02:00:55 pm »


               

ShaDoOoW wrote...
GetAILevel
- on creature with unset AI level or ai level set to -1 (default or invalid), function returs AI_LEVEL_LOW when there is a player character in same area as creature or AI_LEVEL_VERY_LOW when not


Might add to this that when AI_LEVEL_VERY_LOW is returned (for a creature only) the OnHeartbeat event fires once every 9 seconds (instead of once every 6 seconds).  This allows the Default AI to slow down heartbeat scripts when players leave an area.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
NWN Lexicon
« Reply #18 on: July 19, 2012, 11:22:19 am »


               a comment came up in another threda that somebody wished the lexicon were a wiki so they didn't have to wait for the admins (who now seem absent) to make the updates for them.

i downloaded the 1.69 lexicon from the vault, did a bunch of formatting scripting to make the pages look nice, and set up a wiki on my server to host them.

http://www.dalakora..../wiki/index.php

i have some work to do yet to make sure everything is how i want it, and then i'll likely blow the whole thing away and reinstall it with a cleaner url.

anyway, check it out and see what you think - though don't bother trying to update any of the pages just yet.
               
               

               


                     Modifié par acomputerdood, 20 juillet 2012 - 10:25 .
                     
                  


            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
NWN Lexicon
« Reply #19 on: July 20, 2012, 11:34:00 am »


               as was sparked in this post:

http://social.biowar...9035/1#13201848

there's been some debate on how to continue with the lexicon.  i've heard people say that they can't get a hold of any of the lexicon admins to see about updating the site, and conflicting stories of what version it's updated to.  so does anybody know:

a: if the online version has been updated to 1.69 now or not?  i'm guessing it's old because the first page of the online version has "Download NWN Lexicon v1.68 by GetLastLexiconUpdateBy from NWVault" on it, but then at the top of the page it says "last update: Wednesday, 22-Apr-2009 01:08:12 EDT".  i guess that last update says "April 2009 Release: GetLastLexiconUpdateBy February 2nd, 2009 release. Updated through patch 1.68 with change log.", so it's pretty unlikely that it is 1.69.

at the very least what functions i should compare to the v1.69 lexicon i downloaded from the vault?  what pages can i spot check to test?

b: who has tried contacting the sites admins and what means did they use?  there are some names listed in the design team, and here is the whois records for them:

Registrant:
Contact Privacy Inc. Customer 0119246184
96 Mowat Ave
Toronto, ON M6K 3M1
CA

Domain name: NWNLEXICON.COM


Administrative Contact:
   Contact Privacy Inc. Customer 0119246184,   nwnlexicon.com@contactprivacy.com
   96 Mowat Ave
   Toronto, ON M6K 3M1
   CA
   +1.4165385457
Technical Contact:
   Contact Privacy Inc. Customer 0119246184,   nwnlexicon.com@contactprivacy.com
   96 Mowat Ave
   Toronto, ON M6K 3M1
   CA
   +1.4165385457


Registration Service Provider:
   Hover, help@hover.com
   416.538.5498
   http://help.hover.com



Registrar of Record: TUCOWS, INC.
Record last updated on 06-Jul-2012.
Record expires on 07-Jul-2013.
Record created on 07-Jul-2002.


               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
NWN Lexicon
« Reply #20 on: July 20, 2012, 01:53:06 pm »


               i was dorking around with trying to diff the content files from my nwnwiki mirror and the pages downloaded from the vault to see what changes i needed to make to the mirror to have the latest content.  was working on this because i like the "feel" or formatting of the mirror moreso than the "windows help" style of the vault entry.

anyway, after an hour or so of this, i realized that all i had to do was copy the vault content into the mirror's pages, overwriting them all.  DOPE

http://www.dalakora.com/lexicon/

anyway, i now realize how trivial it is to update the lexicon pages if we only had access to them.

i STILL like the idea of a wiki, and i'll likely still toy with that idea.
               
               

               


                     Modifié par acomputerdood, 20 juillet 2012 - 12:57 .
                     
                  


            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
NWN Lexicon
« Reply #21 on: July 20, 2012, 02:01:19 pm »


               

acomputerdood wrote...

b: who has tried contacting the sites admins and what means did they use?  there are some names listed in the design team, and here is the whois records for them:


oh, and i'm working on this.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
NWN Lexicon
« Reply #22 on: July 21, 2012, 08:52:10 pm »


               i'm in contact with the owner of the lexicon.  he seems quite willing to help update it.

in the past, it seems to have been a system where the updates would be put into a database that generated a windows help archive.  then, a process would dump all of that and generate the html content.

he offered to try setting it all back up, but we discussed it a bit and that system sounds unnecessarily complex for the minor updates we want to do.

he seems willing to let us just update the HTML directly.

he suggested we use github to push updates to the server or host it directly on github.  i'm pretty unfamiliar with that, so if somebody knows more he's welcome to weigh in.


so what's the ideal situation we want?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
NWN Lexicon
« Reply #23 on: July 21, 2012, 10:10:21 pm »


               github uh huh, seems unnecessarily complicated, why just not grant individual peoples ftp access?

Oh one question - are scripters willing to update it to to the community patch 1.70-71? Ive made several changes especially inside AI-related includes and functions and I added few constants too.
               
               

               


                     Modifié par ShaDoOoW, 21 juillet 2012 - 09:13 .
                     
                  


            

Legacy_eeriegeek

  • Jr. Member
  • **
  • Posts: 75
  • Karma: +0/-0
NWN Lexicon
« Reply #24 on: July 21, 2012, 11:56:41 pm »


               acomputerdood, what format are the source database files in? Knowing that would help determine what the best workflow is.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
NWN Lexicon
« Reply #25 on: July 22, 2012, 03:49:58 am »


               

ShaDoOoW wrote...

github uh huh, seems unnecessarily complicated, why just not grant individual peoples ftp access?


i thought github sounded a little complicated, too.  all i think we need is a core group of people responsible for gathering/creating the updates and have access to ftp/scp them to the site.

the drawbacks, of course, are there's less version control.  well, maybe not version control, but at least version history.  and the site owner may or may not want to allow random people to have that level of access to his site.  it might even be an option to have him change the DNS records to point to another server that one of us controls.  that's the impression i got when he suggested moving the entire thing over to github.

but i've not asked him for any specific access to anything.  i wanted an idea of what we as a community wanted to do, and then we'll work something out with him.

Oh one question - are scripters willing to update it to to the community patch 1.70-71? Ive made several changes especially inside AI-related includes and functions and I added few constants too.


i think that community patch notes should either be in clearly marked sections of the normal pages or have a dedicated subsection of the lexicon specifically for it.

i first thought that the original pages should just be annotated with the patch updates so we don't have to remember to update two sets of pages, but if the page completely re-writes certain functions then it could be confusing to have two conflicting explanations on the same page.

another idea would be to have a link from the "standard" page over to the 1.7x page if functionality is re-written.  OR, maybe a checkbox or cookie can be set to take the user to 1.7x specific pages by default if he so chooses.

just throwing ideas out here.  don't know what's best for your system (or if the community itself) agrees that community patch notes should be included in the lexicon.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
NWN Lexicon
« Reply #26 on: July 22, 2012, 03:54:08 am »


               

eeriegeek wrote...

acomputerdood, what format are the source database files in? Knowing that would help determine what the best workflow is.


i don't know.  here's what his email said to me:

Its a old SQL Server/ASP.NET website that dumps into the database and a console program that uses the Windows Help Compiler to create HTML help. 

How important do you think the CHM file is?  If we've outgrown that we can drop that functionality and just let the site evolve as just HTML. 


it sounds as if shadoow and i are leaning towards the latter (just doing html).  the .chm file is the windows help archive that's used offline.  i don't think it's necessary to keep that up to day.  if somebody wants an offline copy, they can wget it like i did or we can package it up for direct downloads.  you can just point your browser to it and navigate just fine.
               
               

               


                     Modifié par acomputerdood, 22 juillet 2012 - 02:54 .
                     
                  


            

Legacy_eeriegeek

  • Jr. Member
  • **
  • Posts: 75
  • Karma: +0/-0
NWN Lexicon
« Reply #27 on: July 22, 2012, 06:04:03 am »


               I think it would be useful to at least see what form the original data is as stored in the SQL database. If the original owner is willing to dump it to a standard text file or SQL statements I'd be glad to take a look at it and we can see if it seems worth preserving in that form.

I use the CHM form locally because it's easy, but I agree we could live without it.

I worry about going to pure HTML for maintenance since it always seems to be too easy to allow non-well formed constructs to creep in. It can also make maintenance of things like headers and indexes painful to maintain if they are not auto-generated. Keeping a more formal data model makes automated processing of the complete lexicon much easier.

I think for patch 1.70 changes, personally, I would like to see the lexicon remain essentially a 1.69 document with added "boxed notes" for changes for 1.70 and future any versions.

I think github is actually a very good idea. It keeps the source in a well known publicly accessable place. It would be a bit of a learning curve, but it solves version merging nicely. It would allow a 1.69 version to go up quickly with edits for known changes. A fork could be made for 1.70 edits, and when they are complete, they could be merged into the baseline. It also has some wiki/bug tracking features so it should make it easy to coordinate updates.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
NWN Lexicon
« Reply #28 on: July 22, 2012, 06:43:32 am »


               

eeriegeek wrote...

I think for patch 1.70 changes, personally, I would like to see the lexicon remain essentially a 1.69 document with added "boxed notes" for changes for 1.70 and future any versions.

Yea, I expressed myself wrong, since the community patch is not official patch and peoples still uses 1.69, there must be basic info about 1.69 behavior. But the "box note" about the "update" from community patch would be cool to have I think.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
NWN Lexicon
« Reply #29 on: July 22, 2012, 10:47:09 am »


               I'm with eeriegeek on this one. The Lexicon is considered as close to "official" cannon as you can get when it comes to scripting. IMO it would be best for the Community to have the CP 1.70 changes entered into a "Community Patch" version of the Lexicon and maintain the original Lexicon as a separate document. Many people don't use the CP 1.70 and having such entries - even boxed - in the Lexicon might cause mass confusion.