View previous topic :: View next topic |
Author |
Message |
orth
Joined: 10 Apr 2005 Posts: 12
|
Posted: Mon Mar 30, 2015 4:22 Post subject: |
|
|
kucik wrote: | Hey. I've tried to dump all variables on modul simply by:
Code: | void __dumpModuleVariables() {
object oItem = GetModule();
WriteTimestampedLogEntry("************ Dump Module variables ************");
int cnt = GetLocalVariableCount(oItem);
int i;
struct LocalVariable lv;
WriteTimestampedLogEntry("************ Total "+IntToString(cnt)+" variables************");
for(i=0;i<cnt;i++) {
lv = GetLocalVariableByPosition(oItem,i);
WriteTimestampedLogEntry("* "+lv.name+" ("+IntToString(lv.type)+")");
}
WriteTimestampedLogEntry("************ Dump Module variables end *********");
} |
But i get 250872632 from GetLocalVariableCount() which i dont believe is correct and then server crashes in atempt to read them one by one.
Im using last nwnx changeset (03874980cd045f766bcda06e29219c75d0a96d15) from github. |
I too had problems with this. There seems to be some oddness that I can't quite figure out. Sometimes the module object has 28 more bytes (like for example when I use the areas functions) before the mod_vartable and I can't figure out why.
Anyway, all I wanted was to get a list of mod vars so I could clean up some and move some. I got it to work by editing my includes/structs/CNWSModule.h to this:
Code: |
struct CNWSModule_s {
uint32_t field_00;
uint32_t field_04;
uint32_t field_08;
uint32_t field_0C;
uint32_t field_10;
uint32_t field_14;
uint32_t field_18;
uint32_t field_1C;
uint32_t field_20;
uint32_t field_24;
uint32_t field_28;
uint32_t field_2C;
uint32_t field_30;
uint32_t field_34;
nwn_objid_t *mod_areas;
uint32_t mod_areas_len;
uint32_t field_40;
uint32_t field_44;
uint32_t field_48;
uint32_t field_4C;
uint32_t field_50;
uint32_t field_54;
uint32_t field_58;
uint32_t field_5C;
uint32_t field_60;
uint32_t field_64;
uint32_t field_68;
uint32_t field_6C;
uint32_t field_70;
uint32_t field_74;
uint32_t field_78;
uint32_t field_7C;
uint32_t field_80;
uint32_t field_84;
uint32_t field_88;
CNWSScriptVarTable mod_vartable;
};
|
Note the mod_vartable being at 0x8C instead of 0xA8. It hasn't appeared to break anything else. Not sure if it will work for you though. |
|
Back to top |
|
|
xorbaxian
Joined: 18 Dec 2007 Posts: 45
|
Posted: Thu Sep 07, 2017 20:17 Post subject: |
|
|
two new functions added :
GetNormalAppearance - return a creature's true appearance id, whether shape-shifted or not.
GetNormalRace - return a creature's true racial type id, whether shape-shifted or not.
p/r issued. |
|
Back to top |
|
|
|
|
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
|