Monika-After-Story / MonikaModDev

DDLC fan mod to extend Monika
http://www.monikaafterstory.com/
Other
1.2k stars 683 forks source link

Having a topic show everyday #10266

Closed Buul135 closed 5 months ago

Buul135 commented 5 months ago

I was wounding if it is possiable to make a topic show everyday, like a reminder to do something

dreamscached commented 5 months ago

You can reset topic's conditional every time it fires and use it for setting its next trigger date and time. However, there is no guarantee it will go off immediately as soon as the trigger time has come, in fact it will always be off by 1-15 seconds.

Buul135 commented 5 months ago

You can reset topic's conditional every time it fires and use it for setting its next trigger date and time. However, there is no guarantee it will go off immediately as soon as the trigger time has come, in fact it will always be off by 1-15 seconds.

I'm sorry, could you give me an example of how that would be writien

dreamscached commented 5 months ago

I can't give you the code that will 100% suit your needs, you'll have to make your own adjustments to that. But roughly, something like that:

init 5 python:
    addEvent(Event(
        eventlabel="mas_reminder_topic",
        start_date=datetime.datetime.now() + datetime.timedelta(days=1)
        action=EV_ACT_PUSH
    ))

label mas_reminder_topic:
    $ mas_getEV("mas_reminder_topic").start_date = datetime.datetime.now() + datetime.timedelta(days=1)
    # Your logic/dialogue here
    return

If you're very new to Ren'Py and MAS submodding, this might be quite a challenging task.

Buul135 commented 5 months ago

I can't give you the code that will 100% suit your needs, you'll have to make your own adjustments to that. But roughly, something like that:


init 5 python:

    addEvent(Event(

        eventlabel="mas_reminder_topic",

        start_date=datetime.datetime.now() + datetime.timedelta(days=1)

        action=EV_ACT_PUSH

    ))

label mas_reminder_topic:

    $ mas_getEV("mas_reminder_topic").start_date = datetime.datetime.now() + datetime.timedelta(days=1)

    # Your logic/dialogue here

    return

If you're very new to Ren'Py and MAS submodding, this might be quite a challenging task.

Thank you so much

Buul135 commented 5 months ago

f af I'm sorry but what the hell does this mean?

dreamscached commented 5 months ago

My example was inaccurate, fix the Event call.

init 5 python:
    addEvent(Event(
        persistent.event_database,
        eventlabel="mas_reminder_topic",
        start_date=datetime.datetime.now() + datetime.timedelta(days=1)
        action=EV_ACT_PUSH
    ))