Skip to content

add CBA_missionTime#273

Merged
Killswitch00 merged 1 commit intomasterfrom
cba_missiontime
Feb 24, 2016
Merged

add CBA_missionTime#273
Killswitch00 merged 1 commit intomasterfrom
cba_missiontime

Conversation

@commy2
Copy link
Copy Markdown
Contributor

@commy2 commy2 commented Feb 23, 2016

BI seems to be unable to make a proper time command that is synched in MP and is correctly resumed in save games, JIP and all that.

This PR adds the CBA_missionTime variable.

pros:

  • based on tickTime
  • set every frame
  • synched in MP/JIP
  • resumes correct value when loading save games
  • multiplied by accTime (SP only)
  • paused when game is paused (ESC menu, SP only)

cons:

  • -1 on clients during preInit (correct value on and after postInit)
  • not linked to ingame day time (faster)
  • ignores skipTime, setDate, timeMultiplier etc. (ingame day time)

Test:
https://gist.github.com/commy2/c01e4885b8961363ef7e
https://gist.github.com/commy2/06de40913799965ba8e5

0 = 0 spawn {waitUntil {diag_log CBA_missionTime; systemChat str CBA_missionTime; false}};

I ran it for 2hrs and the values didn't diverge. (Although it was two game instances on the same machine)

@commy2 commy2 added the Feature label Feb 23, 2016
@nicolasbadano
Copy link
Copy Markdown
Contributor

Looks good to me. This is critical to support things that require timing across save/load games.

Killswitch00 added a commit that referenced this pull request Feb 24, 2016
@Killswitch00 Killswitch00 merged commit 35e85b5 into master Feb 24, 2016
@ViperMaul ViperMaul added this to the 2.3.2 milestone Feb 25, 2016
@thojkooi thojkooi deleted the cba_missiontime branch April 25, 2016 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants