Page MenuHomeFeedback Tracker

Make serverTime return something in SP, or add unified SP/MP global time command
Feedback, NormalPublic

Description

If you want to do calculations based on a global time point, in MP you have to use serverTime, since time and diag_tickTime return client-specific times that would be wrong if used on other machines. However, serverTime always returns 0 in SP, so code that needs to work in both SP and MP has to do something like ([time, serverTime] select isMultiplayer) in order to have a useful value in both contexts. That's clunky and annoying.

So, it would be helpful if serverTime would automatically report the time or diag_tickTime when used in SP, so the same command could be used in all contexts. If that's not backwards-compatible, then a new command could be added that has that functionality, like globalTime or something.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting
Additional Information

netId has a similar issue. There is BIS_fnc_netId, but it would be better if this was native rather than requiring a function to do it.

Event Timeline

NikkoJT created this task.Jun 16 2024, 4:26 PM
dedmen set Ref Ticket to AIII-56447.Jun 27 2024, 10:36 AM
dedmen changed the task status from New to Feedback.Jul 4 2024, 5:51 PM
dedmen added a subscriber: dedmen.

([time, serverTime] select isMultiplayer)
Would not be correct. serverTime is always increasing at constant speed and counting from server/game start, like diag_tickTime.
time can be paused, or accelerated

serverTime in SP will be diag_tickTime
and netId and objectFromNetId/groupFromNetId will also work in SP