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 
 
Terra's NWNX stuff
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Fri Sep 13, 2013 13:39    Post subject: Terra's NWNX stuff Reply with quote

Edit: https://github.com/TerrahKitsune/NWNX
Edit nwscripts, inisnippets etc: https://github.com/TerrahKitsune/NWNX/tree/master/nwscript
Edit precompiled binaries: https://github.com/TerrahKitsune/NWNX/releases

Heyo, I've refurbished nwnx areas to not crash in 64bit environments and general fixes. I also made a different version of resman that works by registering resources to load from files, it works with nwnx_areas (all of them) and any other resources the game might call on. All sources can be found here: http://terrah.no-ip.org/Terra/nwnx/

NWNX Areas

Compatible with other nwnx area nwscript libraries, CreateArea, DestroyArea, RenameArea. This version also comes with a GetHeight, GetPlayerCount and GetArea (looping though the area-list). I've tested it and fixed the crashes I've come across, it will reset player-turds located in areas that are about to be deleted.

http://terrah.no-ip.org/Terra/nwnx/nwscript/nwnx_areas.nss
http://terrah.no-ip.org/Terra/nwnx/Release/nwnx_areas.dll

NWNX Names

Contains functions set/get temporary names and names as other players would see. It can also permanently set PC names and familiar/animal companion names. This doesnt update the names in the playerlist because its stupid. :<

http://terrah.no-ip.org/Terra/nwnx/Release/nwnx_names.dll
http://terrah.no-ip.org/Terra/nwnx/nwscript/nwnx_names.nss

NWNX Effects

Allows setting effect variables (much like how EffectSupernatrualEffect works) IE: CL, spell ID, creator etc. It also allows setting an effect script which will fire when the effect is removed from a creature.

http://terrah.no-ip.org/Terra/nwnx/nwscript/nwnx_effects.nss
http://terrah.no-ip.org/Terra/nwnx/Release/nwnx_effects.dll

NWNX Magic

Contains functions which can be used to get/set/modify the spells on creatures has, or even set/get Special Abilities to players.

http://terrah.no-ip.org/Terra/nwnx/Release/nwnx_magic.dll
http://terrah.no-ip.org/Terra/nwnx/nwscript/nwnx_magic.nss

NWNX Weapons

Allows modifying which feats count as which for the weapon feats. First time use of this plugin will spawn a file named weaponconfig.txt in your nwn root folder which holds the default values. Behavior can be modified either by altering the weaponconfig file or with the nwscript functions. The UBAB flag in this plugin isnt in use anymore as it was split out to a different plugin. This plugin can also change the behavior of dev-crit and weapon proficiencies.

http://terrah.no-ip.org/Terra/nwnx/Release/nwnx_weapons.dll
http://terrah.no-ip.org/Terra/nwnx/nwscript/nwnx_weapons.nss

NWNX ubab

This plugin will set which weapons count as ubab weapons. It does not work on ranged weapons and only comes with inisettings as following:

[UBAB]
1=15 ;torch
2=36 ;gloves
3=40 ;kama
4=50 ;q-staff
5=78 ;bracer
6=256 ;invalid (no weapons, no gloves/bracers)

Insetting can be infinity long as long as it starts with 1 and the numbers are continuous as above which is nwn default+quarterstaff.

http://terrah.no-ip.org/Terra/nwnx/Release/nwnx_ubab.dll

NWNX Dynres (Dynamic resources)

Inisettings:

[DYNRES]
root="D:/test/"
log=1 ;0=nothing 1=external loads 2=external and internal
filter=".test.etc.etc" ;This is the capsule filter, its delimited with dots and all files with the extension in the list will be ignored for capsule files, this can be changed with included nwscript functions

The plugin works by looping though all files (including subfolders) in the registered root folder and registers them. Registered resources will be externally loaded upon demand from the game. The nwscript library contain functions to manually register or unregistered resources. Its not compatible with resman so pick one or the other. This can also register capsule files (mod, erf, haks etc) to call upon resource within them. The plugin prioritizes lose files over resources in capsules. The plugin will also ignore module info files, faction files and palette files if they're in a capsule.

http://terrah.no-ip.org/Terra/nwnx/nwscript/nwnx_dynres.nss
http://terrah.no-ip.org/Terra/nwnx/Release/nwnx_dynres.dll

NWNX Messages (Previously Connect)

This plugin holds functions to send messages though to players in a more specified manner. Messages can also serve to send the hak-list though to nwncx_connect. The haks you wish to pre-load has to be defined in NWNX.ini as such:

[MESSAGES]
1="hak1"
2="hak2"
3="hak3"
4="hak4"
5="hak5"
6="and so forth etc etc etc..."
TLK="tlkfile"

If the TLK field is empty the HakList sending will be disabled, this recommended if you're using nwnx_conenct

http://terrah.no-ip.org/Terra/nwnx/nwscript/nwnx_messages.nss
http://terrah.no-ip.org/Terra/nwnx/Release/nwnx_messages.dll
_________________
I dun have any signature, I'm happy anyway.


Last edited by Terra_777 on Tue Jan 17, 2017 18:36; edited 13 times in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 581

PostPosted: Sat Sep 14, 2013 21:28    Post subject: Reply with quote

Terra would you mind to explain me difference between dynres and resman? I thought that the standard resman reloads the resource from files everytime the resource is called to load from game. Never tried it but if thats true, whats the advantage of dynres?
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Sat Sep 14, 2013 22:41    Post subject: Reply with quote

Im sure Terra can answer it better, but based on the nss - it looks like you can specify files that are not within a specific directory.

eg: No longer need to have a centralized sources directory - you can call

DYNRES_AddFile( "creature.utc", "c:\my_Dir\creature.utc" );

This is good and bad in some cases - some people like keeping their sources together - but this doesn't preclude you from doing that anyway, just means its no longer a requirement.

In addition, there is

DYNRES_RemoveFile( string sFile );

Which will allow you to remove files from the resources, and have them used by either the internal (if they exist) resource, or just not be available.
This is something that resman couldn't do.

Once you load a resource with resman, its in memory until you reboot the server, even if you drag it out of the directory, it will still be stuck in nwserver.exe until you reboot.

So this allows you to remove the resource, without having to reboot the server.



The other 2 methods - get first and next file: Good if you want to loop through all the dynamically loaded resources, to pump them to a db or even just put them into a log somewhere.
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Sat Sep 14, 2013 23:53    Post subject: Reply with quote

ShaDoOoW wrote:
Terra would you mind to explain me difference between dynres and resman? I thought that the standard resman reloads the resource from files everytime the resource is called to load from game. Never tried it but if thats true, whats the advantage of dynres?


It registers resources much like nwn does itself, difference between dynres and resman is that dynres does not attempt opening files for each and every demand, it only does it for files it got registered. As such you can have any foldertree under the folder you set in nwnx.ini as the root, you can register resources using the nwscript functions regardless of where the file is located.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Sun Sep 15, 2013 2:49    Post subject: Reply with quote

I renamed the thread and published the rest of my toys.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Tue Sep 17, 2013 16:23    Post subject: Reply with quote

Added NWNX Connect for windows servers.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
addicted2rpg



Joined: 01 Aug 2008
Posts: 106

PostPosted: Tue Sep 17, 2013 18:42    Post subject: Reply with quote

You know, I just finished a version of nwnx_connect last night Smile
Sweet, more power to the people.

What are the target OS' for all those? Any 64-bit? I know Baaleos has an evil Win2008 server.
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Tue Sep 17, 2013 19:04    Post subject: Reply with quote

My development environment is in 64bit Windows 8 so I don't see why it wouldn't work on 8 and below as I'm not using any of the newer windows API stuff. If it doesnt work on windows server 2008 try compiling the plugin as Multi-threaded instead of Multi-threaded DLL under C/C++ -> Code generation -> runtime library.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
addicted2rpg



Joined: 01 Aug 2008
Posts: 106

PostPosted: Tue Sep 17, 2013 19:57    Post subject: Reply with quote

Thanks, I'll do that!
Do you mind if I integrate some of your stuff into my build environment?

I was looking at your connect source and you've really taken your own approach! The nwnx_malloc/nwnx_free funcs use a different address than what I'm doing. When you call WriteCExoString(), does your debugger pass through a call to HeapFree? The ~CExoString() destructor in NWN is kind of weird, it seems to have some functions nested in it, which are sometimes called directly, and sometimes the wrapper version is called. Its like there are different ways they have in mind of removing memory. I suppose this is why both of our editions work.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 581

PostPosted: Tue Sep 17, 2013 20:19    Post subject: Reply with quote

See thats the problem with all those forks. Not to mention that several peoples work on the same thing and then they found out they did that all for nothing, the main problem is decentralization of the development.

Dont you guys want to make a one collaborate project instead? Would be nice to have all windows stuff on one place, best with a ability to commit change as I would like to add my stuff but dont know where now.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect


Last edited by ShaDoOoW on Tue Sep 17, 2013 20:24; edited 1 time in total
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Tue Sep 17, 2013 20:21    Post subject: Reply with quote

CNWMessage::Write/Read<anything> has a flag at the end which if you pass 32 to it it'll copy the data rather then "stealing" it. Thats what I gathered atleast.

As for deconstructions, I tear down my own memory myself and if I do call a constructor (or destructor) I do so manually because malloc/free doesnt call their respective constructors/destructors as new/delete does. Using new and delete will break it though so its kinda fiddly to keep track on your memory.

I've also had no problems loading any of the plugins on windows server 2008 r2. As for using my code, feel free, all of nwnx is under GNU so I cannot stop you even if I wanted too as long as you publish your source in turn. Razz
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
addicted2rpg



Joined: 01 Aug 2008
Posts: 106

PostPosted: Tue Sep 17, 2013 21:12    Post subject: Reply with quote

Well Shadooow, I see what you're getting at. With the number of active developers at the moment though, its not too difficult to merge ideas and mix snippets.

A composite download for NWNX2 + All Plugins is one of my overarching visions, and actually, documentation as well. While the plugin system was a good solution for a long time, compatibility creep can create nightmares for would-be server maintainers running around trying to find donwload X or Y that runs. I don't really mind if there are more than one composite downloads available, after all back in the day there was FastFrench and other NWNX variants running around and it was all fine. The keyword here is composite - the downloader gets a collection of plugins and nwnx that have been tested to at least work with eachother without having to mix and match editions of nwnx and plugin from a thousand different download links.

I don't run a server so no itches to scratch; I don't make new plugins, only migrate or polish old ones (although my "polish" could arguably be considered as disfigurement, lol - not exactly known for my clean code). My motivations are, idealistic as it sounds, the hope that with more/better tools available more people would consider to run their own PWs, and thereby increase my choices to play on as a player and generally I'm not playing, so hopefully they'll keep my game warm for me when I am. While I think the Linux is the superior server platform, many entry-level PW people will be coming in from the Windows side, which is why Windows development helps them and helps seed the server community. When their servers become big, serious, and they get experienced they can consider migrating to Linux -- or stay with Windows if we're actually bringing enough to the table for them to stay at that point.

Anyway, for all that grand talk about a composite download, I've barely scratched the tip of the iceberg. I am very far away from that moment of making the post announcing a composite download for people to setup PW's on. Really it comes down to need less bugs, need more plugins, and need more testing. But little by little, I'll get there. Smile

I'm still kind of surprised that we use completely different memory manipulation methods and still get it to work. I'm questioning if there are any caveats in my own. I'll need to do some more debugging and make sure everything gets freed up ok.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 581

PostPosted: Tue Sep 17, 2013 22:00    Post subject: Reply with quote

BTW checked your version Terra, which was what i had in plan myself in order to faster loading of haks on client side, but it seems there is no performancy improvement so the improvement must be done on the client side...

Also when I runned my module with your newer plugins, my instanced area didnt showed my custom placeables, all i could see in there was invisible objects, but all my placeables from haks wasnt visible.

EDIT: Im also not very comfortable with your newer decisions on how the function works.
1) Why you detached ubab from weapons?
2) Why UBAB now needs to be set in ini? Even if this would be optional as I see the possibility to set it via weapons, I dont see any advantage in this.
3) Why you added some generic functions into your specific plugins? Specifically AREAS_GetHeight and AREAS_GetPlayers, arent those in funcs? (I know funcs is now broken for win7/2008 but still makes no sense to be in a plugin devoted specially to area instancing)

And few questions:
1) Does the old weapon variables works anymore? This was probably hard to use for an user but allowed dynamic changing on a specific character basic which is very useable.
2) I suspect the nwnx_cool now wont work properly since ít still contains all the stuff you detached into these new plugins, right? Do you plan to update nwnx_cool and remove all the conflicting code?
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Tue Sep 17, 2013 23:13    Post subject: Reply with quote

You can pick either or, reason I removed ubab from nwnx weapons was because I was debugging and turns out that ubab was causing extreme amounts of lag when ranged weapons where selected as ubabable.

If you still wish to use cool then don't include nwnx weapons or ubab since those doesnt add anything new over cool if you prefer the way cool handles those.

Reason you find generic functions in my plugins are because I don't plan on making yet another function plugin nor am I planning on further developing cool. You find GetHeight and GetPlayers in the area plugin because they're fetching data right out of the CNWSArea object or calling upon methods within that object. You find SendMessage in names just because I was already had code in that plugin for transmitting custom messages, namely (ha!) name updates.

As for PLC's and stuff not spawning in areas, thats resman for you, resman cannot dynamically load git files which is something I fixed for dynres and maxrocks version of areas does it internally.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 581

PostPosted: Tue Sep 17, 2013 23:59    Post subject: Reply with quote

Terra_777 wrote:
As for PLC's and stuff not spawning in areas, thats resman for you, resman cannot dynamically load git files which is something I fixed for dynres and maxrocks version of areas does it internally.

well i dont have nwnx_resman and nwnx_dynres doesnt report anything (since it only loads it and I didnt yet added any scripts for it).

I got all dll from this thread except chat which is but i think latest version also from you.

my log:

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 areas is loaded.
* Plugin chat is loaded.
* Plugin connect is loaded.
* Plugin dynres is loaded.
* Plugin effects is loaded.
* Plugin events is loaded.
* Plugin files is loaded.
* Plugin magic is loaded.
* Plugin names is loaded.
* Plugin reset is loaded.
* Plugin ubab is loaded.
* Plugin weapons is loaded.
* NWNX2 activated.
*shutting down...
* NWNX2 shutdown successfull.
_________________
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 1, 2, 3, 4  Next
Page 1 of 4

 
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