Page 1 of 1

how do i grab the global time from a ongoing campaign?

Posted: Wed Aug 08, 2018 2:59 am
by jaderlemes
sorry if im posting at the wrong section.
i wanna do some stuff with the current date and hour from a campaign, i thought that XComGameState_TimerData was supposed to be that, but it seems to be the timer from missions.
help

EDIT:
nvm found out how:
first you create the variable:

Code: Select all

local TDateTime currentdate;
doing only that gives the date where the campaign started.
but if you add this

Code: Select all

currentdate= `STRATEGYRULES.GameTime;
then it will give you the current date.
you can also get the date in days (currentdate.m_iDay), months(currentdate.m_iMonth) and years(currentdate.m_iYear)

Re: how do i grab the global time from a ongoing campaign?

Posted: Fri Aug 10, 2018 2:37 am
by jaderlemes
nvm for some reason i cant include `STRATEGYRULES.GameTime in the "easier dark events" mod.
Wtf why? but why it works in "Customize UIEventNotice" mod?
wtf did i not include a game file in the code??