edited October 2017 in Makinom Support
I have a set of bool variables in ORK that trigger daily quests when turned on. Now, I need to switch them off at 7am UTC. Every day.

I've set up a makinom node "Start Timer", there are functions as "Start Time" and "End Time". Switched them both to "Date and Time".

Question is, do I only need to set "Start Time" perhaps? And calculate the offset from midnight to 7am in seconds? Unity and ORK will do the rest?

Thanks for any help
Post edited by Machal on
  • Hm, I don't think that the Timer nodes are what you need to use. They only count down the timer while the game is running, and based on that description I guess that's not really the use case here ...

    You'll probably have to manually check that using variables, e.g. the Time of Day float type (i.e. time since midnight in seconds). I'll add an option to use UTC Time of Day in the next update, as this currently only supports the local time of day.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited October 2017
    Yeah, the timer will have to continue outside of game. Even when it's a mobile game and running in the background, user can shut it down and it may stop. So that can't happen.

    Right, so, can you help me set that up? Because I still don't know how to do that. The only thing it has to do is to trigger "DailyQuestsAdd" bool "On" at 7am. Local time of day is fine.

    And I don't know, if the even should autostart with "New Game" or after the quests, or if it doesn't matter.
    Post edited by Machal on
  • I've set up 2 schematics for you - one to turn on the bool on/after 7am, one to turn off the bool (and set time flags).

    The turning off schematic disables the bool and sets 2 float variables, one for the time of day and one for the date and time.

    The 7am schematic checks if the current time of day is 7am+, and if the time of day it was turned off is below 7am (i.e. quests where finished between midnight and 7am). If that isn't the case (i.e. quests have been finished after 7am), it'll check if the stored date and time is before midnight (i.e. the previous day).

    You can download the schematics here.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited October 2017
    Wow, thanks GiL very much, appreciate it. I'll check it within this and next week and report back if any problems occur.

    Just one little detail-where should these events be put in the game? And should they autostart right after new game or not?
    Post edited by Machal on
  • The dailyQuest7AM schematic could be run by a global machine, Auto checking every second (or minute).

    The dailyQuestOff schematic needs to be used whenever you turn off the daily quest bool, i.e. instead of changing the bool variable, start the schematic which handles this and setting the time flags.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited November 2017
    Err, I think, I can just handle this via ORK. Basically I just need to remove daily quests at 6:59am and add them back at 7:00am. Got inspired by your Makinom events and creates simple Time of Day check, that equals these times and then acts as mentioned above.

    Edit: I've got actually a different problem. In order to refresh my quests at 7am, the game needs to be running in the background. Android holds the game up to max about 5 minutes and then it sort of turns off.

    Can Makinom execute this events even when the game is sort of turned off on the mobile? I have simillar setup on like "energy" resourse that refills by 1 every 5 minutes. Though it stops when game is off...
    Post edited by Machal on
  • No, if the game isn't running, there's no checking this ... that's why the schematics are set up as they are.

    The next Makinom update will add new date/time mechanics by storing it as a string (e.g. '2017-11-13 16:10'), and allowing doing checks on it.
    That should make things easier.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited November 2017
    I see that now...ok, I'll definitely use your schematics then. Just thinking about, how will I set it up. Got about 7 daily quests in ORK. Any of them should basically start the dailyQuestOff Makinom event. In the Finish Requirements of a quest is Finish Game Event feature. Can I put an ORK event there that starts Makinom Machine with dailyQuestOff?

    Also, we will need your help with creating one last schematic for our 'Activity'. It needs to fill by 1 every 5 minutes up to maximum of 50. I have it as currency in ORK, which helps me in many events. So, we will need the event to snap them time after adding every point of it.

    You already helped me in the past to create a "timer" with this Currency http://forum.orkframework.com/discussion/3710/currency-with-time-connection#latest

    But we need more detailed steps, because every point of this currency is very important. If the user logs in after 10 minutes, it should give him 3. After 20min-6. After 30min-9. And this way repeatedly until you get to 50 activity, which should be 250 minutes. The time since last activity add should be made at least with every 10 minutes to keep it as precise as possible. This would be the best way.

    Can you help us with creating this schematic please?
    Post edited by Machal on
  • The ORK-Makinom Connection plugin adds some nodes to ORK, e.g. the Makinom Machine node, which allows you to start a schematic in an ORK event.

    It'd be best to wait for the next version of Makinom - the new string date/time functionality will let you do exactly these kind of things. You'd just store the current date/time in a string variable to set the last activity time - then you can check the difference between the stored value and the current date/time (e.g. check in minutes).
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Well, that's definitely good, I know, but we just planned to release our game this month. So I don't know.

    When will that update be release please? And I guess it will require latest version of Unity?
  • Either later this week or next week - I'll make it a priority to release this week :)
    It'll require the same Unity version as the last Makinom release, i.e. 2017.1.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited November 2017
    We're on 5.6.3 few months now, as we don't also require new update from ORK. And since updating to new unity brings days of rework. But this is mandatory for us, so whatever.
    Thanks for your effort, appreciated.

    When you release it, can you please post the new schematics for the daily quests reset and for activity refill? I can remind you of course by writing here again then :)
    Post edited by Machal on
  • I've updated the daily quest schematics using the new date/time string functionality in Makinom, you can download it here.

    As previously, when finishing the daily quests (turning them off), use the dailyQuestOff schematic. It does the following:
    - sets DailyQuestsAdd to false (bool), i.e. the daily quests aren't active
    - sets DailyQuestsEnd to the current date and time (string), marking when the daily quests ended

    Reactivating the daily quests at/after 7 am, you'll use the dailyQuest7AM schematic (e.g. in a global machine using the Auto type, checking regularly, like every minute or every 10 minutes). The schematic does:
    - check if daily quests are turned off (DailyQuestsAdd being false)
    - checks if the current date and time is 7 am or later
    - checks if DailyQuestsEnd is before 7 am today (or isn't set yet)
    - sets DailyQuestsAdd to true (bool), activating the daily quests
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited November 2017
    gamingislove said: As previously, when finishing the daily quests (turning them off), use the dailyQuestOff schematic. It does the following:
    - sets DailyQuestsAdd to false (bool), i.e. the daily quests aren't active
    - sets DailyQuestsEnd to the current date and time (string), marking when the daily quests ended
    Hmm...I have 6 daily quests...each of them added to the game independently...In that case, the dailyQuestOff needs to be in the very last quest, that counts them all as completed.

    It will not work, in case player just completes half of them. And I can't have dailyQuestOff after every quest, because that would disable the active ones...

    I think the current date and time (string) marker needs to start, when the first quest is activated. It doesn't matter, when they are finished, I don't want them to be removed...

    So, FirstQuestAdd, SecondQuestAdd,....,SixthQuestAdd variables activates quests. I can get activation event that starts the timer only in the First Quest. It snaps the time...Then, when player logs in after 7am, it checks the activation time and compares it to current time...then it re-activates(off/on) all of the activation variables for the quests...

    Can you please rework it to something like this? If this approach isn't right, you can explain and rework it, but I can't think of any other proper way :)
    Post edited by Machal on
  • edited November 2017
    If you can only reactivate the quests when all other quests are done, you'll have to use separate variables to mark them, i.e. instead of DailyQuestAdd you'd have multiple bool variables, or use DailyQuestAdd as an int variable holding the number of active quests. Activating would set it to 6 (for 6 quests), each finished quest would reduce the counter by 1.

    If each quest has its own activation individual from the others, you'll have to set up the mechanic for each quest separately.

    I think I'll need more details on the actual conditions when the daily quests can be reactivated again.
    Post edited by gamingislove on
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.