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, 6 ... 27, 28, 29  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
VirgiL



Joined: 02 Apr 2010
Posts: 16

PostPosted: Sun May 09, 2010 10:46    Post subject: Reply with quote

max,
can i count on this plugin also in linux version? so i can develop in win and host in linux

cuz right now im trying to implement something where this plugin might help very much, but need to be sure whether it would be also for linux / just windows

thanx
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Sun May 09, 2010 11:45    Post subject: Reply with quote

Uh... this is actually a port from the Linux plugin nwnx_funcs by Acaos. The word "port" here is used in the loosest possible sense of the word.
Back to top
View user's profile Send private message
VirgiL



Joined: 02 Apr 2010
Posts: 16

PostPosted: Sun May 09, 2010 20:19    Post subject: Reply with quote

but some functions like those with Quickslots are totally different and made from scrap - i dont think it will be compatible
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Sun May 09, 2010 20:45    Post subject: Reply with quote

Fireboar wrote:
Uh... this is actually a port from the Linux plugin nwnx_funcs by Acaos. The word "port" here is used in the loosest possible sense of the word.


VirgiL wrote:
but some functions like those with Quickslots are totally different and made from scrap - i dont think it will be compatible


You're right, it wouldn't be compatible and I should never have used the word port to describe this plugin.
I merely tried to give us "poor" windows people some additional functionality and never thought about - I'm just assuming here - the fact that to run a linux server you still had to use windows to create and work on a module.
Wasn't somebody writing a linux toolset?

You could try to write a wrapper around the windows include file for the functions that do the same but take different parameters.

Also, the windows "port" doesn't include half the functionality of the linux version.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
VirgiL



Joined: 02 Apr 2010
Posts: 16

PostPosted: Mon May 10, 2010 14:46    Post subject: Reply with quote

so the linux plugin functions "Set / Get RawQuickbarSlot" does the same as in the windows version? if yes, ill do that wrapper as u suggested then.. thx

another question... i feel stupid, but i cant find link for this plugin in linux - i spot some nwnx_funcs from user 'acaos' but there is no link inside (i checked 1st / last page).. advice pls?
Back to top
View user's profile Send private message
Sethan



Joined: 04 Oct 2008
Posts: 47

PostPosted: Tue May 11, 2010 4:48    Post subject: Reply with quote

Given how much you've already done I feel bad asking for more.

...but I'll live with it. Wink

You gave us GetMovementRate early on.

Any chance we can get a SetMovementRate?
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Tue May 11, 2010 5:03    Post subject: Reply with quote

Sethan wrote:
Given how much you've already done I feel bad asking for more.

...but I'll live with it. Wink

You gave us GetMovementRate early on.

Any chance we can get a SetMovementRate?


No problem, add this to nwnx_funcs.nss
Code:

NWNXFuncs_SetMovementRate(object oCreature, int iRate) {
   SetLocalString(oCreature, "NWNX!FUNCS!SETMOVEMENTRATE", IntToString(iRate);
   DeleteLocalString(oCreature, "NWNX!FUNCS!SETMOVEMENTRATE");
}


At least I hope that the function is still in the plug-in.
The reason that it doesn't have a script call to it is that, if used on a player, they have to relog for it to work.
Non-player creatures have to be saved to a database (nwn's is fine) and respawned from there. ...Using CopyObject might work too, for the copy at least.
I haven't figured out how to make a live character change movement speed but thanks to Virusman's name plugin I have at least a basic idea how to build and send Messages (server to client and vice versa). That might be the key.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Sethan



Joined: 04 Oct 2008
Posts: 47

PostPosted: Tue May 11, 2010 5:15    Post subject: Reply with quote

Wow - that was fast. Smile

The primary reason I had this in mind was for the occasional situation where altering a PC's movement rate breaks the PC and requires using Leto to fix them.
Back to top
View user's profile Send private message
VirgiL



Joined: 02 Apr 2010
Posts: 16

PostPosted: Wed May 12, 2010 20:13    Post subject: Reply with quote

hey max,
i've tried your plugin for some dummy script with SetQuickSlot to:

quickslot_s.iType = <qb_type_macro>;
quickslot_s.sLabel = "Test";
quickslot_s.sCommand = "/talk test";

so i executed the script in game and it worked, however when i ran it again, my server crashed

not sure in how deep you tried out this function - would you be able to look into that pls?
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Wed May 12, 2010 23:53    Post subject: Reply with quote

VirgiL wrote:
hey max,
i've tried your plugin for some dummy script with SetQuickSlot to:

quickslot_s.iType = <qb_type_macro>;
quickslot_s.sLabel = "Test";
quickslot_s.sCommand = "/talk test";

so i executed the script in game and it worked, however when i ran it again, my server crashed

not sure in how deep you tried out this function - would you be able to look into that pls?


I was afraid that would happen sooner or later. String handling seems to be an somewhat of a problem.
Almost all of the functions I've come across in the linux plugins say "causes memory leak".
The linux version of nwnx_funcs avoids this problem with the quickbar buttons by only doing spells.
I'll give it another try, but I can't promise anything.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
VirgiL



Joined: 02 Apr 2010
Posts: 16

PostPosted: Thu May 13, 2010 16:33    Post subject: Reply with quote

im not sure about what i am saying now (as im not sure how nwnx works at all), but:
when player creates a character using nwn wizard and when he logs into the game, his quickbar will be set up on some 'initial' setup
you can also see it when you make some NPC in toolset which after you posses in game as DM, the quickslots are set up appropirately

maybe poet question (just to give some idea):
can't you somehow find out how it is done on that particular case and use that idea in your plugin?
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Sat May 15, 2010 20:12    Post subject: Reply with quote

Latest version (0.7) is on the vault http://nwvault.ign.com/View.php?view=Other.Detail&id=1447

Code:

v 0.0.7
   Added:
      NWNXFuncs_GetWorldDate
      NWNXFuncs_GetWorldTime
      NWNXFuncs_SetWorldDateTime
      NWNXFuncs_GetFactionID
      NWNXFuncs_SetFactionID
      NWNXFuncs_GetSoundSetID
      NWNXFuncs_SetSoundSetID
      NWNXFuncs_GetSavingThrowBonus
      NWNXFuncs_JumpCreatureToLimbo
      NWNXFuncs_SetClassLevel
      NWNXFuncs_GetDamageImmunity
      
      New Effect handling routines (see fx_example.nss)
         NWNXFuncs_GetFirst
         NWNXFuncs_NextEffect
         NWNXFuncs_GetEffectRemainingDuration
         NWNXFuncs_GetEffectIntegers
         NWNXFuncs_GetEffectInteger
         NWNXFuncs_SetEffectInteger
         NWNXFuncs_GetEffectID
         NWNXFuncs_GetEffectType
         NWNXFuncs_GetEffectSubType
         NWNXFuncs_GetEffectCreator
         NWNXFuncs_GetEffectSpellId
         NWNXFuncs_GetEffectDurationType
         NWNXFuncs_QueueRemoveEffect
         NWNXFuncs_RemoveQueuedEffects
         NWNXFuncs_GetHighestEffectID
         NWNXFuncs_SetEffectCreatorByEffectID
         NWNXFuncs_SetEffectSpellIDByEffectID
         

   Removed:
      NWNXFuncs_SetLastEffectSpellID
      NWNXFuncs_SetLastEffectCreator
         It's safer and more flexible to use the new Effect routines
   
   Changed:
      I put NWNXFuncs_ in front of all function names in changelog.txt, since some now have the same name as existing script functions
   
      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)
      
      NWNXFuncs_Init has become obsolete since GetWorldTime makes it unnecessary to save a pointer to the module (was needed for GetEffectRemainingDuration)
      
      Managed to get version information into the dll description
      
      Get/SetQuickslot should now be able to handle all quickslot types, except for items


Last edited by MaxRock on Mon May 24, 2010 3:58; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun May 16, 2010 15:47    Post subject: Reply with quote

Hey MaxRock, nice work with effects, i have been waiting for get/set effect integer myself.

However Im insterested, why you made copies of standard functions, getspellid,creator, first/next, its not possible to use standard first/nexteffect loop and then new functions? Or do the standard functions work at all now?
_________________
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: Sun May 16, 2010 19:36    Post subject: Reply with quote

ShaDoOoW wrote:
Hey MaxRock, nice work with effects, i have been waiting for get/set effect integer myself.

However Im insterested, why you made copies of standard functions, getspellid,creator, first/next, its not possible to use standard first/nexteffect loop and then new functions? Or do the standard functions work at all now?


I can only pass strings and objects between the server and nwnx, so it was either make equivalents of the standard GetEffect..() functions or run a second loop of GetFirst/GetNextEffect alongside if you needed to know Type, SubType, etc of the effect.

The standard functions work fine and they're what you want to use if you don't need to do anything "special" to the effects. The runtime of a NWNX_FuncsGetFirst/GetNext loop is about 2-3 times as long as an equivalent standard one; ~1100 µs vs. ~600 µs to loop over 30 effects on my machine.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Xylou



Joined: 06 Apr 2010
Posts: 7
Location: France

PostPosted: Mon May 17, 2010 10:48    Post subject: Reply with quote

Thanks MaxRock for the new functions!
More and more functionalities I've given up are reborning thanks to that kind of functions.
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, 6 ... 27, 28, 29  Next
Page 5 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