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

For technical discussions and help
jaderlemes
Posts: 15
Joined: Sat Sep 23, 2017 11:13 pm

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

Postby jaderlemes » Wed Aug 08, 2018 2:59 am

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)

jaderlemes
Posts: 15
Joined: Sat Sep 23, 2017 11:13 pm

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

Postby jaderlemes » Fri Aug 10, 2018 2:37 am

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??


Return to “Modders' Forum”

Who is online

Users browsing this forum: No registered users and 0 guests