Author Topic: [question/suggestion] How to get monthPassed?  (Read 552 times)

Offline Kozinsky

  • Colonel
  • ****
  • Posts: 128
  • Sorry for my bEd English
    • View Profile
[question/suggestion] How to get monthPassed?
« on: September 10, 2024, 01:29:50 pm »
I want to know how many months have passed since the game started (the “monthsPassed” parameter from the save file). As far as I understand, it is currently impossible to know this and I propose to add a new operation that will read this parameter from the game. For my purposes, I just need to know this parameter, although someone may need to change it:
Code: [Select]
Script operations:
Name: GeoscapeGame.getMonthsPassed            Args: [ptr GeoscapeGame] [var int]
Name: GeoscapeGame.setMonthsPassed            Args: [ptre GeoscapeGame] [int]

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3346
    • View Profile
Re: [question/suggestion] How to get monthPassed?
« Reply #1 on: September 10, 2024, 03:36:04 pm »
Ok, I can add `getMonthsPassed` with set is bit diffret as this could mess up other parts of engine (as it could derail mission scripts and events generation)

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9076
    • View Profile
Re: [question/suggestion] How to get monthPassed?
« Reply #2 on: September 10, 2024, 11:38:23 pm »
mission script and event generation would be "just" confused, but other parts (e.g. Graphs, Monthly funding, etc.) would straight up be corrupted and crash... `setMonthsPassed` is not something that can be exposed

`getMonthsPassed` is ok

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3346
    • View Profile
Re: [question/suggestion] How to get monthPassed?
« Reply #3 on: September 11, 2024, 01:09:49 am »
ok, thanks for confirmation, I did not yet check this part of code to see how critical this value is.