User Tag List

Results 1 to 10 of 10

Thread: How to make a day/night cycle using a timer

  1. #1
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make a day/night cycle using a timer

    Hey folks, i'm messing around with something new and wanted to know if this is possible: how could i set a time system (24 hour) and make it work with day/night cycles? I won't be using real time, it'll be extremely fast, as in 24 hours would pass in about 10 minutes of gameplay. I'm pretty sure i could do the background fade messing with the semi-transparency with the objects, that shouldn't be a problem. But i cant find any good info on how to make a clock work with a game. I've tried the date and time object, but no matter the event i set with it, it always follows my pc's real time, so i'm assuming this is not what i should be using for this application lol. Would a counter object work? and how would i go about recycling the time for 60 mins? I know that i can add an event with "mod /60" and that works good...except it always resets the counter to zero vs adding an hour and counting another 60 and so on.

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    1,759
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    The regular timer object should be enough. Here's a simple example. It uses the timer object, plus an active object to store the number of days passed. This example uses 1 real second=1 game hour, so obviously you'd need to adjust the numbers to get your 10 real minutes = 1 game day scenario. And you'd need to build on the code if you wanted to also keep track of minutes, etc. But hopefully it helps.
    Attached files Attached files

  3. #3
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's great Volnaiskra, thanks for the example i was actually just messing with a similar setup. I have a giant clock as an active, with the minute/hour hands separate, and a counter that follows the hour hand's current angle. Then i'll be adjusting the transparency based off of the current hour hand's angle to adjust. Thanks again!

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also made a clock widget for you. Just drag and drop the active into your game and it should work automatically. It could also be edited for 24 hours, sorry I made it a 12 hour AM/PM clock.

    I also added an analog clock example with the clock hands rotating.
    Attached files Attached files

  5. #5
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sumo, that's awesome! That's exactly what i need man, thanks! How would i go about speeding it up even further? I know it's basically set for 1 sec = 1 min, but how would i increase that speed? Thanks again!

  6. #6
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just updated the file too, so check that out again.

    Under the clock active's behaviors, you would go to to the "changing clock time" group. On line 4, it's the Always condition to add a second to the "Seconds Time" alterable value. Instead, switch it so it always adds 1 to the "Minutes Time" alterable value. Or if that's too fast, you can add a timer event instead of the always to slow it down but it adds to the minutes instead of the seconds so its still faster overall. Then you can right click and disable line 5 of the events which tests when the seconds reach 60 to add a minute to the Minutes Time alterable value.

    Or you can just add more than just 1 second at a time to the clock. Adding 2 seconds Always would make it go twice as fast. You can switch out the Always for a timer event and add more than 1 second as well. It's just about finding the right balance for your in-game time.

  7. #7
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome, thanks again dude!!

  8. #8
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, changing to a 24hr format was super easy, all i did was change the behaviors from "Clock = 13" to "Clock = 24" and added the "Toggle Internal Flag 0" like in the previous event. Worked just fine!

  9. #9
    No Products Registered

    Join Date
    May 2017
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice information. I am new here, please can anybody help me with animal adaptation game. patugwu@ymail.com Please!!

    Sent from my TECNO-Y4 using Tapatalk

  10. #10
    No Products Registered

    Join Date
    Jan 2017
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can I use this?

Similar Threads

  1. Day to Night Cycle effect
    By DaveC in forum Fusion 2.5
    Replies: 5
    Last Post: 11th January 2016, 01:50 AM
  2. Replies: 7
    Last Post: 6th October 2015, 04:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •