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 Functions.dll Merger
Goto page 1, 2  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Dazzle



Joined: 29 Dec 2004
Posts: 19

PostPosted: Wed Dec 29, 2004 1:28    Post subject: NWNX Functions.dll Merger Reply with quote

Just a custom functions.dll I once compiled for my own use.

Contents:
void NWNX_SetGoldPieceValue(object oObject, int iValue);
void NWNX_SetTag(object oObject, string sValue);
string NWNX_GetDescription(object oObject);
void NWNX_SetDescription_(object oObject, string sValue);
void NWNX_SetName(object oObject, string sValue);
int NWNX_GetBodyPart(object oPlayer, int nPart);
void NWNX_SetBodyPart(object oPlayer, int nPart, int nType);

Credits go out to Isilweo for the SetName and SetDescription and the NWNX Team for the other functions.

These functions only work with the Windows version of NWNX. It has not been tested on Linux.

Download here.

The rar file includes the .dll and an .erf with the functions. The include file with the functions isn't heavily commented, if you have any questions you can send me a PM or ask them here.

Edit, can't find the source code anymore, bugger.


Last edited by Dazzle on Thu Apr 21, 2005 9:55; edited 1 time in total
Back to top
View user's profile Send private message
Makzimia De Graf



Joined: 31 Dec 2004
Posts: 55
Location: San Diego CA.

PostPosted: Fri Dec 31, 2004 15:13    Post subject: Reply with quote

Nice functions Dazzle Smile hmmm custom items with name does that mean?
_________________
Makzimia De Graf

DM/Creator Island of Fredian
fredian.game-host.org:5123
Forums at http://castille.us/fredian/Forums
Back to top
View user's profile Send private message
isilweo



Joined: 29 Dec 2004
Posts: 22
Location: poland

PostPosted: Mon Jan 03, 2005 14:57    Post subject: Reply with quote

hello.
If you wait few days i'll publish somewhere new version of my functions cause i'm rewriting it from scratch. There's now corrected version of GetDescription and GetName. It reads description from tlk if there's StrRef description instead of normal one.
Probably you wonder why i've made GetName function if there's one in nwscript already. My function supports getting name for different languages. It's quite useful if you have mixed names.
----
Ie. you've imported area to your module but this area was in english. So you've translated all names (descriptions also) into your native language (polish in my case). What happens now is that if you play game (using polish client) you see everything in polish language but if you use GetName from nwscript it returns english name)
----
Of course GetDescription also supports different languages. There are few other hepfull functions.
GetAppearanceString - it returns item's appearance in one string (52 chars), and of course SetAppearanceString
Get/Set ResRef.
Set/GetLocalVars and many others that are already in nwscript but i thought they could be usefull in external dll.

here's a list direct from source of what's already done. stay tuned.
isilweo

struct CExoLocStringList;
struct CExoLocString;
struct CPreExoLocString;
//podstawowe uzywane przez funkcje konkretne
char GetByte(int iOffset);
void SetByte(int iOffset, char cToSet);
int GetInt(int iOffset);
void SetInt(int iOffset, int iToSet);
float GetFloat(int iOffset);
void SetFloat(int iOffset, float fToSet);
unsigned short GetShort(int iOffset);
void SetShort(int iOffset, unsigned short sToSet);
bool IsItem();
bool IsPlaceable();
void SetNWNString(char * value, int iOffset);
char * GetCExoLocString(int iOffset);

//funkcje konkretne (ciekawe dlaczego tak kretynsko je nazwalem)
char GetLeather1Color();
char GetLeather2Color();
char GetCloth1Color();
char GetCloth2Color();
char GetMetal1Color();
char GetMetal2Color();
void SetLeather1Color(char cColor);
void SetLeather2Color(char cColor);
void SetCloth1Color(char cColor);
void SetCloth2Color(char cColor);
void SetMetal1Color(char cColor);
void SetMetal2Color(char cColor);

int GetBaseType();
void SetBaseType(int i);
char GetObjectType();
void SetObjectType(char typ); //probably will crash your game, but may become useful one day

char * GetTag();
void SetTag(char * tag);

char * GetResRef();
void SetResRef(char * resref);

float GetXPosition();
float GetYPosition();
float GetZPosition();
float GetXOrientation();
float GetYOrientation();
void SetXPosition(float pos);
void SetYPosition(float pos);
void SetZPosition(float pos);
void SetXOrientation(float orient);
void SetYOrientation(float orient);

char GetPlot();
void SetPlot(char flag);

//GetLocalVars zostawiam na pozniej

char GetIdentified();
void SetIdentified(char flag);

char GetCharges();
void SetCharges(char charges);

int GetCost();
int GetAddcost();
void SetCost(int cost);
void SetAddcost(int cost);

char GetModelPart();
void SetModelPart(char model);

unsigned int GetDescriptionIdentifiedStrRef();
unsigned int GetDescriptionUnIdentifiedStrRef();
char * GetDescriptionIdentified();
char * GetDescriptionUnIdentified();
void SetDescriptionIdentified(char * desc);
void SetDescriptionUnIdentified(char * desc);
void SetDescriptionIdentifiedStrRef(int desc);
void SetDescriptionUnIdentifiedStrRef(int desc);

char * GetName();
unsigned int GetNameStrRef();
void SetName(char * name);
void SetNameStrRef(int name);

char GetCursed();
void SetCursed(char flag);

unsigned short GetStackSize();
void SetStackSize(unsigned short stk);

char GetStolen();
void SetStolen(char flag);

void GetAppearance(char*value);
void SetAppearance(char*value);

void SetMapNote(char * value);
void GetMapNote(char * value);

void GetLocalVars(char * value);
void GetExoLocString(char * value,int iOffset, int iLang=255);

struct CNWNItem;
struct CModelColors;
struct CPosition;
struct CLocalVars;
Back to top
View user's profile Send private message
Senalaya



Joined: 29 Dec 2004
Posts: 82
Location: Germany

PostPosted: Mon Jan 03, 2005 15:48    Post subject: Reply with quote

isilweo,

that looks awsome!

One little question, tough: I asume, that many of those functions require a recreations (ie. CopyObject()) to make the modifications visible/effective for the players in-game?
Back to top
View user's profile Send private message
Acrodania



Joined: 02 Jan 2005
Posts: 208

PostPosted: Wed Jan 05, 2005 4:35    Post subject: Reply with quote

These are great! Too bad SetName and SetDescription doesn't work on creatures, otherwise I would only need one sample creature in my mod! It is wonderful for things like the Name placard on PC's houses and such, simple database call and everything is properly labelled!

But did I see a new function SetZPosition?!?!?!?! I think I'm in heaven! Bet it doesn't work on creatures though, or does it?
Back to top
View user's profile Send private message
Trelantris



Joined: 08 Jan 2005
Posts: 9

PostPosted: Sat Jan 08, 2005 23:14    Post subject: Reply with quote

Does this not work on creatures? I would think they would just be considered objects, as well as placeables, and items. I can't wait to dig into this, it's awesome. I gotta go test out what is fully capable with some of these functions....
Back to top
View user's profile Send private message
Acrodania



Joined: 02 Jan 2005
Posts: 208

PostPosted: Sun Jan 09, 2005 7:37    Post subject: Reply with quote

I thought (hoped) so too, but have been unsuccessful in making them work. And yes, I spawned them elsewhere, delayed the functions, and them jumped them to the location needed after enough delay for the command to work. No errors were reported in either the spawn, the description or the logs.....

I did find a minor bug in the SetDescription() function also. When altering an item with this function you HAVE to alter the default description when identified/not identified. With a placeable you also have to set a custom description.

If you leave the normal "This is one of the unusual items" thing it will not set the description. If you put in a custom description it sets it correctly.

Just something to watch Confused
Back to top
View user's profile Send private message
Trelantris



Joined: 08 Jan 2005
Posts: 9

PostPosted: Sun Jan 09, 2005 20:50    Post subject: Reply with quote

Where, where, where did u get it? (oooooo wanna play!)
Back to top
View user's profile Send private message
Acrodania



Joined: 02 Jan 2005
Posts: 208

PostPosted: Thu Jan 20, 2005 5:46    Post subject: Reply with quote

So Isilweo,

How is the new function plugin coming along? Inquiring minds.......

Very Happy
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Mar 14, 2005 18:55    Post subject: Reply with quote

bump !

anyone has news about it ?
Back to top
PWMONSTER



Joined: 29 Mar 2005
Posts: 1

PostPosted: Tue Mar 29, 2005 10:56    Post subject: GetOutsideTime(); Reply with quote

I want the plug-in to which the time of the reality (time outside the game) can
be displayed.

I want to change service according to time that the student, the housewife, and
the company employee play.

Is it difficult?
Back to top
View user's profile Send private message
NoMercy



Joined: 03 Jan 2005
Posts: 123
Location: UK

PostPosted: Tue Mar 29, 2005 12:25    Post subject: Reply with quote

If your running MySQL, you can
Code:
SELECT CURRENT_TIMESTAMP();

And you'll have a 1 row, 1 column table, containing the current time-date returned in the standard MySQL format: 2005-03-29 11:23:21. but I can see why it would be nice to have a seperate plugin to do it.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Tue Mar 29, 2005 15:33    Post subject: Re: GetOutsideTime(); Reply with quote

PWMONSTER wrote:
I want the plug-in to which the time of the reality (time outside the game) can
be displayed.

I want to change service according to time that the student, the housewife, and
the company employee play.

Is it difficult?


I am currently writting a series about creating your custom plugin. You might want to follow that serie to learn how to make one yourself. If you don't know about C/C++ I also started writting a serie of tutorials about that on my website.
Back to top
View user's profile Send private message Visit poster's website
redils



Joined: 13 Jan 2005
Posts: 27

PostPosted: Tue Mar 29, 2005 17:04    Post subject: Reply with quote

Hi there ! All this stuff sounds great, but is it stable ? I know a nwnx plugin with SetName() function has already been released, but i remember it wasn't very stable. When, you use your SetName() function, is the name applied on all langages or just for english langage ?
Thx.
Back to top
View user's profile Send private message
redils



Joined: 13 Jan 2005
Posts: 27

PostPosted: Tue Mar 29, 2005 17:09    Post subject: Reply with quote

Dazzle : Could you include sources into your .rar plz ? In fact, i would like to port this functions to linux. Thx Smile
Back to top
View user's profile Send private message
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  Next
Page 1 of 2

 
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