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 
 
Hashset efficiency

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
ArielT



Joined: 26 Jan 2010
Posts: 30

PostPosted: Sat May 15, 2010 8:53    Post subject: Hashset efficiency Reply with quote

How efficient is the nwnx hashset plugin when used as an array? The PRC creates arrays by using in game strings, would the hashset plugin improve on this speed?

Is there a better way to implement a modifiable array?
Back to top
View user's profile Send private message MSN Messenger
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Sat May 15, 2010 11:54    Post subject: Reply with quote

The hashset plugin is great for when you want to store key/value pairs. It is not, as such, an array, but I'd imagine you could use it as one anyway if you wanted and it would be alright, certainly better than mucking about with NWN local variables.
Back to top
View user's profile Send private message
ArielT



Joined: 26 Jan 2010
Posts: 30

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

Fireboar wrote:
The hashset plugin is great for when you want to store key/value pairs. It is not, as such, an array, but I'd imagine you could use it as one anyway if you wanted and it would be alright, certainly better than mucking about with NWN local variables.
Well, I suppose I could try to write an array plugin fairly simply. The transition time with NWNX isn't too long, then?
Back to top
View user's profile Send private message MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sat May 15, 2010 23:31    Post subject: Reply with quote

Well nwnx uses locals too, so imo short array wont be more eficient with nwnx, especialy with objects. Also only string local variable is hooked so you will have to always convert input into string, then twice again in plugin and again when you retrieve local in nwscript.

However the more fields the more efficient the plugin solution will be because of locals retrieval from the same object.

Personally, since I learnt how to use advantages of mysql, i dont need (pseudo) arrays or lists anymore...
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
ArielT



Joined: 26 Jan 2010
Posts: 30

PostPosted: Sun May 16, 2010 1:19    Post subject: Reply with quote

ShaDoOoW wrote:
Personally, since I learnt how to use advantages of mysql, i dont need (pseudo) arrays or lists anymore...
How so?
Back to top
View user's profile Send private message MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun May 16, 2010 5:06    Post subject: Reply with quote

because you can use mysql for this purpose

two column table for list, three colums for 2d array or more for specific one

using autoincrement integer as first column you get list/array functionality...

EDIT: to be honest, im not using this, im using list only for players to avoid multi loop, and for that locals works good... but when I think about this, maybe i could reconsider event based scripting (like in PRC) with mysql it could be pretty efficient
_________________
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 -> Scripts and Modules All times are GMT + 2 Hours
Page 1 of 1

 
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