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 
 
Functions: Get/SetBodypart() with 1.66
Goto page Previous  1, 2
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
knowj



Joined: 12 Aug 2005
Posts: 5

PostPosted: Fri Aug 12, 2005 21:44    Post subject: Reply with quote

cheers ill let you know how it goes Smile
Back to top
View user's profile Send private message
knowj



Joined: 12 Aug 2005
Posts: 5

PostPosted: Fri Aug 12, 2005 22:48    Post subject: Reply with quote

works fine now thanks.

its amazing how much iv learnt today just off problem solving. altho that was one problem i wouldnt have know how to solve.
Back to top
View user's profile Send private message
cieciwa



Joined: 09 Aug 2005
Posts: 33
Location: Cracov, Poland

PostPosted: Fri Nov 11, 2005 12:07    Post subject: Reply with quote

Papillon, can You update Linux NWNX?
Back to top
View user's profile Send private message Send e-mail
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Fri Nov 11, 2005 13:23    Post subject: Reply with quote

I offered to create the initial version some time ago but did nothing with the Linux version since then. Unfortunately, I do not have the resources (computers and time) to develop for Linux at the moment.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
cieciwa



Joined: 09 Aug 2005
Posts: 33
Location: Cracov, Poland

PostPosted: Fri Nov 11, 2005 13:58    Post subject: Reply with quote

Hmm,
I have small experience in programming, but I thing I can try ...Smile
Back to top
View user's profile Send private message Send e-mail
cieciwa



Joined: 09 Aug 2005
Posts: 33
Location: Cracov, Poland

PostPosted: Wed Nov 16, 2005 10:27    Post subject: Reply with quote

Vladiat0r wrote:
The source is part of the Linux NWNX2 download. I just updated the offset used only in Set/GetBodyPart and recompiled with Redhat Linux on i386: http://www.antiworld.biz/downloads/nwnx_functions.rar


Hmm, I changed offset in my NWNXFuncion.cpp file
from
Code:

void CNWNXFunction::SetBodyPart(char *value)
{
        int bpart,ptype;
        char *next;

        if (*(pGameObject+0x4) == 0x5) // object type creature
        {

to
Code:

void CNWNXFunction::SetBodyPart(char *value)
{
        int bpart,ptype;
        char *next;

        if (*(pGameObject+0x8) == 0x5) // object type creature
        {


but this still don't work.
I missed something ?
Back to top
View user's profile Send private message Send e-mail
Vladiat0r



Joined: 17 Jun 2005
Posts: 25

PostPosted: Wed Nov 16, 2005 16:58    Post subject: Reply with quote

that's not the part to change:
in SetBodyPart this is the only line to change:
Code:
sprintf(value,"%d",*(pGameObject+0x0c20+bpart));

and in GetBodyPart:
Code:
sprintf(value,"%d",*(pGameObject+0x0c20+bpart));


This should remain the same:
Code:
if (*(pGameObject+0x4) == 0x5) // object type creature
Back to top
View user's profile Send private message
cieciwa



Joined: 09 Aug 2005
Posts: 33
Location: Cracov, Poland

PostPosted: Wed Nov 16, 2005 20:02    Post subject: Reply with quote

Code:

void CNWNXFunction::GetBodyPart(char *value)
{
        int bpart;

        if (*(pGameObject+0x8) == 0x5) // object type creature
        {
                // parse "nPart"
                bpart = atoi(value);

                // bounds checking
                if(bpart<3 || bpart>29)
                        return;

                sprintf(value,"%d",*(pGameObject+0x0c2c+bpart));
        }

}


void CNWNXFunction::SetBodyPart(char *value)
{
        int bpart,ptype;
        char *next;

        if (*(pGameObject+0x8) == 0x5) // object type creature
        {
                // parse "nPart[!nType]"
                bpart = atoi(value);
                next= strchr(value,'!');
                ptype = next?atoi(next+1):0;

                // bounds checking
                if(bpart<3 || bpart>29)
                        return;
                if(ptype<0 || ptype>255)
                        return;

                *(pGameObject+0x0c2c+bpart) = (char)ptype;
        }

}


And this don't work.
Back to top
View user's profile Send private message Send e-mail
Vladiat0r



Joined: 17 Jun 2005
Posts: 25

PostPosted: Thu Nov 17, 2005 7:36    Post subject: Reply with quote

I supposed I wasn't clear enough--it should be:
Code:

void CNWNXFunction::GetBodyPart(char *value)
{
        int bpart;

        if (*(pGameObject+0x4) == 0x5) // object type creature
        {
                // parse "nPart"
                bpart = atoi(value);

                // bounds checking
                if(bpart<3 || bpart>29)
                        return;

                sprintf(value,"%d",*(pGameObject+0x0c20+bpart));
        }

}


void CNWNXFunction::SetBodyPart(char *value)
{
        int bpart,ptype;
        char *next;

        if (*(pGameObject+0x4) == 0x5) // object type creature
        {
                // parse "nPart[!nType]"
                bpart = atoi(value);
                next= strchr(value,'!');
                ptype = next?atoi(next+1):0;

                // bounds checking
                if(bpart<3 || bpart>29)
                        return;
                if(ptype<0 || ptype>255)
                        return;

                *(pGameObject+0x0c20+bpart) = (char)ptype;
        }

}
Back to top
View user's profile Send private message
cieciwa



Joined: 09 Aug 2005
Posts: 33
Location: Cracov, Poland

PostPosted: Fri Nov 18, 2005 0:14    Post subject: Reply with quote

Don't work - I don't know _WHY_ ...
Back to top
View user's profile Send private message Send e-mail
cieciwa



Joined: 09 Aug 2005
Posts: 33
Location: Cracov, Poland

PostPosted: Mon Nov 21, 2005 1:03    Post subject: Reply with quote

Thanx.
Found my mistake - working now.
Back to top
View user's profile Send private message Send e-mail
IronCrown



Joined: 12 Dec 2005
Posts: 5
Location: Canada

PostPosted: Mon Dec 12, 2005 19:31    Post subject: Reply with quote

I just started using nwnx and been playing with a few of the .dll modules. I dont have a database linked up for it yet. My server uses the bioware db at this point. Recently I tried the nwnx_functions and put together a system to change player heads and colors. QUESTION: I noticed after a relog the player changes are gone. Do i need an external database for persistance of these changes?
Confused
Back to top
View user's profile Send private message
IronCrown



Joined: 12 Dec 2005
Posts: 5
Location: Canada

PostPosted: Tue Dec 13, 2005 6:09    Post subject: Reply with quote

I'll post my question in a new thread.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 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