Ever wanted to have the server reset after a set period of time? well now you can have just that with my system you can easily set the time desired to have your NWN server reload.
I have included a Testing module where i have by default the server to reset in seconds rather then hours, so that you don't have to wait 24 hours or so.
It's simple enough really, i have made it completely noob friendly all you have to do is place the creature from tutorial named "Leo Autoreset" anywhere in your module and this creatuer will load my system.
once this is in you must then put in the board named "Your mod name here" from placeable under custom 1 you must place this anywhere in your module and name it the exact same as your mod's file name without the .mod
once you have placed one of these you can now change the settings how often you want the server to reset click on properties of the board you just placed and goto the tag "Lock" in here you will find "Key Tag" by default i have set it to 24 this means the server is set to reset every 24 hours. you can change this to how many hours you want.
For testing reasons i have added another placable called "Leo reset - Testing mode" under custom 1 also if you place this object in your module the server will understand you are in test mode and there for the time will be set to seconds rather then hours.
The ERF contains everything you will need to make it work 100% without any scripting knowledge just import and your good to go.
As per usual please take the time to vote on this and all of my other works it motivates me to contribute more to the community.
This may be a little late, but I was wondering what programs are out there to help test how long my mod takes to load, and to maybe help me get it loaded back up quicker between resets.
I currently have 1.69, all expansions, and cep 2.1. Maps in module are 828, scripts, 2100, and conv 503.
But I have no use for it� I�d very much like to see a version of this working for NWN2.
Both I and a lot of other PW builders for NWN2 would have a great use for this I�m sure, especially since there are no other working/supported database(NWNX4 and SQL) scripts up for grabs out there. The bonus of this is that it doesn�t even need to rely on such databases to work. It just uses the database folder the game comes with.
Zhjaeve � Know that I must begin every sentence with the word �Know�. Know that everything I say must be known. Know that it is important that you know this.
Posted by KansasDark at 2008-03-22 11:39:22 Voted 10.00 on 03/22/08
This will go great on my server. Thanks for the effort Leomist.
Posted by Leomist at 2008-03-18 06:11:24 Voted 10.00 on 03/18/08
I Do appreciate People voting and i do still check on my submitted scripts so if you download it, vote for it :) _________________________ Below you can find all my scripts.
Posted by Tyerial12 at 2008-01-30 16:45:54 Voted 10.00 on 01/30/08
10 10
Posted by Century 69 at 2007-11-13 16:54:59 Voted 10.00 on 11/13/07
Downloaded and like it. It is doing what i need nice script
Posted by +scarface+ at 2007-10-03 06:26:59 Voted 3.00 on 10/03/07
And my vote, i'm sorry but until this either a) does what it claims to do, or b) changes it's title description to how it really works, it's not going any higher. _________________________ §çà®Fãçë�
Posted by +scarface+ at 2007-10-03 06:25:39 Voted 3.00 on 10/03/07
Killuminati, you're obviously not smart enough to realize the difference, and also the point of the comments made, let me try and clear this up a bit... The title to this script is "server RESET", this does NOT RESET a server, why can't you get that? It has nothing at all to do with whining, it's basic and fundimental English, it doesn't do what it claims to, I hope you got it now, but i'm sceptical. _________________________ §çà®Fãçë�
Posted by Killuminati at 2007-10-02 04:57:13 Voted 10.00 on 10/02/07
10 of 10 for the module reloader, 0 of 10 to whiners....
Posted by OnyxEye at 2007-09-08 13:33:19 Voted 10.00 on 09/06/07
Oh, and no the math. It should be *60*60 or *3600, not *120, don't know what the hell I was thinkin'! _________________________ OnyxEye - Lead Admin
The Realms of Ghamede Link
Posted by OnyxEye at 2007-09-08 13:25:31 Voted 10.00 on 09/06/07
All I did was change the last command in leo_auto_start to:
And then took out all references to reloading the module in the player notices. _________________________ OnyxEye - Lead Admin
The Realms of Ghamede Link
Posted by +scarface+ at 2007-09-08 08:47:47 Voted 3.00 on 10/03/07
You might wanna also include the readme from that plugin too, and also ask the uploader for permission to include it in your package, good etiquette goes along way in the scripting game. _________________________ §çà®Fãçë�
Posted by +scarface+ at 2007-09-08 08:41:45 Voted 3.00 on 10/03/07
Leomist, it's fairly easy to do, since obviously have some scripting knowledge, i'm sure you can do it yourself.
All you need to do is download the plugin (which is uploaded in the "Other" section on this site), adjust your script to call the necessary function, include the plugin with your upload and give credit to the plugin author as welol as a link to the plugin.
Hope that helps. _________________________ §çà®Fãçë�
Posted by Leomist at 2007-09-08 06:45:09 Voted 10.00 on 03/18/08
OnyxEye, also thanks for finding the error ill update the code and resubmit it if you have a working version of the script using the nwnx plug in i would like to put it up here for others.
It would then conform better to the title.
thanks.
_________________________ Below you can find all my scripts.
Posted by +scarface+ at 2007-09-08 06:24:16 Voted 3.00 on 10/03/07
Oh just one last thing, this comment you made I just have to comment on:
"Now granted more memory from the original state is still being consumed but this is windows keeping information it feels it needs to keep, hence the memory leaks."
Total nonsense, memory leaks are a cause of poor programming and nothing at all to do with what windows feels necessary to keep in it's memory, that's total tosh. When programming a game/application, memory is usually allocated by the programmer (depends on which laguage is used, usually C++ or similar), memory leaks are caused by poor programming where allocated memory is not freed after usage and when it's no longer needed, please research before spreading misinformation. _________________________ §çà®Fãçë�
Posted by OnyxEye at 2007-09-08 06:23:48 Voted 10.00 on 09/06/07
I've made alterations to this to use the NWNX reset plugin and they work together just fine. Instead of loading the module, it actually resets the server program. These scripts actually gave me a basic "early warning system" for my players before the server reset.
Oh, I almost forgot, I found a math error in the leo_auto_reset script on line 10. The math there is turning iHours into minutes, not seconds. So when I set my mod to reset every 12 hours, it started resetting every 12 minutes.
I'm changing the line to the following:
int iHours = StringToInt(sHours)*120-30; // this forms the hours required to reset
With a few changes, this can be used in conjunction with NWNX reset plugin to do the full server resets. _________________________ OnyxEye - Lead Admin
The Realms of Ghamede Link
Posted by +scarface+ at 2007-09-08 06:15:00 Voted 3.00 on 10/03/07
I don't want anything, I was just giving advice where it was needed, it isn't my fault you take critisism badly.
BTW the title still suggests it resets a server, so it's still misleading for those who don't want to read every comment posted.
Posted by +scarface+ at 2007-09-08 05:02:28 Voted 3.00 on 10/03/07
Leomist, you're missing the point somewhere along the line, this doesn't reset a server at all as it's title suggests, it reloads a module which is nothing like a reset as explained, and if a server needs a periodic module reload (not reset) then it is indeed in need of some real help like some PW scripts i.e. area cleaners and the like, just reloading a module because of a build of in game objects causing inifficiency is laughable when the root of the problems should have already been solved.
End of the matter is, this doesn't reset a server, and if you wanted to reset a server all you need is NWNX running and the server reset plugin, so this here is indeed fairly useless for improving efficiency long term, it might make things run a little better in the first 30 minutes, but in the end those memory leaks will be so large you'll need a real reset anyway (and believe me there are alot of memory leaks caused with the nwserver.exe), I suggest changing it's misleading name to "Auto Module Reloader", which is in fact what it is.
I won't vote on this because it won't be good mainly because of it's misleading title and description, but it really needs to change so not to mislead those who know little about how the server process works. _________________________ §çà®Fãçë�
Posted by Lady_Blood_Rayne at 2007-09-07 09:20:25 Voted 10.00 on 09/07/07
i think this will be very useful for builders and admins _________________________ Lady_Blood_Rayne
Posted by Leomist at 2007-09-07 08:50:48 Voted 10.00 on 03/18/08
"Couldn't this be used in conjunction with the NWNX reset plugin to accomplish what everyone is looking for?"
I have no experience with the nwnx plug-ins so I'm afraid I'm not the one to do this, however there is an advantage of not resetting the actual server.
The players are kept on the server and sent back to there old place and not booted to the chat room.
If you have a slow/long loading module there are some tips i can offer you for loading everything much quicker and less loading time.
First of all everything that loads break it up, with the delay command for example i used to have CNR on my server (A very large and demanding crafting system) and loading time took about 5 minutes so i delayed all the instructions on module load each time it would execute a script i would have it delayed just by a few second or so.
you just have to make sure that no one uses the scripts you have delayed until they have run, meaning like the CNR for example, if there was a reset and they enter the server and instantly use a cnr script it wont work not until it has been loaded.
Now remember it also depends on the size of the script as it may take longer to load some others doing this the server loads everything in order and not all at once.
My loading time was cut down to about 30 seconds as it finishes your load script and tells the server it is ready however this is not true it's still loading things slowly but the players are free to role play even though some subsystems are not working (decided by you in witch order they load by priority) if you have a large script have things be delayed further after it you kinda have to cue ill give an example lets say they are in order of priority.
script 1 needs about 4 seconds to load
script 2 needs about 2 seconds to load
script 3 needs about 15 seconds to load
script 4 needs about 5 seconds to load
you would start of first with your script 1 loading as normal with no delay then you would delay script 2 by 4 seconds and then delay script 3 by 6 seconds so you would have to delay script 4 by 21 seconds.
there are some programs on here somewhere that can tell you exactlly how long a script is taking to load.
My server was ready for players in that time as the server loaded everything in order it had more time to finish each task and there for disk access was not all over the place.
By loading everything slowly it also gave the server time to breath and do things at a normal pace. _________________________ Below you can find all my scripts.
Posted by Leomist at 2007-09-07 08:13:11 Voted 10.00 on 03/18/08
I have been doing some extra testing and spawning creatures and dumping placables and items all over the module and by doing this increases memory consumption, consider a PW with over 300 area's if you spawn one creature in each thats 300 creatures if items or creatures or even placables are left around a large mod the memory will increase dramatically but when you reload the module all these extra added things ARE not stored in memory, a reload WILL partially remove anything from memory anything that isn't in the new module.
Do some testing as i have and you will notice for your self that the memory is partially released. i would say about 90% in my case (Tested with 1024mb ram).
Now granted more memory from the original state is still being consumed but this is windows keeping information it feels it needs to keep, hence the memory leaks.
Though technically it does not re execute nwnserver.exe it does free up ram.
loading a server can sometimes be a large load especially for large mods,
but look at it this way it's like running until your exhausted to the point of death and need to stop or running a short distance and having a short break, each has it's down sides.
But as i said previously during the passed 3 years i been running this way and has worked fine and upon further testing it does free up around 90% of additionally used memory.
_________________________ Below you can find all my scripts.
Posted by OnyxEye at 2007-09-07 07:54:55 Voted 10.00 on 09/06/07
Couldn't this be used in conjunction with the NWNX reset plugin to accomplish what everyone is looking for?
These scripts would run the timer and give player's warning of the reset. These scripts could be altered to call the NWN reset plugin function rather than just reloading the module.
At least that was my plan when I downloaded this. I haven't made the necessary changes, yet, but it's on my to-do list. _________________________ OnyxEye - Lead Admin
The Realms of Ghamede Link
Agreeing with §çà®, Two different things no matter how you try and mix it up. The arguement remains solid. I quote "reloading does not clean up memory leaks and hardly improves performance". Meaning. a reload just loads a "NEW" mod, it doesn't clean the memory. All your doing by reloading is making your pc work harder. Thus inturn you lower performence. On the note though it's a good script if you want to "reload" not a good script if you want to "reset" Good job, choose your words a little more carefully next time. _________________________ «�°·Ðá®k_ÇÿÐè·°�»
Posted by Leomist at 2007-09-07 06:36:04 Voted 10.00 on 03/18/08
In response to your posts i would like to inform you both that reloading your module does improve things as it clears all the creatures lefts behind and things that may be laying around the server, understand the intentions of this script is simply to reload the current running module as described, after a set time desired by the user.
Though to clarify why i used reset is due to when i used to run my server where the nwn application nwnserver.exe would never reset, a reset in my server was simply reloading the module sorry for your misunderstanding.
But to say "so it's pretty much useless" is untrue and an insult to my time and efforts i put in to create this.
i used this system for over 3 years and it worked without problems and kept a smooth running server, it may not have the same effects of restarting nwn like nwnx does, but what you say is untrue so before deciding to degrade somebody's work please try there system before hand. _________________________ Below you can find all my scripts.
Posted by +scarface+ at 2007-09-07 04:08:06 Voted 3.00 on 10/03/07
Agreed with Milliorn, this doesn't do what it says on the tin, a module reload and a server reset are 2 completely different things, this only reloads a module not resets it, reloading does not clean up memory leaks and hardly improves performance so it's pretty much useless, to reset a server you need an application like NWNX, it's not possible through NWScript. _________________________ §çà®Fãçë�
Posted by Milliorn at 2007-09-07 01:16:00 Voted 5.00 on 09/07/07
this doesnt restart anything. it RELOADS or loads a new module. reloading or loading a new module is not RESTARTING a Server. _________________________ A Carpathian Nightmare - Action
Direct Connect IP 216.161.26.219:5121
A Carpathian Nightmare Website & Forums! Link Link
Check out my band "Slowly Truth Dies" on Myspace! Link
Posted by OnyxEye at 2007-09-06 07:56:48 Voted 10.00 on 09/06/07
Tested this out, and it seems to work just fine. The only thing I would suggest is adding a warning at 10 minutes, 5 minutes, and 2 minutes, like the ones you did for 30 minutes and 15 minutes.
Thanks for the release, I was thinking of trying to come up with something like this, so you've saved me some time and effort! _________________________ OnyxEye - Lead Admin
The Realms of Ghamede Link
Posted by Leomist at 2007-09-06 02:46:15 Voted 10.00 on 03/18/08
If you like my work you should check out my other scripts and vote.. you can find them below.
_________________________ Below you can find all my scripts.