View previous topic :: View next topic |
Author |
Message |
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Sun Jan 01, 2012 20:26 Post subject: |
|
|
MaxRock wrote: | No, 3 should be enough.
There should be a "- ObjReq: XXXXXXXX Request: GETFIRSTAREA"
followed by "GetAreaByPos(x)" in there somewhere... uhm. Looks like that function is never actually called.
I assume it was working before?
|
I'm actually converting some Linux code over to Windows. It worked on Linux but doesn't on Windows. I tried changing my code up a bit, to base it on the index of areas rather than GetFirst/GetNext Area but I ended up with the same results. Getting the area count does work though.
Quote: |
Edit
Does anything else in OnModuleLoad work?
With a little testing I noticed my onload script isn't run at all (using resman; with and without nwnx_funcs.dll) |
I don't have the resman plugin so I don't think that's my problem.
The other stuff OnModuleLoad does work though - I do a lot of database calls and they're all firing properly. Even the code I posted fires, but the area returned is invalid.
Quote: |
Edit2
Guess timing is important. I renamed nwnx_resman to nwnx_areasman - so that it gets loaded before any other plugins - and the onload script runs now, including GetFirstNextArea. |
I have the following plugins. Would any of them cause a conflict?
nwnx_chat
nwnx_events
nwnx_fixes
nwnx_funcs
nwnx_hashset
nwnx_leto
nwnx_odbc
nwnx_profiler
nwnx_resetplugin
nwnx_TMI
Thanks again for your help. |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Tue Jan 03, 2012 18:57 Post subject: |
|
|
v 0.0.92
Code: |
Added:
SetNoRestFlag
GetNoRestFlag
Sets/Gets whether players can rest in an area
GetTimeOfDay
Returns whether it's day, night, dusk or dawn
Changed:
nwnx_funcs.nss
GetSurfaceMaterial passes the area id to the plugin now instead of the area object. Be sure to use the new nwnx_funcs.nss include
NWNX.INI
HOOK_TimeOfDayChange=1
If set to 1 the server will run the script defined in OnTimeOfDayChangeScript when the server time changes to day, night dusk and dawn
OnTimeOfDayChangeScript=mod_timechanged
Manual
changed to CHM format (still working on usability)
Added manual entries for
NWNXFuncs_SetVisibilityOverride
NWNXFuncs_SetVisibility
NWNXFuncs_GetVisibilityOverride
NWNXFuncs_GetVisibility
NWNXFuncs_GetRegeneration
NWNXFuncs_ImmunityOverride
NWNXFuncs_SetImmunityOverride
NWNXFuncs_RemoveAllImmunityOverrides
NWNXFuncs_AddImmunityOverride
NWNXFuncs_RemoveImmunityOverride
NWNXFuncs_GetAutoRemoveKeyFlag
NWNXFuncs_SetAutoRemoveKeyFlag
NWNXFuncs_GetDestinationTag
NWNXFuncs_SetDestinationTag
NWNXFuncs_GetNoRestFlag
NWNXFuncs_SetNoRestFlag
NWNXFuncs_GetTimeOfDay
|
|
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Tue Jan 03, 2012 19:00 Post subject: |
|
|
Zunath wrote: | I've got your latest version (0.0.91) and can't seem to get NWNXFuncs_GetFirstArea and NWNXFuncs_GetNextArea to work on module load. I've got it calling after the SQLInit() call but the area it returns for NWNXFuncs_GetFirstArea is not valid.
.
.
.
|
Does it work outside onModuleLoad? e.g.: if you run a script as DM:
Code: |
void main() {
SpeakString(GetName(NWNXFuncs_GetFirstArea()));
}
|
|
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Wed Jan 04, 2012 4:30 Post subject: |
|
|
I ran it on a placeable but had the same results. I really have no idea what's going on here. All of the other functions I've used work for me though - except this one.
Just for reference, here's the script I'm using to test.
Code: |
#include "nwnx_funcs_w"
void main()
{
object oPC = GetLastUsedBy();
object oArea = NWNXFuncs_GetFirstArea();
SpeakString("Area = " + GetName(oArea));
while(GetIsObjectValid(oArea))
{
SpeakString("Area = " + GetName(oArea));
oArea = NWNXFuncs_GetNextArea();
}
}
|
Same results as before: Invalid area and subsequently, no area name is displayed.
Anything else you know I could try? Has anyone else had this problem? |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Wed Jan 04, 2012 4:56 Post subject: |
|
|
Code: |
void main() {
object oArea = GetLocalObject(OBJECT_SELF, "NWNX!FUNCS!GETFIRSTAREA");
WriteTimestampedLogEntry(GetName(oArea));
}
|
That should at least make something show up in the nwnx_funcs log file; e.g.:
Code: |
[01/03/2012 20:49:13] - ObjReq: 07E28384 Request: GETFIRSTAREA
|
Oh, check (post) the nwnx.txt log, too. |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Wed Jan 04, 2012 6:05 Post subject: |
|
|
nwnx_funcs.txt
Quote: |
[01/03/2012 22:58:08] Windows NWNX Funcs plugin v.0.0.9.2
[01/03/2012 22:58:08] log level: 3
[01/03/2012 22:58:08] * CreateNewGeometry hooked
[01/03/2012 22:58:08] * CustomEffect function hooked
[01/03/2012 22:58:08] * CNWVirtualMachineCommands__ExecuteCommandGetItemPropertyType hooked
[01/03/2012 22:58:08] * CNWVirtualMachineCommands__ExecuteCommandItemPropertyEffect hooked
[01/03/2012 22:58:08] * CNWSMessage__TestObjectVisible hooked
[01/03/2012 22:58:08] * CNWSCreatureStats__GetEffectImmunity hooked
[01/03/2012 22:58:08] * CServerExoAppInternal__RemovePCFromWorld hooked; script to run: rotd_mod_leavin.nss
[01/03/2012 22:58:08] * CNWSModule__UpdateTime hooked; script to run:
[01/03/2012 22:58:15] - StrReq: "GETAREACOUNT" Params: "-"
[01/03/2012 22:58:16] - StrReq: "SETSAVINGTHROWBONUS" Params: "1 0 0"
[01/03/2012 22:58:16] o SavingThrowBonus: Save=1, Value=0, bAdd=
[01/03/2012 22:58:16] - StrReq: "SETSAVINGTHROWBONUS" Params: "2 0 0"
[01/03/2012 22:58:16] o SavingThrowBonus: Save=2, Value=0, bAdd=
[01/03/2012 22:58:16] - StrReq: "SETSAVINGTHROWBONUS" Params: "3 0 0"
[01/03/2012 22:58:16] o SavingThrowBonus: Save=3, Value=0, bAdd=
[01/03/2012 22:58:16] - StrReq: "SETBABOVERRIDE" Params: "1 0"
[01/03/2012 23:00:19] o CServerExoAppInternal__RemovePCFromWorldHOOK running
[01/03/2012 23:03:20] - StrReq: "SETSAVINGTHROWBONUS" Params: "1 0 0"
[01/03/2012 23:03:20] o SavingThrowBonus: Save=1, Value=0, bAdd=
[01/03/2012 23:03:20] - StrReq: "SETSAVINGTHROWBONUS" Params: "2 0 0"
[01/03/2012 23:03:20] o SavingThrowBonus: Save=2, Value=0, bAdd=
[01/03/2012 23:03:20] - StrReq: "SETSAVINGTHROWBONUS" Params: "3 0 0"
[01/03/2012 23:03:20] o SavingThrowBonus: Save=3, Value=0, bAdd=
[01/03/2012 23:03:20] - StrReq: "SETBABOVERRIDE" Params: "1 0"
|
nwnx.txt
Quote: |
NWN Extender V.2.6.1
(c) 2005 by Ingmar Stieger (Papillon) and Jeroen Broekhuizen
visit us at http://www.nwnx.org
* Loading plugins...
* Plugin chat is loaded.
* Plugin events is loaded.
* Plugin fixes is loaded.
* Plugin funcs is loaded.
* Plugin hashset is loaded.
* An error occured during OnCreate of leto
* Plugin odbc is loaded.
* Plugin profiler is loaded.
* Plugin resetplugin is loaded.
* Plugin TMI is loaded.
* NWNX2 activated.
|
I'm going to try removing the leto plugin since it apparently has errors. I'll let you know if it works. And thanks again for helping me out on this.
EDIT: No luck, I removed the letoscript.dll but same results. |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Wed Jan 04, 2012 13:20 Post subject: |
|
|
It seems to completely ignore the GetLocalObject hook.
Does NWNXFuncs_StringToObject work? |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Wed Jan 04, 2012 20:23 Post subject: |
|
|
Code: | #include "nwnx_funcs_w"
void main()
{
object oPC = GetLastUsedBy();
string sObject = ObjectToString(OBJECT_SELF);
object oObject = NWNXFuncs_StringToObject(sObject);
SendMessageToPC(oPC, "Object Name: " + GetName(oObject));
}
} |
nwnx_funcs.txt
Quote: |
[01/04/2012 13:16:46] Windows NWNX Funcs plugin v.0.0.9.2
[01/04/2012 13:16:46] log level: 3
[01/04/2012 13:16:46] * CreateNewGeometry hooked
[01/04/2012 13:16:46] * CustomEffect function hooked
[01/04/2012 13:16:46] * CNWVirtualMachineCommands__ExecuteCommandGetItemPropertyType hooked
[01/04/2012 13:16:46] * CNWVirtualMachineCommands__ExecuteCommandItemPropertyEffect hooked
[01/04/2012 13:16:46] * CNWSMessage__TestObjectVisible hooked
[01/04/2012 13:16:46] * CNWSCreatureStats__GetEffectImmunity hooked
[01/04/2012 13:16:46] * CServerExoAppInternal__RemovePCFromWorld hooked; script to run: rotd_mod_leavin.nss
[01/04/2012 13:16:46] * CNWSModule__UpdateTime hooked; script to run:
[01/04/2012 13:16:53] - StrReq: "GETAREACOUNT" Params: "-"
[01/04/2012 13:17:33] - StrReq: "SETSAVINGTHROWBONUS" Params: "1 0 0"
[01/04/2012 13:17:33] o SavingThrowBonus: Save=1, Value=0, bAdd=
[01/04/2012 13:17:33] - StrReq: "SETSAVINGTHROWBONUS" Params: "2 0 0"
[01/04/2012 13:17:33] o SavingThrowBonus: Save=2, Value=0, bAdd=
[01/04/2012 13:17:33] - StrReq: "SETSAVINGTHROWBONUS" Params: "3 0 0"
[01/04/2012 13:17:33] o SavingThrowBonus: Save=3, Value=0, bAdd=
[01/04/2012 13:17:33] - StrReq: "SETBABOVERRIDE" Params: "1 0"
|
nwnx.txt
Quote: |
NWN Extender V.2.6.1
(c) 2005 by Ingmar Stieger (Papillon) and Jeroen Broekhuizen
visit us at http://www.nwnx.org
* Loading plugins...
* Plugin chat is loaded.
* Plugin events is loaded.
* Plugin fixes is loaded.
* Plugin funcs is loaded.
* Plugin hashset is loaded.
* An error occured during OnCreate of leto
* Plugin odbc is loaded.
* Plugin profiler is loaded.
* Plugin resetplugin is loaded.
* Plugin TMI is loaded.
* NWNX2 activated.
|
Are you able to reproduce this? Or is it just me? |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Wed Jan 04, 2012 23:30 Post subject: |
|
|
Looks like none of the object requests are working.
I wonder if that is the problem
Quote: |
NWN Extender V.2.6.1
(c) 2005 by Ingmar Stieger (Papillon) and Jeroen Broekhuizen
visit us at http://www.nwnx.org
|
I'm using version 2.7-beta4
Edit:
Yup, 2.6.1 doesn't have the GetLocalObject hook |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Wed Jan 04, 2012 23:38 Post subject: |
|
|
Oh, that's odd. I have no idea how I got the older version. I'll try it out and let you know.
Thanks again for all your help.
EDIT: You were right! Nice catch there, it's working perfectly now. Thanks again |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Thu Jan 26, 2012 16:27 Post subject: v 0.0.93 |
|
|
Added:
PopupMessage
GetAttackModifierVersus |
|
Back to top |
|
|
silvercloud
Joined: 07 Jan 2005 Posts: 3
|
Posted: Thu Feb 09, 2012 12:33 Post subject: |
|
|
I'm trying to uses nwnx_funcs with the PRC, but it keeps crashing. Nay ideas what is causing it?
Here's the log from nwnx_funcs:
Quote: | [02/09/2012 11:27:53] Windows NWNX Funcs plugin v.0.0.9.3
[02/09/2012 11:27:53] log level: 3
[02/09/2012 11:27:53] * CreateNewGeometry hooked
[02/09/2012 11:27:53] * CustomEffect function hooked
[02/09/2012 11:27:53] * CNWVirtualMachineCommands__ExecuteCommandGetItemPropertyType hooked
[02/09/2012 11:27:53] * CNWVirtualMachineCommands__ExecuteCommandItemPropertyEffect hooked
[02/09/2012 11:27:53] * CNWSMessage__TestObjectVisible hooked
[02/09/2012 11:27:53] * CNWSCreatureStats__GetEffectImmunity hooked
[02/09/2012 11:27:53] * CServerExoAppInternal__RemovePCFromWorld hooked; script to run: onplayerleaving.nss
[02/09/2012 11:28:41] ImmunityOverride: 0 a2: 22 [override: 0]
[02/09/2012 11:28:46] - StrReq: "GETHASLOCALVARIABLE" Params: "PRC_TEST_NWNX_FUNCS 0" |
and nwnwx.log
Quote: | NWN Extender V.2.7-beta4
(c) 2004 by Ingmar Stieger (Papillon) and Jeroen Broekhuizen
(c) 2007-2008 by virusman
visit us at http://www.nwnx.org
* Loading plugins...
* Plugin fixes is loaded.
* Plugin funcs is loaded.
* Plugin leto is loaded.
* Plugin odbc is loaded.
* Plugin tmi is loaded.
* NWNX2 activated.
* Function not specified.* NWNX2 shutting down...
* NWNX2 shutdown successfull.
|
|
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Fri Feb 10, 2012 9:50 Post subject: |
|
|
Does calling GetHasLocalVariable crash it? |
|
Back to top |
|
|
silvercloud
Joined: 07 Jan 2005 Posts: 3
|
Posted: Sat Feb 11, 2012 11:09 Post subject: |
|
|
yes looks like it does... |
|
Back to top |
|
|
werehound
Joined: 17 Aug 2010 Posts: 41
|
Posted: Sat Feb 18, 2012 23:19 Post subject: |
|
|
Function
Code: | // changes the SpellID (returned by GetEffectSpellID or GetEffectSpellIDInternal) of the last effect applied
// on oObject to iSpellID. If the last effect applied used EffectLinkEffects(...) this will affect
// all the effects linked together.
void NWNXFuncs_SetLastEffectSpellID(object oObject, int iSpellID); |
Has no defined body? Cannot use it? |
|
Back to top |
|
|
|