Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001501Zandronum[All Projects] Suggestionpublic2013-09-12 08:302014-06-16 08:57
Reportermifu 
Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
StatusclosedResolutiondenied 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001501: ACS - Ablity to Get the system date from the server/client and use it in a script
DescriptionI would like to request a feature that can be useful for mappers. Wondering if it is possible to allow ACS to be able to query the Server Box or the clients machine for the system date on the box then use that to allow the script to do stuff based on the date (so like ROTT style stuff however using it to do things in game rather then pretty custom screens like ROTT has)

For example, a use for this could be.

if (Get_Date() == Date)
then
Changemap blah
else
Changemap nextmapinmapinfo

This will allow mappers to create secret levels and make them only accessible depending on the date or even allow map changes if it is a certain date.

Suggestions on how to implement this would be making a command on zandronum to query the box that the server (or the game) is running on for the date, then allow ACS to use it as a function (like Get_Date() or something) so ACS can pull it down and use it as a value.

Attached Files

- Relationships

-  Notes
User avatar (0007174)
Xsnake (reporter)
2013-09-12 15:29

More than an ACS function, a Cvar that returns the local time of the client/server (depending on which side the GetCvar function is called) would be nice, if it doesn't exist already. This would allow modders to build custom random functions based on the current time.
User avatar (0007175)
Blzut3 (administrator)
2013-09-12 16:27

No.

'http://forum.zdoom.org/viewtopic.php?f=18&t=24327 [^]'
'http://forum.zdoom.org/viewtopic.php?f=18&t=25708 [^]'

Also, I'm not sure what RNG algorithm you're going to implement in ACS that works better than the Mersenne twister algorithm that random() uses. If it's not working properly there may be an issue elsewhere.

Net demo sync could also be destroyed if used in client side scripts.
User avatar (0007180)
Edward-san (developer)
2013-09-12 19:26

Why don't you make a modded sv_periodoftime which you can set in console and its value is read inside ACS?
User avatar (0007183)
mifu (reporter)
2013-09-13 04:39
edited on: 2013-09-13 04:42

I do not see why graf No'ed this apart from the "abuse" he thinks people will use it for.

It honestly does not need to be advanced, It would just be good if Zandronum can just get the date. (It does not need the time) and use that to either run checks to see what to do on a map in terms of behavior either as a cvar or anything really.

It does not even have to work client side either. For example, decide which map to go to in multiplier if it is on a certain date.

User avatar (0009497)
Watermelon (developer)
2014-06-16 00:18
edited on: 2014-06-16 00:19

We talked a lot on IRC about the solution to this. If we introduce access to system time, it is possible for a coder to add in ACS which will make wads not work before/after/at a certain date. This resulted in an automatic no.

All is not lost, it is possible to sum up the number of tics to get a unique time (knowing that 1 tic is 28 ms, you can go from there). You could set a default time in game and also go from there.

Blzut also said that there may be a way to get the time from when the database was created, which would exclude ACS being used to mess with a wad (and thus give you your time mechanism).


Therefore, if you're interested in the above and want to pursue a different route with this ticket, post to unlock this topic.

User avatar (0009499)
mifu (reporter)
2014-06-16 00:52

I think we can pursue a different route as watermelon explained.
This should be good.
User avatar (0009501)
Blzut3 (administrator)
2014-06-16 02:01

To clarify I didn't say you could get the time from the database. I said that you could accumulate the time using the database in order to store the amount of time that passed in the world across server starts. Which is all you need for some real time system. If you manually input date, you could put time easter eggs in.
User avatar (0009503)
Watermelon (developer)
2014-06-16 03:15
edited on: 2014-06-16 03:16

Sorry for my misinterpretation. I need to stop speed reading (fatal flaw of mine).





Therefore Mifu how I'd do it is:

Script loops until the level exits (use UNLOADING or something), and sum up the number of tics with Timer().

Multiply this by 28 to get how many milliseconds has passed. If you have an intermission screen, add on some time (right now there is no way AFAIK to count how many tics passed during the intermission screen, this could go in another ticket).

Another solution would be to allow ACS modders access to the 'gametic' integer, which *should* be incremented during intermission.

A possible issue is if the server locks up when no one is in. I'm unsure if gametic still gets +1'd or not when no human is in the server.



This is where we have to go from here.


The last step is writing a near exact time in the database and then adding it to that, thus giving you a virtual time. It probably won't be perfect, but could be reasonable.

User avatar (0009504)
mifu (reporter)
2014-06-16 03:17

Yea that should be fine Blzut3. :)

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: Xsnake Toxicity mifu
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2013-09-12 08:30 mifu New Issue
2013-09-12 15:29 Xsnake Note Added: 0007174
2013-09-12 16:27 Blzut3 Note Added: 0007175
2013-09-12 19:26 Edward-san Note Added: 0007180
2013-09-13 04:39 mifu Note Added: 0007183
2013-09-13 04:42 mifu Note Edited: 0007183 View Revisions
2014-06-14 17:57 Watermelon Note Added: 0009338
2014-06-16 00:18 Watermelon Note Added: 0009497
2014-06-16 00:18 Watermelon Status new => closed
2014-06-16 00:18 Watermelon Resolution open => denied
2014-06-16 00:18 Watermelon Note Deleted: 0009338
2014-06-16 00:18 Watermelon Note Edited: 0009497 View Revisions
2014-06-16 00:18 Watermelon Note Edited: 0009497 View Revisions
2014-06-16 00:19 Watermelon Note Edited: 0009497 View Revisions
2014-06-16 00:52 mifu Note Added: 0009499
2014-06-16 00:52 mifu Status closed => feedback
2014-06-16 00:52 mifu Resolution denied => reopened
2014-06-16 02:01 Blzut3 Note Added: 0009501
2014-06-16 03:15 Watermelon Note Added: 0009503
2014-06-16 03:16 Watermelon Note Edited: 0009503 View Revisions
2014-06-16 03:16 Watermelon Note Edited: 0009503 View Revisions
2014-06-16 03:17 mifu Note Added: 0009504
2014-06-16 03:17 mifu Status feedback => new
2014-06-16 08:57 Dusk Status new => closed
2014-06-16 08:57 Dusk Resolution reopened => denied






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker