AM/PM switching

Hi everyone, I've been working on making a 12 hour game clock. I have it set up so that every second equals a minute in the game world. The clock works just fine, I've just been having trouble getting the AM to change to PM. I have it set up right now so that every time clock reaches 12:00, add one to "ampmcounter"(counter starts at one). Im trying to set it up so that when ever the ampm counter is an even number, my boollian attribute "even" is set to true, which in turn changes a text attribute i have to PM. Can anyone help me with the code to identify the number in the ampmcounter as an even number in an attribute rule(or offer some alternative). Thank you.

Comments

  • PixelPunPixelPun Member Posts: 324
    Yeah, I did this for a game a while back.. But it only involved a 12 hour cycle and not Am and PM. You could make 2 different counters one that is AM and one that is PM. When the PM counter is done, then it switches to the AM counter, when the AM is done it switches to the PM and so forth...
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited April 2013

    Hi @brice2109@me.com

    Not sure how you've got your attributes set up, so a bit of a guess, something along the lines of:

    Display Text WhichSide

    When attribute MyHour =12 and MyMin = 0
    Change Attribute MyHour to 0
    When AM is false
    Change Atribute WhichSide to AM
    Change Atribute AM to true
    Otherwise
    Change Atribute WhichSide to PM
    Change Atribute AM to false

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • RPRP Member Posts: 1,990
    What a horrible night to have a curse.
  • ericzingelerericzingeler Member Posts: 334
    You can use modulus to determine odd and even:

    if 1 = [gametime]%2
    change to odd

    if 0 = [gametime]%2
    change to even
Sign In or Register to comment.