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 
 
Beta plugin: nwnx_funcs
Goto page Previous  1, 2, 3 ... 9, 10, 11
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
orth



Joined: 10 Apr 2005
Posts: 12

PostPosted: Mon Mar 30, 2015 4:22    Post subject: Reply with quote

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
View user's profile Send private message
xorbaxian



Joined: 18 Dec 2007
Posts: 44

PostPosted: Thu Sep 07, 2017 20:17    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3 ... 9, 10, 11
Page 11 of 11

 
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