View previous topic :: View next topic |
Author |
Message |
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Fri Apr 23, 2010 17:38 Post subject: |
|
|
Baragg wrote: | K, mayhap I am a bit confused. I copy the dll into my NWN folder, compile the include into my test mod and bam the functions should work? I created a boulder with this in the onused:
Code: | #include "nwnx_funcs"
void main()
{
int iCount = NWNXFuncs_GetAreaCount();
SpeakString(IntToString(iCount), TALKVOLUME_SHOUT);
} |
There are 3 areas in the module but this shouts 0. |
Easy fix for that one: in nwnx_funcs.nss find NWNXFuncs_GetAreaCount - line 765.
In the Set/Get/DeleteLocalString calls replace GETTOTALAREAS with GETAREACOUNT.
Thanks for catching this. |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Fri Apr 23, 2010 21:16 Post subject: |
|
|
Think there's a problem with the GetFirstArea/GetNextArea functions. Using NWNXFuncs_GetFirstArea returns an invalid object.
Anyone else having this issue? |
|
Back to top |
|
|
Baragg
Joined: 22 Apr 2009 Posts: 6
|
Posted: Sat Apr 24, 2010 6:13 Post subject: |
|
|
MaxRock wrote: | Baragg wrote: | K, mayhap I am a bit confused. I copy the dll into my NWN folder, compile the include into my test mod and bam the functions should work? I created a boulder with this in the onused:
Code: | #include "nwnx_funcs"
void main()
{
int iCount = NWNXFuncs_GetAreaCount();
SpeakString(IntToString(iCount), TALKVOLUME_SHOUT);
} |
There are 3 areas in the module but this shouts 0. |
Easy fix for that one: in nwnx_funcs.nss find NWNXFuncs_GetAreaCount - line 765.
In the Set/Get/DeleteLocalString calls replace GETTOTALAREAS with GETAREACOUNT.
Thanks for catching this. |
It was on line 693 for me, this is what it looked like after the adjustment.
Code: |
int NWNXFuncs_GetAreaCount() {
object oObject = GetModule();
SetLocalString(oObject, "NWNX!FUNCS!GETAREACOUNT", "-");
int iRet = StringToInt(GetLocalString(oObject, "NWNX!FUNCS!GETAREACOUNT"));
DeleteLocalString(oObject, "NWNX!FUNCS!GETAREACOUNT");
return iRet; |
_________________ We are never so defensless against suffering, as when we Love.
Sigmund Freud |
|
Back to top |
|
|
Baragg
Joined: 22 Apr 2009 Posts: 6
|
Posted: Sat Apr 24, 2010 6:20 Post subject: |
|
|
Sorry, but this is still returning 0, is there some initialization in the module handles I am suppose to do? Could you maybe add a module to the downloads with this already in it? Please.
Code: |
#include "nwnx_funcs"
void main()
{
int iCount = NWNXFuncs_GetAreaCount();
SpeakString(IntToString(iCount), TALKVOLUME_SHOUT);
} |
This is after the above tweak to the include, and yes I did compile the include then the one script I have it in, lol. _________________ We are never so defensless against suffering, as when we Love.
Sigmund Freud |
|
Back to top |
|
|
Baragg
Joined: 22 Apr 2009 Posts: 6
|
Posted: Sat Apr 24, 2010 6:47 Post subject: |
|
|
Had a "DUH" moment. I wasn't running the module through the NWNX system. Sorry. _________________ We are never so defensless against suffering, as when we Love.
Sigmund Freud |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Sun Apr 25, 2010 18:27 Post subject: |
|
|
ArielT wrote: | ... Less importantly are gender and portrait Are these on your to do list? |
SetGender shouldn't be a problem. and I just realized Get/SetPortrait is already a nwn script function. |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Sun Apr 25, 2010 23:45 Post subject: v 0.0.62 |
|
|
Latest version is on the vault http://nwvault.ign.com/View.php?view=Other.Detail&id=1447
Code: |
v 0.0.62
Added:
GetQuickslot
SetQuickslot
UpdateQuickbarGUI
SetClassByPosition
SetGender
Fixed:
StringToObject which in return should fix GetFirst/GetNextArea, GetAreaByPosition.
StringToObject now looks for a local object variable on the module with the name "¬¬¬STRINGTOOBJECT¬¬¬". This is used for all functions returning objects.
Setting the local object is taken care of in NWNXFuncs_Init().
GetFirst/GetNextLocalVariable, GetLocalVarByPosition
Reserved more space for values returned by the plugin which hopefully prevents crashes.
Changed:
NWNXFuncs_Init
Sets the local object "¬¬¬STRINGTOOBJECT¬¬¬" to make StringToObject work reliably.
|
[/url] |
|
Back to top |
|
|
ArielT
Joined: 26 Jan 2010 Posts: 30
|
Posted: Mon Apr 26, 2010 9:06 Post subject: |
|
|
Win. I'll take some time to try to do the modifications sometime this week. |
|
Back to top |
|
|
ArielT
Joined: 26 Jan 2010 Posts: 30
|
Posted: Thu Apr 29, 2010 9:47 Post subject: |
|
|
At the risk of cluttering up this fine thread further: I see you've implemented the ability to modify the Creator, Spell ID and Remaining Duration for effects, would it be possible to get the ability to set and retrieve a variable from an effect? Really, all I care about are the integers as I'd like to pass CasterLevel of the effect creator along with the effect to handle through dispel checks and such. |
|
Back to top |
|
|
Sethan
Joined: 04 Oct 2008 Posts: 47
|
Posted: Fri Apr 30, 2010 15:11 Post subject: |
|
|
Awesome stuff here so far. |
|
Back to top |
|
|
Red
Joined: 14 Feb 2009 Posts: 21
|
Posted: Sat May 01, 2010 0:22 Post subject: |
|
|
Works as advertised. I can't thank you enough. |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Fri May 07, 2010 10:29 Post subject: |
|
|
Hey Maxrock, do you planning new version? What features we can look forward? Ty. _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Fri May 07, 2010 11:17 Post subject: |
|
|
ShaDoOoW wrote: | Hey Maxrock, do you planning new version? What features we can look forward? Ty. |
Nothing new really. Thanks to Zebranky , I've been mostly playing around trying to call "internal" nwn functions.
This is my changelog so far
Code: |
v 0.0.63
Changed:
Found out that GetLocalObject is hooked by nwnx as well
"¬¬¬STRINGTOOBJECT¬¬¬" is not used anymore and does not have to be initialized
Removed some unnecessary stuff I was playing around with from the source
Moved the header files to their own, separate folder
nwnx.ini
Last_Skill_Number option changed to Number_of_Skills. (Because it kept confusing me! and it's probably one of those things I'll keep stumbling over)
It needs to be set to the total number of skills available (i.e.: last skills.2da rowid +1)
Added nwn_GetWorldTime which makes it unnecessary to save a pointer to the module (was needed for GetEffectRemaininDuration; no more NWNXFuncs_Init) |
Of course, I'm always open to request. |
|
Back to top |
|
|
VirgiL
Joined: 02 Apr 2010 Posts: 16
|
Posted: Sat May 08, 2010 11:23 Post subject: |
|
|
when i am developing my module in windows and running it on linux server afterwards, i assume i would need the same plugin libraries but in linux version right?
is there already the linux version of this functions? |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Sat May 08, 2010 12:17 Post subject: |
|
|
yes, but there is problem, those functions in linux are named differently, so its not compatible --> could be good thing to start with MaxRock _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
|