2 Questions dealing with TIME...

Hey all I've got two questions I'm hoping you can help me with.

1.) I want to be able to alert the player to how long they've played the game (when they lose). So Obviously there needs to be some kind of trigger when they hit the PLAY GAME button, and then read out the time when the LOSE THE GAME. More importantly, whatever solution you provide, can you tell me how much of a hit my game will take performance wise from the solution. I'm hoping for a very low impact solution. I.E. not something that is constantly constraining (if possible).

2.) How would I make something like a laundry timer. Give you an example. Let's say I go to a laundromat and I put my clothes in. The current time is 12:15. Let's say my app helps you know when to return to pick up your clothes. So let's say the laundry machine says 45 minutes. Well, you'd be able to enter in 45 and then the app looks at the current time (12:15) and then says "come back at 1" Don't worry I'm not asking how to make alerts, or how to display text, etc. that says when to come back. I'm strictly talking about the code. A code that knows how to deal with minutes and seconds, and add or subtract that from the current time.

Thanks so much you all!

Best Answer

  • SocksSocks London, UK.Posts: 12,822
    edited January 2013 Accepted Answer
    If my question is- how can i get a time in and time out marker- then the answer you gave wasnt an answer (as i have no control-which i need over it).
    There's no need for us to hypothesise about what your question was ('if it was this . . or if it was that . . . '), it's right there in your first post:

    " . . . I want to be able to alert the player to how long they've played the game . . ."

    My answer ("Just use Game.time") is perfectly valid.
    It also didn't answer the second part of the question (laundry question).
    I wasn't addressing the second part of your question, but generally speaking I'd assume that pointing out that you can use game.time to measure time would answer all these related questions - with a little work from your end.

    But I'll spell it out in simple terms:

    Record the start time into an attribute.

    When the game is over subtract the start time from the current time.

    The result is how long it's been since you recorded the start time.
    I'll try and find my answer in another way.
    The way you are doing it is perfectly good, ask questions here, I'd just avoid getting pissed off if you don't like the tone of an answer or feel the person who took the time to reply hasn't made enough of an effort for you.

Answers

  • gamesfuagamesfua Member Posts: 723
    Anyone?
  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2013
    I want to be able to alert the player to how long they've played the game (when they lose).
    Just use Game.time

    You have been playing for . . .
    Game.time
    . . . go get a life.
    how much of a hit my game will take performance wise from the solution.
    None, nothing, zero, zilch. The clock runs whether you use it or not, so there is no performance hit.


  • PaxPaxPaxPax Member Posts: 106
    Socks you are hilarious!!
  • gamesfuagamesfua Member Posts: 723
    Thanks! Haha. Okay but how would I start and stop the gametome?
  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2013
    Thanks! Haha. Okay but how would I start and stop the gametome?
    Never start or stop the Gametome, if you do the universe will collapse in on itself, only the ancient wizards of Gameland have the power to temporally manipulate the Gametome.

    Seriously, it starts when the game starts - and you can't stop it (although the wizards can), but why would you want to stop it anyway ? The 24 hour clock we use every day is good enough to time the world around us and events within it and we never need to stop that to measure time.
  • PaxPaxPaxPax Member Posts: 106
    This might help---create a time attribute...see link below. I think, but I am a newbie, that Socks would not be concerned about the world ending. Remember I am a newbie but I hope this helps.

    http://forums.gamesalad.com/discussion/52371/reset-gametime-and-gamecounter-to-zero#latest
  • SocksSocks London, UK.Member Posts: 12,822
    This might help---create a time attribute...see link below. I think, but I am a newbie, that Socks would not be concerned about the world ending. Remember I am a newbie but I hope this helps.

    http://forums.gamesalad.com/discussion/52371/reset-gametime-and-gamecounter-to-zero#latest

    You fool, you will get everyone killed with your crazy ideas.
  • gamesfuagamesfua Member Posts: 723
    @socks im not entirely sure why you're going to great lengths to not answer the questions. Perhaps theyre not good questions. Perhaps theyve been answered a hundred times before. Whatever the case is, its clear you have little to no interest in helping. Thats fine. You mentioned gametime. Great. But i dont know how to start and stop it, nor do i know how to get data from it (i.e. my 2nd part of the question- the laundry timer difference). Its clear im not of the same skill level. Im beginner. Can anyone else take a look at my post and help me out- sans sarcasm and endless replies without any form of resolve. @PaxPax thanks for the effort- funny enough that was me who replied to that post. However im trying not to use a timer. But many thanks again!
  • gamesfuagamesfua Member Posts: 723
    To be as specific as i can, i need a way to mark a time in and a time out. @socks was kind enought o suggest game.time. Okay, so how can i manipulate that and start and stop it as i please? Secondly, how can i subtract or add time to a clock? Meaning (as mentioned in my first post)' if i have laundry and it is 12:15, and i say the laundry will take 45 minutes, how can i code it so the app can tell me "come back at 1." This is an addition code obviously but its following the rules of a clock. Any thoughts. Thanks! :)
  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2013
    @socks im not entirely sure why you're going to great lengths to not answer the questions. Perhaps theyre not good questions. Perhaps theyve been answered a hundred times before. Whatever the case is, its clear you have little to no interest in helping.! Thats fine.
    You asked a question and only one person took the time to answer (that was me) - and the result is this mildly petulant admonishment !?

    P.S (love the 'that's fine' bit on the end) : )

    image
    You mentioned gametime. Great. But i dont know how to start and stop it, nor do i know how to get data from it.
    I answered the question, but I will repeat it here for you:

    "it starts when the game starts - and you can't stop it "
    Can anyone else take a look at my post and help me out- sans sarcasm and endless replies without any form of resolve.
    There was no sarcasm in my posts, there was humour, any interpretation of sarcasm was entirely yours. There are no 'endless replies' - I replied to you twice, both times answering your question, I also replied to PaxPax (once) with a humorous reply.

    You need to chill out a little, people aren't here to jump to your every whim (or anyone else's), people answer questions and help out because they like to, out of the kindness of their hearts - it seems like you feel you have the right to have your questions answered promptly and in the style you are accustomed to, free of humour.

    ?

    Would you like me to remove my post to Paxpax, and edit out the humour in my two replies to you, I can do so if it would make you feel better, no hassle, 30 seconds work ?
  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2013
    To be as specific as i can, i need a way to mark a time in and a time out.
    Record game.time into an attribute - and then reference it.

    You can also reference the target device's clock (Hour / Minute / Second).
    how can i manipulate [game.time] and start and stop it as i please?
    You can't start or stop game.time.
    how can i subtract or add time to a clock?
    Just use basic maths, game.time is measured in seconds so you want to be looking at [divide by] 60 for minutes.

    Or . . use the device's own clock and apply basic addition / subtraction from your stored start time.
  • gamesfuagamesfua Member Posts: 723
    edited January 2013
    Not here to fight. I've never assumed anyone should answer my questions. I've posted a million times and never have been greedy with getting answers. If my question is- how can i get a time in and time out marker- then the answer you gave wasnt an answer (as i have no control-which i need over it). If the question is about a means to control time in/time out, then ""it starts when the game starts - and you can't stop it " doesnt help me. Its not an answer. It also didn't answer the second part of the question (laundry question). I would have said, "i dont know try to use a TIMER." I would try to help as best i could or id just let someone else help. Its clear there's a lot of miscommunication here and i have no desire to cause any problems. @Socks you're usually a phenomenal asset to these forums so im going to just say its clear im missing something. So i'll say thank you. I appreciate your efforts and i generally find your humor very funny. I'll try and find my answer in another way. Thanks.
  • gamesfuagamesfua Member Posts: 723
    There's a clear miscommunication going on here. I really do appreciate your time @socks! Thank you. I'm sorry if i miscommunicated with you. Not my intent. All is well. Thank you sincerely :)
  • gamesfuagamesfua Member Posts: 723
    P.S. @socks where the hell did you find that photo of me?! Not cool! I only wore that pink dress once... Okay maybe twice or five times- WHATEVER! Not the point! Don't be stealing pictures of me in the future! ;)
  • SocksSocks London, UK.Member Posts: 12,822
    P.S. @socks where the hell did you find that photo of me?!
    From one of the ancient wizards of Gameland.
  • PaxPaxPaxPax Member Posts: 106
    I am crushed!!! I just started on gamesalad, no experience with this type of thing. I have had a number of people help me and was feeling like a LEECH. My first attempt at adding value and I screw up. Too funny!!!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Here are a couple of videos that might help:

  • gamesfuagamesfua Member Posts: 723
    @RThurman thank you so much for that. Really really helpful. Can't thank you enough. That is a good start to me figuring out how to do all of this. Again, many thanks :)
Sign In or Register to comment.