View previous topic :: View next topic |
Author |
Message |
xorbaxian
Joined: 18 Dec 2007 Posts: 45
|
Posted: Fri Jul 21, 2017 23:16 Post subject: nwnx_structs woes, help needed |
|
|
greetings,
i'm running nwniab on windows xp. so far, everything under nwnx-lin has run fine this way, right out of the box. however, i'm getting some strange issues w/the nwnx_structs plugin.
i'm interested in using the 'GetEffectInteger()' function. unfortunately, the function isn't returning anything.
here's a snippet of my neverscript driver program -
Code: | SendMessageToPC(GetFirstPC(), "EFFECT INTEGERS:");
int n = GetEffectNumIntegers(eff);
int i;
for (i = 0; i < n; i++)
SendMessageToPC(GetFirstPC(), " " + IntToString(i) + ": " + IntToString(GetEffectInteger(eff, i)));
|
what i get on the screen is -
i.e., nothing at all. i thought maybe the plugin supplied w/nwniab might be backdated, so i got what i think is the newest release, from http://dl.hgweb.org/nwnx/nwnx_structs-2.1.tar.gz. i installed it in my nwniab and nwnx seems to run fine w/it, but i'm still having the same problem.
here's what the nwnx2 log file shows me -
Code: | NWN Extender v2.7.1-dev
--------------------------------
SQLITE plugin registered.
Address: B72CE600
SPELLS plugin registered.
Address: B72C4584
HASHSET plugin registered.
Address: B6140580
ODBC plugin registered.
Address: B6130160
EVENTS plugin registered.
Address: B5EEA520
LETO plugin registered.
Address: B6125B20
CHAT plugin registered.
Address: B5E1B380
RESMAN plugin registered.
Address: B5E129A0
WEAPONS plugin registered.
Address: B5E09E8C
FIXES plugin registered.
Address: B5DF9B40
FUNCS plugin registered.
Address: B5DEE144
STRUCTS plugin registered.
Address: B5DDD3A0
FUNCSEXT plugin registered.
Address: B5DCFE0C
SYSTEM plugin registered.
Address: B5EDAE50
* NWNX2 activated.
name='oX3_Skin'
name='oX3_Skin'
name='AIIntruderObj'
name='HenchLastSpellTarget'
name='LastTarget'
name='NWNX!STRUCTS!GETNUMINTEGERS'
NWNX!INIT enforcement disabled, using 0x082041ec
* Library STRUCTS!GETNUMINTEGERS found: B5DDD3A0
name='NWNX!STRUCTS!GETNUMINTEGERS'
* Library STRUCTS!GETNUMINTEGERS found: B5DDD3A0
name='NWNX!STRUCTS!GETNUMINTEGERS'
* Library STRUCTS!GETNUMINTEGERS found: B5DDD3A0
name='NWNX!STRUCTS!GETNUMINTEGERS'
* Library STRUCTS!GETNUMINTEGERS found: B5DDD3A0
name='oX3_Skin'
|
...so it seems that the structs package is being loaded, and nwnx finds the plugin.
here's the contents of the nwnx_structs log file -
Code: | found struct hook at 0x0825e839
Request: "GETNUMINTEGERS"
Params: " "
Request: "GETNUMINTEGERS"
Params: " "
Request: "GETNUMINTEGERS"
Params: " "
Request: "GETNUMINTEGERS"
Params: " "
|
...so it seems like the plugin is being called correctly each time [there are 4 effects in the chain that i'm investigating] -- but what happens then? for whatever reason, the function call is returning 0.
can someone shed some light on this ? |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Sat Jul 22, 2017 18:59 Post subject: |
|
|
considering the feedback you got from sendmessage, try replace the getnumintegers by 9, it seems the problem is that the getnumintegers returns 0 (which should not happen of course...) _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
xorbaxian
Joined: 18 Dec 2007 Posts: 45
|
Posted: Sun Jul 23, 2017 20:28 Post subject: |
|
|
thanks for the quick reply, shadooow !
yes, that works -- for this particular test case. i'm wondering if there might be a case where simply reading several values this way could result in a read of an out-of-bounds memory location and crash the server. i've searched around for some documentation on the aurora effect structure and the 'CGameEffects' structure mentioned in the nwnx_structs.nss comments, couldn't find anything. what are your thoughts on this ? |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Sun Jul 23, 2017 20:57 Post subject: |
|
|
xorbaxian wrote: | thanks for the quick reply, shadooow !
yes, that works -- for this particular test case. i'm wondering if there might be a case where simply reading several values this way could result in a read of an out-of-bounds memory location and crash the server. i've searched around for some documentation on the aurora effect structure and the 'CGameEffects' structure mentioned in the nwnx_structs.nss comments, couldn't find anything. what are your thoughts on this ? |
Settings high th integer could cause this as we don't know if there is a limit. Possibly the same can be done if trying to read too high integer.
Cannot see why should this happen outside of this case though unless the plugin's way of doing this itself is wrong. (I was studying nwnx_structs for some time but went for completely different approach for my own plugin, safer one). _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
xorbaxian
Joined: 18 Dec 2007 Posts: 45
|
Posted: Mon Jul 24, 2017 23:18 Post subject: |
|
|
ShaDoOoW wrote: | (I was studying nwnx_structs for some time but went for completely different approach for my own plugin, safer one). | ah well now that sounds interesting. have you finished it ? is it usable ? |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Mon Jul 24, 2017 23:22 Post subject: |
|
|
xorbaxian wrote: | ShaDoOoW wrote: | (I was studying nwnx_structs for some time but went for completely different approach for my own plugin, safer one). | ah well now that sounds interesting. have you finished it ? is it usable ? |
yes, here, but its for windows only... _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
xorbaxian
Joined: 18 Dec 2007 Posts: 45
|
Posted: Tue Jul 25, 2017 20:52 Post subject: |
|
|
ah. well. in that case, kudos, and may your ongoing quest to vanquish the boojums of windoze meet w/continued success ! |
|
Back to top |
|
|
|