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 
 
Decoding NWN memory - Part 2 - SetLocal* structures

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
isilweo



Joined: 29 Dec 2004
Posts: 22
Location: poland

PostPosted: Tue Feb 08, 2005 1:39    Post subject: Decoding NWN memory - Part 2 - SetLocal* structures Reply with quote

hello again all readers (if there are any ;)
This part will be about local variables - variables which you can store on object using SetLocal* functions (and read using GetLocal)
They're quite important thing cause in future versions of nwnx they'll be used to pass data to game from external source.
So basicly we have:
SetLocalInt
SetLocalString
SetLocalObject
SetLocalFloat
SetLocalLocation

SLocalVarsPtr:
int varsArrayPointer;
int varsNumber;

SLocalVarsArrayElement:
SNWNString VariableName; //4bytes cause of sizeof(SNWNString) - see part 1 - basics
int iVariableType;
int iVariableValue; //or pointer to structure

it's important to note that iVariableValue can be a value (ie when type is int, float) but also can be a pointer to another structure (ie strings, locations)

iVariableType can be:
1 - integer
2 - float
3 - string
4 - object
5 - location

1, 2 and 4 are simple types. that means in iVariableValue is theire value.
3 - string - pointer to SNWNString
5 - location - pointer to SNWNLocalVarLocation

SNWNLocalVarLocation:
float PositionX
float PositionY
float PositionZ
float OrientationX
float OrientationY
float OrientationZ
int AreaId

example (no comments - you can do it as your homework ;)
Code:

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F

07548640                                        88 A2 54 07               ˆ˘T.
07548650   07 00 00 00 03 00 00 00  88 99 54 07 10 A2 54 07   ........ˆ™T..˘T.
07548660   06 00 00 00 01 00 00 00  03 93 03 00 B8 99 54 07   .........“..¸™T.
07548670   08 00 00 00 02 00 00 00  58 FE 9D 3F 00 00 00 00   ........Xţť?....


SLocalVarsPtr offsets for diffrent object types
0x88 - modul
0x110 - area
0xD8 - plc
0xD8 - wp
0xD8 - items
0xD8 - encounters
0xD8 - shops
0xD8 - triggers
0xD8 - doors
note that there are no info on creatures here and there won't. maybe later when someone find how to get it using server's function

have a good night
isilweo
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Tue Feb 08, 2005 10:42    Post subject: Reply with quote

Thanks for the infos, isilweo, I am sure they will come in handy !
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lokey



Joined: 02 Jan 2005
Posts: 158

PostPosted: Fri Feb 11, 2005 5:05    Post subject: Reply with quote

Find it weird that local location is a position vector and orientation vector structure? Why wouldn't it be a position vector + facing angle(s)?

Stellar work!
_________________
Neversummer PW NWNx powered mayhem Wink
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
Page 1 of 1

 
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