*****Time System Problem*****

Mikv616Mikv616 Member Posts: 28
edited July 2012 in Working with GS (Mac)
So I am making a game in which there is a background that changes at 6pm and 7pm to dusk and from 8pm-5am night time then 6am-10am morning . My issue is when I use the system time i use the rule when game.clock.hour = whatever those hours are I want the image to change, but its only been working with the night time hours. Plus if it isn't that time i put in the otherwise part of the rule change image to day time which will fill in the daytime image into the hours that i did not include.
Thanks hope y'all understand what i asked

Best Answers

  • RThurmanRThurman Posts: 2,881
    Accepted Answer
    Isn't game.Clock.hour on a 24 hour system? This is untested but it probably goes something like:

    When ANY
    -- Attribute: game.Clock.hour < 6
    -- Atrribute: game.Clock.hour > 19
    ---- Change Image To: Night.png

    When All
    -- Attribute: game.Clock.hour > 17
    -- Atrribute: game.Clock.hour < 20
    ---- Change Image To: Dusk.png

    When All
    -- Attribute: game.Clock.hour > 5
    -- Atrribute: game.Clock.hour < 11
    ---- Change Image To: Morning.png

    When All
    -- Attribute: game.Clock.hour > 10
    -- Atrribute: game.Clock.hour < 19
    ---- Change Image To: Day.png
  • RThurmanRThurman Posts: 2,881
    Accepted Answer
    Did you try it? (Notice the difference between "When Any" and "When All")

Answers

  • Mikv616Mikv616 Member Posts: 28
    ACtually I answered my own question Lol i just had to take away the otherwise part :D
  • Mikv616Mikv616 Member Posts: 28
    @RThurman
    You see that was my first mistake that I made. You shouldn't use the less then or more sign because if you do it will include pretty much all the hours if you know what I mean. If you use the equal sign your point towards those exact hours that you would like to have this images appear.
    Such as when Any
    Attribute: game.Clock.hour = 17
    Attribute: game.Clock.hour =18
    change image to dusk
    :D
  • Mikv616Mikv616 Member Posts: 28
    Yup with any it worked :D
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Glad its working for you!
Sign In or Register to comment.