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 
 
nwnx_funcs for windows
Goto page Previous  1, 2, 3, 4, 5 ... 27, 28, 29  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Fri Apr 23, 2010 17:38    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Zunath



Joined: 06 Jul 2006
Posts: 183

PostPosted: Fri Apr 23, 2010 21:16    Post subject: Reply with quote

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



Joined: 22 Apr 2009
Posts: 6

PostPosted: Sat Apr 24, 2010 6:13    Post subject: Reply with quote

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



Joined: 22 Apr 2009
Posts: 6

PostPosted: Sat Apr 24, 2010 6:20    Post subject: Reply with quote

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



Joined: 22 Apr 2009
Posts: 6

PostPosted: Sat Apr 24, 2010 6:47    Post subject: Reply with quote

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



Joined: 24 Jan 2008
Posts: 196

PostPosted: Sun Apr 25, 2010 18:27    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Sun Apr 25, 2010 23:45    Post subject: v 0.0.62 Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
ArielT



Joined: 26 Jan 2010
Posts: 30

PostPosted: Mon Apr 26, 2010 9:06    Post subject: Reply with quote

Win. I'll take some time to try to do the modifications sometime this week.
Back to top
View user's profile Send private message MSN Messenger
ArielT



Joined: 26 Jan 2010
Posts: 30

PostPosted: Thu Apr 29, 2010 9:47    Post subject: Reply with quote

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



Joined: 04 Oct 2008
Posts: 47

PostPosted: Fri Apr 30, 2010 15:11    Post subject: Reply with quote

Awesome stuff here so far. Smile
Back to top
View user's profile Send private message
Red



Joined: 14 Feb 2009
Posts: 21

PostPosted: Sat May 01, 2010 0:22    Post subject: Reply with quote

Works as advertised. I can't thank you enough.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri May 07, 2010 10:29    Post subject: Reply with quote

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



Joined: 24 Jan 2008
Posts: 196

PostPosted: Fri May 07, 2010 11:17    Post subject: Reply with quote

ShaDoOoW wrote:
Hey Maxrock, do you planning new version? What features we can look forward? Ty.


Nothing new really. Thanks to Zebranky Very Happy, 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
View user's profile Send private message Send e-mail MSN Messenger
VirgiL



Joined: 02 Apr 2010
Posts: 16

PostPosted: Sat May 08, 2010 11:23    Post subject: Reply with quote

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



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sat May 08, 2010 12:17    Post subject: Reply with quote

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

 
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