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_areas func - Where to find?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
BelowTheBelt



Joined: 28 Jul 2010
Posts: 29

PostPosted: Thu Mar 10, 2011 19:01    Post subject: nwnx_areas func - Where to find? Reply with quote

I'm trying to find the right files and instructions for the windows version of the latest version of the areas function.

Anyone got any tips? I found some links to a dev area, but not sure what files were current and I couldn't figure out what to download, so thought I'd check in.

Thanks!
_________________
www.arenthyor.com
Back to top
View user's profile Send private message Visit poster's website
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Mar 11, 2011 17:23    Post subject: the most recent Reply with quote

I think the most Recent version of areas, might be in the Maxrock Branch of the svn.


You might need to build it yourself though.


Note - There is a bug with the windows version, which can be bit problematic.

If you join the game, then an area is generated, and then you log out, when you return to that area, it will appear as a black void.

The only current work around for it, is to ClearTurdList - which wipes all data relating to all offline players last visit to the PW.

(local vars, logoff locations etc)

When they return to the server, it simulates them appearing for the first time.

You can get around the obvious downsides of this, by using persistent location storage etc, and persistent vars etc.
Back to top
View user's profile Send private message
BelowTheBelt



Joined: 28 Jul 2010
Posts: 29

PostPosted: Fri Mar 11, 2011 21:46    Post subject: Reply with quote

ouch. Don't know that I could figure that out by myself. For anyone who has done this already, any insight about what files to download and how to initialize it would be most appreciated.

Baaleos, when would be the best place to clear the TURDS (on client exit, enter, other)? And, can I selectively clear the TURD of a specific player rather than the whole playerbase?

THanks.
_________________
www.arenthyor.com
Back to top
View user's profile Send private message Visit poster's website
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Sat Mar 12, 2011 19:39    Post subject: Reply with quote

Well, I'm having another go at the area plugin, with some new ideas.
Baaleos, is the new area unlit every time you log out and back on or only if another area is deleted in between logout and login?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Sat Mar 12, 2011 22:16    Post subject: Reply with quote

More importantly, does this problem exist in the original Linux version of the plugin?
http://nwn.virusman.ru/trac/nwnx2-linux/changeset/366/
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Sun Mar 13, 2011 1:56    Post subject: Reply with quote

The problem in the windows version was that there is a separate count for the minimaps for each creature (the dword after area_alloc). I never incremented that and so the new areas were never copied to the player turd, and of course never copied back to the player. That's why the area was dark.
I got that fixed, no off to implement Virusman's cleanturd code.

virusman wrote:
More importantly, does this problem exist in the original Linux version of the plugin?
http://nwn.virusman.ru/trac/nwnx2-linux/changeset/366/


Is that a rethorical question because you solved it already?


EDIT:
Alright, I have your CleanTURD code in and it seems to work fine.
Here's something I thought about though: When you add an area, shouldn't it also be added to the player turds?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Mar 18, 2011 17:27    Post subject: Reply with quote

Sorry I didnt reply sooner,
Just saw this post.
Its solved now, so my reply aint worth much now

But yes, the issue was that

If you log into the server, any area that is generated after your initial login, is considered 'bugged', in that if you log out, and then revisit that area, the area appeared as a black void.

I narrowed it down to being a turd specific issue, because Cleaning the TurdList seemed to resolve the issue.

Thanks to the fix by Max & Virusman,
Cleaning Turdlist is no longer required.
Back to top
View user's profile Send private message
BelowTheBelt



Joined: 28 Jul 2010
Posts: 29

PostPosted: Mon Mar 21, 2011 23:12    Post subject: Reply with quote

Ok, so for those of us playing at home...

Max, can you point us to the Windows files and name the ones we need to download, as well as provide some installation instructions?

Also, regarding the CleanTurds function, is there any way to expand that function so that it can be called only to reset for a specific player (or default to the entire playerbase who logged in since the last reboot)?

I would much prefer to selectively target only the PC who is entering a newly created area rather than wipe the TURDS of the entire file.

Make sense? Is that possible?

Thanks!
_________________
www.arenthyor.com
Back to top
View user's profile Send private message Visit poster's website
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Tue Mar 22, 2011 5:18    Post subject: Reply with quote

Hm.. Somebody should probably join the thread with this one: http://www.nwnx.org/phpBB2/viewtopic.php?t=1705&sid=5b4b87ab13eefd47e3aad7490bc67f15

Anyways...
There's no need to wipe any TURDS anymore (Does anybody know if this is actually an acronym or just humor on the developer's side) and it looks like we solved all the issues.

If you go here: http://sourceforge.net/projects/mrnwnxstuff/files/dlls/
You can get the latest nwnx_areas dll, nwn script include (nwnx_areas.nss) and there's also a readme outlining some basc stuff.


But here's a more detailed installation/implementation procedure:

- nwnx_areas.dll goes in your main nwn server folder (just for completeness' sake)
- Add the following lines to your nwnx.ini

[AREAS]
debugLevel=3
LocationFailSafe = LocationFailSafe

You can set debugLevel to 0 if you don't care for the the log output. I'll explain LocationFailSafe further down.

Once the server is running, calling a script with this:
Code:

object oArea = LoadArea("area001"); // change area001 to a resref of any area in your module
SetAreaName(oArea, "My New Area");

will create a new area - or rather a copy of area001.

Keep in mind that everything in that new area will have the same tag, name and resref as the original and calls like GetWaypointByTag("MY_WAYPOINT") will pick tags from the new area first (which incidentally is nice because if a DM wants to make huge changes to an area for an event, they can simply make a copy and make the changes in that copy. Cleanup is as simple as deleting the copy and everything is back to normal)

DestroyArea(oArea) will destroy an area. The area did not have to be created with LoadArea! But it only works if there are no players in that area.
And here is where the LocationFailSafe comes into play:
When a player logs off they leave a little piece of information behind (called a TURD) in that area (their local vars, automap data, etc). If you destroy an area in which a player logged out the plugin tries to decide where to put that player. LocationFailSafe is the name of a local location which can be set on a player (before they log out of course):
Code:
SetLocalLocation(oPC, "LocationFailSafe", GetLocation(GetWaypointByTag("My_HOME_WP"));

When the player logs back in they are sent to this location.

If the local location is not found on the player, the plugin checks the module for it and if found spawns the returning player at that location.
If neither the player, not the module have the LocationFailSafe var then the player spawns at the module's starting location.

You can change the name of the local location variable in nwnx.ini: e.g.: LocationFailSafe=PortPlayersFromDeletedAreasHere
And to set the location:
Code:
SetLocalLocation(oPC, "PortPlayersFromDeletedAreasHere", GetLocation(GetWaypointByTag("My_HOME_WP"));


If you are also using the resource manager plugin, things are a lot more fun because you can add brand new areas to a running module. Simply drop the 3 area files (area001.are, area001.gic, area001.git) into the are subfolder of your resman folder and call LoadArea.
Caveat: Areas in the resman folder will override areas in the module at module load!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Wed Mar 23, 2011 11:56    Post subject: Reply with quote

MaxRock wrote:
There's no need to wipe any TURDS anymore (Does anybody know if this is actually an acronym or just humor on the developer's side)


Both, I suspect. It's probably officially something like "Tracked User Resource Data", if management asks. Wink

I'm still surprised they didn't find a way to get "FlushTURD" in there anywhere.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Mar 23, 2011 12:58    Post subject: maybe the Reply with quote

A developer probably did contemplate having the area of memory where turds are stored, called 'ToiletStorage' or something.

Developer Toilet Humor.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion 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