Hello there, another question. What the title says. What does this do? I found this in the game’s code.
a.isLaterOrEqualThan = function(a, c, b) {
var e = this.getCurrentDate();
return e.year > a || e.year === a && e.month > c || e.year === a && e.month === c && e.week >= b
};
a. is
var a = Company.prototype;
I don’t know the rest, so I can’t know what a, c, b are. Maybe it’s year, month, week? Please answer, and if it’s possible to be put into an api mod, many thanks.
@tmch in C t he program dont work without semicolons but in javscript it sems you dont need it @FireChaos i don t know how the research system works but probably you can add a condition that only add the research when it s true. Look the other mods code or the game code how they did. Now i can 't have acces to my computer i can t help you more.
isLaterOrEqualThan(15, 5, 2) will tell you whether the current date is on or after the second week of the fifth month of the fifteenth year. Possibly need to -1 each of them, can’t remember if dates in GDT are zero based atm.
You might use this a trigger for one of your events. If you wanted to have a chance for the player to win a competition from year 20, you might have a trigger function like so:
Because it is on the Company prototype, you need an instance of company to actually call the function. (If you tried to COmpany.prototype.isLaterOrEqualThan it would complain about missing getCurrentDate() )
Thanks for that, but can it be used with researches? I hope so. So we can trigger a research much like Achievements or Save to cloud which are able to research with that same thing.