How do I implement a simple daily retention mechanic?

Hey ladies and gentlemen!

I’m wanting to implement a daily retention mechanic.

When the player opens my game, it will get the current date (and time if need be) and if “day of the week” == “buttons assigned day of the week” then the button becomes active and allows the player to add an item to their inventory. Once the item is received then the button is deactivated until the buttons assigned day of the week matches the current day of the week.

I know how to add the items to the inventory and work the UMG part out just fine.

However, my issue is that I can’t access “GetDayOfWeek()” through blueprints (and my C++ is not the greatest). So instead of assigning a simple “Text==Text=Outcome” scenario, I’m left with Integers.

Is there a way to get the days of the week as just numbers 1-7 (or 0-6) either via a node or an equation so i can perform “int == int = Outcome” for a 7 day week?

The Now-Node will recieve the PCs current time as a struct, UTCNow-Node will get the current UTC Time and then replicate one of the algorithms to math it in blueprint like:

dayofweek(y, m, d)

{
    static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
    y -= m < 3;
    return (y + y/4 - y/100 + y/400 + t[m-1] + d) % 7;
}

Like so:

Thank you so much Mopperl :slight_smile: