Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CBA_missionTime #273

Merged
merged 1 commit into from
Feb 24, 2016
Merged

add CBA_missionTime #273

merged 1 commit into from
Feb 24, 2016

Conversation

commy2
Copy link
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
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