logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
nwnx_funcs for windows
Goto page 1, 2, 3 ... 27, 28, 29  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Mon Mar 22, 2010 6:55    Post subject: nwnx_funcs for windows Reply with quote

I've started porting nwnx_funcs to windows:

Edit:
The latest version can always be found at the following to links. (NwVault eventually links to sourceforge for the download.)

http://nwvault.ign.com/View.php?view=Other.Detail&id=1447

https://sourceforge.net/projects/mrnwnxstuff/files/


Last edited by MaxRock on Mon Feb 07, 2011 1:57; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Mon Mar 22, 2010 10:03    Post subject: Reply with quote

Excellent, keep it up Smile
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Mon Mar 22, 2010 21:31    Post subject: Reply with quote

Update 0.0.3: Added SetSkill functions.

I think I have everything to replace the letoscript level up process for our legendary level system and put it to a "real life" PW test.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
motu99



Joined: 24 Sep 2007
Posts: 16

PostPosted: Mon Mar 22, 2010 21:51    Post subject: Re: nwnx_funcs for windows Reply with quote

MaxRock wrote:
I've started porting nwnx_funcs to windows:


Hurray! Cool
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Tue Mar 23, 2010 17:10    Post subject: Reply with quote

Do i require some windows framework or something? Becase it doesnt work on my PC while it works at my laptop.

It writes: error 14001: launch failed because configuration of aplication is incorrect or something like that error is not in english language
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Tue Mar 23, 2010 17:30    Post subject: Reply with quote

ok it seems it requires Microsoft Framework 3.5 problem solved
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Tue Mar 23, 2010 18:12    Post subject: Reply with quote

Ugh, that's probably because I'm using Visual Studio 2008 to compile it.
I wonder if I can get around that as there shouldn't be anything actually requiring the .net framework.

Edit:
I think I got it. Dependency Walker shows no MSVCR90 anymore after switching from "Multi Threaded DLL" To "Multi Threaded"
Back to top
View user's profile Send private message Send e-mail MSN Messenger
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Sun Mar 28, 2010 6:09    Post subject: Reply with quote

Added a few new functions:

GetTotalAreas
GetTotalLocalVariables
GetHasLocalVariable
ModAbilityScore
SetCreatureSize
Set/GetCreatureEventScript

And made some mostly cosmetic code changes. ...It's turning into spaghetti code, so much for OOP Confused


From what I've seen in the linux source, all (most) functions making changes to strings carry a warning about memory leaks.
How can I tell if I've caused one?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Sun Mar 28, 2010 11:42    Post subject: Reply with quote

*Codegasm*

All needed now is RemoveFeat(), or did I miss that one in there someplace? Razz
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Sun Mar 28, 2010 13:55    Post subject: Reply with quote

MaxRock wrote:
GetTotalAreas
GetTotalLocalVariables


Being a pedant, I'd like to suggest a slight grammatical change: I think better names would probably be GetAreaCount and GetLocalVariableCount. "GetTotalXs" doesn't really immediately imply that you're doing something with the number of Xs, whereas "GetXCount" does. Other than that, great job!
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Thu Apr 01, 2010 18:51    Post subject: Reply with quote

Terra_777 wrote:
*Codegasm*

All needed now is RemoveFeat(), or did I miss that one in there someplace? Razz


Fireboar wrote:
MaxRock wrote:
GetTotalAreas
GetTotalLocalVariables


Being a pedant, I'd like to suggest a slight grammatical change: I think better names would probably be GetAreaCount and GetLocalVariableCount. "GetTotalXs" doesn't really immediately imply that you're doing something with the number of Xs, whereas "GetXCount" does. Other than that, great job!


Happy to oblige Smile

Update 0.0.5
Added functions:
  • GetEquippedWeight
  • ModSavedSkillPoints
  • RemoveFeat
  • GetFeatKnown
  • RemoveAllFeats
  • GetAllKnownFeats
  • SetAllSkillsToZero
  • AddKnownSpell
  • RemoveKnownSpell
  • GetKnowsSpell
  • RemoveAllSpells
  • ModBaseAttackBonusOverride
  • GetBaseAttackBonusOverride

Fixed:
  • Set/ModSavedSkillPoints: Always set the amount of skillpoints to 10 times of what was specified regardless which function was used

Renamed Functions:
  • GetTotalAreas -> GetAreaCount
  • GetTotalLocalVariables -> GetLocalVariableCount
  • GetFirstLocalVar -> GetFirstLocalVariable
  • GetNextLocalVar -> GetNextLocalVariable
  • SetBaseAttackBonus -> SetBaseAttackBonusOverride

Other:
  • Renamed some parameters to make it more clear on what the function can be used (e.g.: oObject became oCreature if the function is supposed to be used on creatures)
  • Fixed incosistencies between function declaration and its definition.
  • nwnx.ini settings:
    [FUNCS]
    ; DebugLevel=[0|1|2|3]; defaults to 0
    debugLevel=3

    ; The number of the last line in skills.2da for when a module uses custom skills; defaults to 27
    Last_Skill_Number=27;

    There's no real consistency in what is printed to the nwnx_funcs log file but the higher the level the more is logged.
    DebugLevel=0 only prints output from the dumplocal and dumpeffects functions. Level 1 should be informational stuff, level 2 should be errors
    and level 3 should be for stuff that I'm trying to debug (and subsequently forget to remove)
    This has actually been there since the beginning, I just forgot to mention it.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Apr 01, 2010 21:36    Post subject: Reply with quote

oooh spells managing, neat! you fullfilled my secret wish Smile
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Fri Apr 02, 2010 6:18    Post subject: Reply with quote

Had to drop in a hotfix because SetLastEffectCreator was crashing the server.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Xylou



Joined: 06 Apr 2010
Posts: 7
Location: France

PostPosted: Tue Apr 06, 2010 20:25    Post subject: Reply with quote

Hello MaxRock.
I've taken the last version (0.0.51) but unfortunately got a compilation error with the sSpacer of the function NWNXFuncs_GetAllKnownFeats.
It has 1024 blank characters with seems to much for my Aurora (don't know if it's normal or not). I've cut it in 4 (because 512 is also too much Crying or Very sad, but 256 is fine ) and I've added twice the line "sSpacer += sSpacer;" so it should have the same length at the end (2048).

Is there someone else also having the compilation error?
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Tue Apr 06, 2010 20:59    Post subject: Reply with quote

Code:
string NWNXFuncs_GetAllKnownFeats(object oCreature, string sDelimiter=",") {
    string sSpacer = "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ";
    sSpacer += sSpacer;
    SetLocalString(oCreature, "NWNX!FUNCS!GETKALLNOWNFEATS", sDelimiter+GetStringLeft(sSpacer, GetStringLength(sSpacer)-GetStringLength(sDelimiter)));
    string sRet = GetLocalString(oCreature, "NWNX!FUNCS!GETALLKNOWNFEATS");
    DeleteLocalString(oCreature, "NWNX!FUNCS!GETALLKNOWNFEATS");
    return sRet;
}


The optimal token length. Very Happy
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Goto page 1, 2, 3 ... 27, 28, 29  Next
Page 1 of 29

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group