InfinityAlex Posted December 11, 2013 Report Share Posted December 11, 2013 Hey, so I'm implementing real time backgrounds in my fangame (testing it with the title screen for now) using the clock thing in MMF2, but it doesn't work. I've basically got it set to change the background if the time is greater than 17:59:59:99, but the bg doesn't change. Help, please? Link to comment Share on other sites More sharing options...
GSF Posted December 11, 2013 Report Share Posted December 11, 2013 What do you mean by changing the background? Are these active objects? Backdrop objects? Remember that backdrop objects can't be manipulated in the event editor. You should use Active System Boxes for better control options. Also, before trying that make sure that your logic is fine - set some string object and set it to "Day", "Night" or whatever depending on the time. I think LH (luksamuk) did something like this with one of his projects - he might have an idea. Link to comment Share on other sites More sharing options...
InfinityAlex Posted December 11, 2013 Author Report Share Posted December 11, 2013 Yeah, I'm using an Active. I'll track down LH to see if he can help. Thanks! Link to comment Share on other sites More sharing options...
Serephim Posted December 11, 2013 Report Share Posted December 11, 2013 Not sure what you're trying to do, but if you're trying to have an effect based on game time (instead of real time) then you might not want to use MMF's clock feature, because framerate issues will cause inconsistencies. Link to comment Share on other sites More sharing options...
Mr. Potatobadger Posted December 12, 2013 Report Share Posted December 12, 2013 i think internal clock things should be avoided altogether, for the reason serephim said, and for this: We (zigzax and I) were originally going to have a level in my game where depending what time of day you played depended on whether or not you played in a desert or an icecap. Well, if it worked like that, it would be rare to play in whatever the opposite zone is for you. And that would suck. I guess you could have a S3 like easter egg where if timer is greater than 43:00 fuck up the music 1 Link to comment Share on other sites More sharing options...
Jassbec Posted December 12, 2013 Report Share Posted December 12, 2013 How about using "Always" or "Every X seconds" and "Add" a global value? If global value "timeofday" = X, then change background/animation, etc. (you're free to put any events here, btw.) 1 Link to comment Share on other sites More sharing options...
GSF Posted December 12, 2013 Report Share Posted December 12, 2013 From what I understand, this is a real time day/night system kind of implementation, not an in-game counter such as Sonic "getting out of here" when you stand idle for minutes in Sonic CD. There's a Date/Time object that can properly retrieve time along with timezone. Use the compare two general values condition to evaluate whatever the D/T object pumps out. That should cover any time checks that need to be done. Link to comment Share on other sites More sharing options...
luksamuk Posted December 12, 2013 Report Share Posted December 12, 2013 I believe I already lost the files of Sonic Phoenix, but I remember that I implemented this using the Date/Time object, yes. It gets your current hour. Also I had to make it mandatory for the player to input its timezone. Perharps there might be a way to grab it from somewhere, but I'm almost certain you can't. Then all I did was calculate the current hour of the level using all the data I got. So it wasn't really real-time, it only calculated the local time of the level in hours, then a certain background would become visible in the beginning of the level accordingly. Nothing really special. I think the biggest job is to find matching backgrounds/recolors for each time you want to set. If you have HWA, I believe you can also write a shader and input the current hour to set the backdrops' coloring. Never tried that, though. Link to comment Share on other sites More sharing options...
DimensionWarped Posted December 12, 2013 Report Share Posted December 12, 2013 Why should the player's time zone matter if you can just get the hour (the hour they have set on their clock that is) from the system clock in the first place? This is a very simple problem. Figure out the hour using the calender or date/time object. Create the actives based on the hour. Make sure they are positioned correctly. Done. I'll whip up a tutorial when I get home if you haven't solved this by then. Link to comment Share on other sites More sharing options...
luksamuk Posted December 12, 2013 Report Share Posted December 12, 2013 Why should the player's time zone matter if you can just get the hour (the hour they have set on their clock that is) from the system clock in the first place? This is a very simple problem. Figure out the hour using the calender or date/time object. Create the actives based on the hour. Make sure they are positioned correctly. Done. I'll whip up a tutorial when I get home if you haven't solved this by then. In SPhoenix, the levels were in real places of the world, so they had their own timezone. This is why I had to make this kind of calculation. But surely, you're right. This is a simple problem. Link to comment Share on other sites More sharing options...
InfinityAlex Posted December 12, 2013 Author Report Share Posted December 12, 2013 And I'm a simple mind. I've tried the clock item, but for some reason the background just doesn't change. Waiting on Winnie to get that tutorial done when he's ready... Link to comment Share on other sites More sharing options...
GSF Posted December 12, 2013 Report Share Posted December 12, 2013 Again, I think the problem lies in your actions that determine the BG change, and not your time checking logic. Have you tried to do something like change a counter, or alterable string depending on time? Does it work? Link to comment Share on other sites More sharing options...
DimensionWarped Posted December 13, 2013 Report Share Posted December 13, 2013 And I'm a simple mind. I've tried the clock item, but for some reason the background just doesn't change. Waiting on Winnie to get that tutorial done when he's ready... ... The background doesn't change itself obviously. If you want the time to be able to change in realtime, you are going to have to poll for the time again and set everything up again. Right now I'm focusing entirely on getting it set up without making any attempt to clean it out and replace it as the time updates. Here is a basic (very basic) example. You can figure out how to evolve it from there. For instance, you could crossfade two backdrops using alpha levels based on how far between the time is from the starting levels of a given time. You could also add continual polling and reset the backdrops whenever the time changes. There are lots of ways you could improve this example to make something more organic. system_time_sets_background.mfa Link to comment Share on other sites More sharing options...
InfinityAlex Posted December 13, 2013 Author Report Share Posted December 13, 2013 Thanks a lot, DW! Link to comment Share on other sites More sharing options...
Recommended Posts