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 
 
Beta plugin: nwnx_funcs
Goto page Previous  1, 2, 3, 4, 5, 6 ... 9, 10, 11  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
Ravine



Joined: 26 Jul 2006
Posts: 105

PostPosted: Wed Mar 04, 2009 18:47    Post subject: Reply with quote

Hmm just noticed this function:

float GetGroundHeightFromLocation (location lLoc);

Does it work on non-flat ground (like Rocky mountains)? It's a walkmesh-height check?
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Mar 04, 2009 21:03    Post subject: Reply with quote

Ravine wrote:
Hmm just noticed this function:

float GetGroundHeightFromLocation (location lLoc);

Does it work on non-flat ground (like Rocky mountains)? It's a walkmesh-height check?
Yes.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Quixsilver



Joined: 20 Jan 2009
Posts: 30

PostPosted: Thu Mar 05, 2009 6:46    Post subject: Reply with quote

Does this function work for anyone else (using latest svn version)?

Code:
void SetRawQuickBarSlot (object oPC, string sSlot);


I'm looping through each slot, storing/echoing the string returned by GetRawQuickBarSlot in a local var, and then later looping back through and trying to restore the quickslots using SetRawQuickBarSlot and passing in the local var that was previously stored. Log file shows -1 returned for all calls to SetRawQuickBarSlot.
Back to top
View user's profile Send private message
scarface



Joined: 12 Jun 2005
Posts: 94
Location: Sweden

PostPosted: Mon Mar 09, 2009 22:21    Post subject: Reply with quote

SetMaxHitPoints doesn't seem to be working.

I use funky's LL function to get the hitpoints that should be applied:

Code:
// set hitpoints
                SetMaxHitPoints (oPC, GetMaxHitPoints(oPC) + GetHitPointsGainedOnLevelUp(oPC));
                SendMessageToPC(oPC, "Hitpoints Gained: " + IntToString(GetHitPointsGainedOnLevelUp(oPC)));


I get "Hitpoints Gained: 14" but they don't apply... Feats apply, stats apply, skills apply, but not hit points.
Back to top
View user's profile Send private message
Zunath



Joined: 06 Jul 2006
Posts: 183

PostPosted: Tue Mar 17, 2009 18:49    Post subject: Reply with quote

I'm also having problems with SetMaxHitPoints.

It adds them, but they are added to the current HP not the max HP.

Other than that, everything I've tested so far works great. Glad I finally got it all to work XD
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Wed Mar 18, 2009 0:09    Post subject: Reply with quote

That function is for use on NPCs only. For PCs you need to set them by level, with SetMaxHitPointsByLevel.

Funky
Back to top
View user's profile Send private message
Zunath



Joined: 06 Jul 2006
Posts: 183

PostPosted: Thu Mar 19, 2009 0:44    Post subject: Reply with quote

Ah okay, makes sense now. Thanks. I have just a few more questions...

If I were to add 30 HP to the PC's level 2 they wouldn't take effect unless the PC was actually that level right?

What's the max amount of HP you can set per level? 255?
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Thu Mar 19, 2009 22:38    Post subject: Reply with quote

I have no idea, but would assume so, if you can even make a levelstat list entry with that command, which I kind of doubt. The limit is 254, iirc, but if it isn't that, it's 255.

Funky
Back to top
View user's profile Send private message
Calan



Joined: 23 Mar 2009
Posts: 16

PostPosted: Mon Mar 23, 2009 20:28    Post subject: Compiling Reply with quote

I have downloaded everything using svn, and finally compiled the plugin in Ubuntu by doing the following:
-I removed "@CFLAGS@" from the Makefile.in
-I removed "@CPPFLAGS@" from the Makefile.in
-I removed "@LDFLAGS@" from the Makefile.in
-I compiled using the following command: make -f Makefile.in

The new lines in the Makefile.in look like this:

Quote:
CFLAGS = -Wall -Werror $(DEFS) $(INCS)
CPPFLAGS = -Wall -Werror $(DEFS) $(INCS)
LFLAGS = -w -fPIC -shared -rdynamic


I am new to Linux and it took me a good long while to even get it to this point, where it compiled at all. The reason I removed the flags settings above was because it gave me a "file not found" error. I'm willing to admit that removing something like that might be part of my issue, but it won't compile with that in there. Once it compiled, I installed it and got the following error on server startup:

Quote:
NWNX2lib: Init
NWNX2lib: org SetString() at 0x81f41b4, new SetString() at 0xb80bbf00
NWNX2lib: org GetObj() at 0x81f40bc, new GetObj() at 0xb80bbf28
* Parsing configuration...
NWN Extender v2.7-beta4
(c) 2004 by the APS/NWNX Linux Conversion Group
(c) 2007-2008 by virusman
Based on the Win32 version (c) 2003 by Ingmar Stieger (Papillon)
and Jeroen Broekhuizen
visit us at http://www.avlis.org

* Loading modules...
ERROR: dlopen: ./nwnx_funcs.so: ./nwnx_funcs.so: undefined symbol: nwn_GetLevelStats
* NWNX2 activated.


Others seem to be using the plugin just fine so it's probably an issue with how I'm getting it to compile. Any input would be helpful.
Back to top
View user's profile Send private message Visit poster's website
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Mon Mar 23, 2009 20:53    Post subject: Reply with quote

You were doing ./configure before make, right?
Back to top
View user's profile Send private message
Calan



Joined: 23 Mar 2009
Posts: 16

PostPosted: Mon Mar 23, 2009 21:30    Post subject: Reply with quote

I did try running ./configure, it does nothing:
Quote:
bash: ./configure: No such file or directory
Back to top
View user's profile Send private message Visit poster's website
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Tue Mar 24, 2009 0:04    Post subject: Reply with quote

Code:
~/nwnx-svn/trunk$ ls
CHANGELOG    config.log     doc        install.sh   Makefile.in    nwnx2lib.cpp  README
compiled     config.status  gline.cpp  lib          nwn            NWNXBase.cpp  readme.txt
config.h     configure      gline.h    licence.txt  nwnstartup.sh  NWNXBase.h    TODO
config.h.in  configure.ac   include    Makefile     nwnx2.ini      plugins
~/nwnx-svn/trunk$


Odd, configure should be there. Are you using the tree from svn?
Back to top
View user's profile Send private message
Calan



Joined: 23 Mar 2009
Posts: 16

PostPosted: Tue Mar 24, 2009 0:25    Post subject: Reply with quote

*a light goes off overhead*

I am attempting to compile just that one single plugin, not the entire trunk, so I am compiling from the funcs folder, not the trunk folder.

I attempted from the trunk folder, and got a missing mysql.h file, I presume because I need to get those from the repository as mentioned earlier. I understand what the content is that is needed, but I don't know which specific packages contain that content. Any specific package names? I do a general search for that stuff but get so many results I'm still unsure which to download.


EDIT:

I downloaded the following packages for Ubuntu (just for anyone else who is having issues too):
libmysqlclient15-dev
zlib1g-dev

Also needed:
gperf

Once downloaded, it compiled perfectly -without- the edits I made a few posts above. I replaced the nwnx2.so file with the newly compiled one, and also the funcs plugin, and this seems to work now. Thanks for the point in the right direction.

Quote:
NWNX2lib: Init
NWNX2lib: org SetString() at 0x81f41b4, new SetString() at 0xb8096c7e
NWNX2lib: org GetObj() at 0x81f40bc, new GetObj() at 0xb80966bd
* Parsing configuration...
NWN Extender v2.8-dev
(c) 2004 by the APS/NWNX Linux Conversion Group
(c) 2007-2008 by virusman and Acaos
Based on the Win32 version (c) 2003 by Ingmar Stieger (Papillon)
and Jeroen Broekhuizen
visit us at http://www.avlis.org

* Searching for signatures...
* Loading modules...
FUNCTIONS plugin registered.
FUNCS plugin registered.
* NWNX2 activated.


I haven't had the chance to actually test to see if it's working in game, but I suspect it is.
Back to top
View user's profile Send private message Visit poster's website
Calan



Joined: 23 Mar 2009
Posts: 16

PostPosted: Tue Mar 24, 2009 23:57    Post subject: Reply with quote

As I start working with this system, I have found what is to me a pretty serious issue, and a bug.

The issue, put simply, is that a wonderful improvement to NWN and a lot of work is rendered often useless by a simple lack of documentation. A few examples:

Code:
/* Sets oCreature's ability score nAbility to nValue. */
int SetAbilityScore (object oCreature, int nAbility, int nValue);


As with almost every other function, this returns a value even though it's a "Set" function, which is fine, but it is not documented what is returned. This doesn't make the function useless, obviously, but the return value is useless because no one knows what it means.

As with every other function, the documentation that -is- there is commented out using /* and */ rather than //, which means that the documentation isn't available in the development environment. This is a simple change that would help greatly. Of course I can edit this on my end, but that doesn't help other potential users and I think it would make the system far more usable for everyone.

Code:
/* Get a string containing all remaining feat uses for oCreature. */
string GetAllRemainingFeatUses (object oCreature);

/* Restore the remaining feat uses for oCreature from the given string. */
int RestoreReadyFeats (object oCreature, string sFeats);

/* Restore the remaining spell uses for oCreature from the given string. */
int RestoreReadySpells (object oCreature, string sSpells);

/* Get a string containing all remaining spell uses for oCreature. */
string GetAllMemorizedSpells (object oCreature);

string GetRawQuickBarSlot (object oPC, int nSlot);


These functions involve strings, but the format of the strings are never explained. A simple explanation in the documentation for each function would do wonders for the usability of the functions.

Code:
/* Sets the value of Lootable for a PC in the range 0-127. */
int SetPCLootable (object oPC, int nLootable);

/* Gets the value of BodyBag for a PC. */
int GetPCBodyBag (object oPC);

/* Sets the value of BodyBag for a PC in the range 0-127. */
int SetPCBodyBag (object oPC, int nBodyBag);


Functions such as these really need an explanation of what the values of 0-127 mean, or at least a mention of what 2da they are found in, what set of constants to use, or whatever. As this is, it tells people nothing about what this is doing.

There is also a bug, I have been able to crash my server with the following code:

Code:
RestoreReadySpells(oCaster, "*");
RestoreReadySpells(oCaster, "#");
RestoreReadySpells(oCaster, "%");
RestoreReadySpells(oCaster, " ");
RestoreReadySpells(oCaster, "");


One of these locked up the server, I assuming that it went into an endless loop. I decided to try those strings after skimming though the C source for that function, because the documentation didn't explain the string.
Back to top
View user's profile Send private message Visit poster's website
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Wed Mar 25, 2009 5:38    Post subject: Reply with quote

Calan wrote:
As I start working with this system, I have found what is to me a pretty serious issue, and a bug.

As with almost every other function, this returns a value even though it's a "Set" function, which is fine, but it is not documented what is returned. This doesn't make the function useless, obviously, but the return value is useless because no one knows what it means.


Acaos is pretty busy right now, as we're migrating our servers to a new host, so I'll answer briefly for him. I occasionally complain to him about this or that documentation being incomplete (he hates doccing), but in most cases you can figure it out. In this case, it'd take you 5 minutes tops to figure out whether it's the new total, which would be my assumption, since anything else would be useless for debug, which is the obvious use of a Set that returns anything. Hardly useless. Actually, I'm nearly positive that's what it does, since I seem to recall using sets with an add of 0 to get base value in some script or another.
Quote:

As with every other function, the documentation that -is- there is commented out using /* and */ rather than //, which means that the documentation isn't available in the development environment. This is a simple change that would help greatly. Of course I can edit this on my end, but that doesn't help other potential users and I think it would make the system far more usable for everyone.

His autoformatter does that, much to my chagrin (I've also complained about it in our mod's includes). Again, however, all you have to do is reformat them yourself if you want them to pull up in the help window. Frankly, I'd rather you spend that time than he, since he can spend it making other functions, among other things. Would also not take long in a text editor.
Quote:

Code:
/* Get a string containing all remaining feat uses for oCreature. */
string GetAllRemainingFeatUses (object oCreature);

/* Restore the remaining feat uses for oCreature from the given string. */
int RestoreReadyFeats (object oCreature, string sFeats);

/* Restore the remaining spell uses for oCreature from the given string. */
int RestoreReadySpells (object oCreature, string sSpells);

/* Get a string containing all remaining spell uses for oCreature. */
string GetAllMemorizedSpells (object oCreature);

string GetRawQuickBarSlot (object oPC, int nSlot);


These functions involve strings, but the format of the strings are never explained. A simple explanation in the documentation for each function would do wonders for the usability of the functions.

Have to agree with you there. Razz
Quote:

Code:
/* Sets the value of Lootable for a PC in the range 0-127. */
int SetPCLootable (object oPC, int nLootable);

/* Gets the value of BodyBag for a PC. */
int GetPCBodyBag (object oPC);

/* Sets the value of BodyBag for a PC in the range 0-127. */
int SetPCBodyBag (object oPC, int nBodyBag);


Functions such as these really need an explanation of what the values of 0-127 mean, or at least a mention of what 2da they are found in, what set of constants to use, or whatever. As this is, it tells people nothing about what this is doing.

Actually, it tells you EVERYTHING about what it's doing. Those fields aren't used in the engine (by PCs). You would only set them if you were using them to store other data, as we do. Ditto tag, though some people write scripts with the assumption that pc tag will be blank, which is otherwise is.

Funky
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5, 6 ... 9, 10, 11  Next
Page 5 of 11

 
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