View previous topic :: View next topic |
Author |
Message |
isilweo
Joined: 29 Dec 2004 Posts: 22 Location: poland
|
Posted: Tue Feb 08, 2005 1:39 Post subject: Decoding NWN memory - Part 2 - SetLocal* structures |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Tue Feb 08, 2005 10:42 Post subject: |
|
|
Thanks for the infos, isilweo, I am sure they will come in handy ! _________________ Papillon |
|
Back to top |
|
|
Lokey
Joined: 02 Jan 2005 Posts: 158
|
Posted: Fri Feb 11, 2005 5:05 Post subject: |
|
|
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 |
|
Back to top |
|
|
|