Another Device Time Question...

digitalzerodigitalzero Member, BASIC Posts: 639
edited December 2016 in Working with GS (Mac)

im trying to wrap my head around this i swear and thanks so much for everyone who responded in the last message i posted about the last question i had...

now im using the device time to determine if its night day or dawn but what im not figuring out is getting the image right when its between two numbers... hopefully im explaining this right

for instance... for the morning i want it between 5am until 5.59pm

evening from 6pm until 8.59 pm

and night between 9 am until 4.59am

its just really difficult because i didnt see anything in the attributes that referred to time and minute... and i dont want the hours to overlap just in case the person gets to the scene at exactly 5am i dont want it to conflict with the night and the morning image...

hope im explaining this right

thanks for being awesome and patient with me everyone!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • digitalzerodigitalzero Member, BASIC Posts: 639

    @Socks that makes absolutely no sense to me whatsoever... how would that even look in a rule?!?! i know basic math but i dont know anything about sin cos tan and all that type of stuff... especially "floor" and whatnot.. what the heck... floor is like what looks like on the ground

  • SocksSocks London, UK.Member Posts: 12,822
    edited December 2016

    @digitalzero said:
    @Socks that makes absolutely no sense to me whatsoever... how would that even look in a rule?!?! i know basic math but i dont know anything about sin cos tan and all that type of stuff... especially "floor" and whatnot.. what the heck... floor is like what looks like on the ground

    From what I can tell you are responding to a post by @gyroscope from two years ago ? I've made no posts in this thread, and the only post I made in the thread @tatiang linked to contains no 'cos' or 'sin' or 'tan' or even 'floor' !!??

    Your questions only continue to get more mysterious :D :)

    All these maths terms are pretty straightforward, you can learn them all in an afternoon, for example floor simply rounds a number down ('down' hence 'floor', get it !).

    So floor(23.64) will give you 23.
    And floor(1.109) will give you 1.

    And the opposite of 'floor' is . . . . [drum roll] . . . . 'ceiling' !! And as you might guess ceiling rounds numbers up (in GS you use 'ceil' for ceiling).

    So ceil(23.64) will give you 24.
    And ceil(1.109) will give you 2.

    . . . . . . . .

    As for your original question, why not simply have a rule that says . . .

    When clock.hour = 5 change image to A
    When clock.hour = 18 change image to B
    When clock.hour = 21 change image to C

  • digitalzerodigitalzero Member, BASIC Posts: 639

    Thanks. @Socks you always make me feel so stupid lol I love it though thanks for dealing with me in these threads lol!

  • digitalzerodigitalzero Member, BASIC Posts: 639

    But @Socks.how would that rule work? Because what if the clock hour is 4? That's kinda my problem

  • SocksSocks London, UK.Member Posts: 12,822

    @digitalzero said:
    Thanks. @Socks you always make me feel so stupid lol I love it though thanks for dealing with me in these threads lol!

    My intention is never to make you feel stupid ! It's just that a lot of these sorts of questions are - I suspect - overthought, the answers are often more simple that you might suspect, if anything I'd say you are not being stupid enough, I put a lot of time into being stupid :) getting the simplest most basic answers to common issues.

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2017

    @digitalzero said:
    But @Socks.how would that rule work? Because what if the clock hour is 4? That's kinda my problem

    You've lost me already :smile:

    I'm not sure what the question means ?

    . . . . . . . . . . . . . . . . . . . . . . . . .

    how would that rule work?

    The rule would work like this:

    When the time gets to 5am the image will change to image A
    When the time gets to 6pm the image will change to image B
    When the time gets to 9pm the image will change to image C

    Because what if the clock hour is 4?

    Can you say what the problem is that you think might happen if the clock hour is 4 ?

  • digitalzerodigitalzero Member, BASIC Posts: 639

    It wouldn't know which image to change to because its not exactly equal to 5 you know what I mean... So should it be if clock.time is equal or greater?

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2017

    @digitalzero said:
    It wouldn't know which image to change to because its not exactly equal to 5 . . .

    Here are some instructions . . .

    At 3 o'clock take the red pill.
    At 6 o'clock take the blue pill.
    At 9 o'clock take the green pill.

    . . . Question: which pill do you take at 5 o'clock ?

  • digitalzerodigitalzero Member, BASIC Posts: 639

    @Socks no pills?... right?

  • digitalzerodigitalzero Member, BASIC Posts: 639

    and what if i have an image that overlays it to show shadow but i only want it to come in at night... how would i make that happen... i can give you an example... or attempt lol.... i have an image labeled "dark" i want it to only show up on the scene when its at night but when its in the morning i want it to leave...

  • digitalzerodigitalzero Member, BASIC Posts: 639

    because i cant get it inbetween two numbers you know what i mean
    it cant go from 21 to 5 because it has to go from small to large.... i think

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2017

    @digitalzero said:
    @Socks no pills?... right?

    Yep, there’s no instruction to take a pill at 5 o’clock, so there would be no reason you’d take a pill at 5 o’clock !

    So, returning to the question:

    When clock.hour = 5 change image to A
    When clock.hour = 18 change image to B
    When clock.hour = 21 change image to C

    Q: "how would that rule work? Because what if the clock hour is 4?"

    There is no rule that checks whether the clock hour is 4, so nothing will happen at 4.

  • digitalzerodigitalzero Member, BASIC Posts: 639

    @Hopscotch i thought we could only do it if its from low to high... oh and also @Socks thanks so much for schooling me!

Sign In or Register to comment.