If you are requesting technical assistance with Twine, please specify:
Twine Version: 2.5.1
Story Format: SugarCube 2.36.1
hello hello!! i’m wondering how to implement a widget (or any other tye of code) for triggering events on certain days. this may be a commonly asked question, but i need something tailored to fit the following code i got from Best (easiest) method for time and date usage - #2 by pbparjeter and Using time and date to set events - #20 by McFluff where i already have date (like march 19, 2009) and time set up. i have checked forums here but i’m quite unsure how to use the recommended code from those ones so that it won’t clash with the widgets i had set up.
i need it to be for specific DAYS and not DATES. i don’t like to repeatedly type <<check_date>> for every single instance the event is going to happen, and then manually have to check which dates would align up to match (like aug 1 in-game is monday, so i’d have to calculate which specific dates will match all 5 weekdays and it seems like such a hassle T___T it’s a life-sim type game too omg)
::: Game Clock <<widget "minutes_incr">> <<set $CurDate_inc to new Date(Math.trunc($CurDate) + $args * 60 * 1000)>> <<set $CurDate to $CurDate_inc>> <</widget>> <<widget "check_date">> <<set $CheckDateA to new Date($args)>> <<set $CheckDateB to new Date($args)>> <<if Math.trunc($CurDate) gte Math.trunc($CheckDateA) and Math.trunc($CurDate) lt Math.trunc($CheckDateB)>> <<print $args>> <<endif>> <</widget>> <<widget "check_hour">> <<set $CheckHourA to $args>> <<set $CheckHourB to $args>> <<if $CurDate.getHours() gte Math.trunc($CheckHourA) and $CurDate.getHours() lt Math.trunc($CheckHourB)>> <<print $args>> <<else>> <<if $args neq undefined>><<print $args>><<endif>> <<endif>> <</widget>> ::: Lobby You're in the Lobby. There are a few benches that you can rest on. You can check in with the reception desk. <<link "Sign in at the reception table (0:01)" "Reception">><<minutes_incr 1>><</link>> <<link "Rest on one of the benches (0:30)" "Benches">><<minutes_incr 30>><</link>> /* insert day-specific <<link>> macro. it would only appear on weekdays. it's like an event to increase relationship stats lolol */