date, time, and timestamp code hooks
Barry_1066
Member Posts: 77
We had a custom addition to NWNX built for us 10 yeas ago but we no longer use NWNX since it is all Linux. We really need these hooks added to the scripting - date, time, and timestamp - Please and Thank You.
1
Comments
These are very useful for coders - if you are not an advanced coder and do not understand the importance of these hooks - vote for them based on your wish to improve PWs.
adding some scripting examples:
GetSystemDate() Returns the current date in the format (mm/dd/yyyy)
GetSystemTime() Returns current time in the format (24:mm:ss)
GetTimestamp() Returns the number of seconds since midnight on January 1, 1970
the first two are obvious
the timestamp can be used instead of a delay, for when an event does not need to FIRE at a specific time in the future, but instead may be checked to see if a certain amount of time has elapsed
this is quite helpful if you want cooldowns on the order of hours, and not have the cooldown timer messed up due to server restarts or crashes
So a use might be to give a daily player log in perk and once a week give a premimum perk - keeping track of such time is exactly what these calls are suited to accomplishing.
Restocking growing resources for crafting - the timer can be CPU intensive, such time calls can free up the CPU.
With hundreds of plants growing some resource, using the timer to regrow is really not such a good idea.
These script have database application as well - so much more important for PWs than just a small module but if PW are being supported - then very important.
DNA is important to an organism but we do not see it - not without special equipment and procedures mixed with knowledge that most people do not possess. DNA is the coding language of that organism just as code is for NWN. Without some DNA strands, that organism looses functionality - it could be a profound loss of functionality, yet the cause is not well understood.
Code is a special case then - to require a popular vote on code hooks is a loosing battle for these reasons.
The code hooks I propose and a few others have asked for are still not on the Trello and in fact I am not sure there is an appropriate category to place them - where? Under Engine? or what?
I do hope the importance of code enhancement with these and a few other hooks are seriously considered - with no appearance on the Trillo boards however it does not seem so.
If this is not an example of how flawed this suggestion system is, I do not know what is.
I'm not 100% sure what Beamdog can code into the game as "code for coding things", I don't know who would be 100% sure about that kind of thing.
Meanwhile, if there are essential NWNX features you enjoyed and are imperative to the continuing function of advanced persistency features, I would be shocked if they did not make it into a 1.74 version of NWNX.
While it is the case that there are some rudimentary forms of NWNX being released (by mostly an army of one person with an unimaginable amount of other things on her plate to be reissuing code while Beamdog patches every week), Beamdog has not released NWN: EE yet, nor will they be making their own version of 3rd party injection software. That is something we will need to be doing as a community, and it's still kind of weird that they are okay with making it easy for us.
This (essentially 5-business-day old) Trello system is a remarkably different approach than anything I've seen from any other game studio. However, there are a lot of different opinions at present, and it's very difficult for different parts of the community to know which features are and are not massive recodes.
Even if it was not the holiday season, I don't think there is any occasion to rush listings. I think the Trello system will be in continual operation for Beamdog unless it becomes a source of problems instead of a source of inspiration.
So no - NWNX is NOT an option - it broke my world in the past and it will not be relied on again. NWNX is Linux - a platform I choose NOT to use. NWNX does not run my custom plug-in any more anyway so there is no point.
I am looking for Beamdog to add these spell hooks, not to be redirected to NWNX.
The Trello board being new and with the seasonal activities I agree that it might not be getting the attention it will shortly be given - thank you for pointing that out. I agree that the Trello board is unprecedented and is an amazing community resource.
Again, Thank You
There are other systems we were working on for quests - all broken with the loss of these calls with the time stamp - The time calls are not available in NWNX even if we moved to Linux (something I am unable to do with the hardware without a hardware rebuild.
I also, for the same reasons cannot run docker - however if I were to do what is needed to get Linux up and running on my server machine, still NWNX does not have the time calls.
SQL does, I am told have the time calls - and there is a Trello board listing for that being added to base NWN EE - which would be fine - however running SQL or SQL light or any version of it, just for the time calls seems an overkill since we are all NWN DB based and with the exception of these time call, we have had no issues. Yes we have coded some work arounds and coded some DB features that make the NWN DB work better and more efficiently but we choose to stay with NWN DB to not be dependent on other outside programs.
These calls should be very easy to make - easy to do - great benefit to all - these should be considered.
@Balanor
How would you sync that to the actual time? You would need to do that if you want to, say, reset daily quests at a specific time of day.
How would do an extended period cooldown accurately if the server restarts for some reason? Without syncing to the actual time, I don't think you can.
This script is quite lengthy to do something a proper timestamp function could do in one line of code, and it still does sync to real time - something that is quite necessary to properly implement daily quests.