Forums » General Questions » Making an event trigger on a certain date

1
I'm trying to make an Actor load on a specific date, but I can't get it to work. Say I want an actor to load ONLY on Halloween (October 31st), so I have this:

LoadActor("2previewframe.png")..{

InitCommand=cmd(draworder,99999999;x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;);
SetCommand=function(self)
if (DayOfMonth() == 31 and MonthOfYear() == 10) then
self:visible(true);
else
self:visible(false);
end
end;
};


However this doesn't seem to work. What can I do?

Last edited: 31 October 2016 3:28pm

~Santikun
Reply
Basic information gathering: If you print the number returned by MonthOfYear() to the log file or on the screen, what value do you see?
Try that, and you'll probably figure out why your logic isn't doing what you expect.
< cybik> til Kyzentun fixes bugs for breakfast
--
< maxvg1> shakesoda: then why do i still play lol
<@shakesoda> because you're an ITG player. And thus, a masochist
--
<@shakesoda> Kyzentun: I think you might need to put down the meshes for a bit
Reply
Basic information gathering: If you print the number returned by MonthOfYear() to the log file or on the screen, what value do you see?
Try that, and you'll probably figure out why your logic isn't doing what you expect.


I don't think I understand what you mean. How do I "print the number to the log file"? Also, sorry if this sounds bothersome, I recently started learning lua and most of the useful doc websites were shut down.

Last edited: 5 November 2016 9:44pm

~Santikun
Reply