Skip to content

[FEATURE] Add cancellable in-game timed callbacks #296

Description

@ifBars

What would you like to see?

Add a runtime-agnostic scheduling API on top of the game's native TimedCallback and S1API.GameTime.TimeManager.

A mod author should be able to schedule a one-shot callback after a number of in-game minutes and receive a managed handle supporting cancellation and reset. The scheduling call should explicitly expose the native end-of-day and time-skip behavior as options.

Why would this help?

Mods commonly need delayed quest actions, NPC behavior, cooldowns, and world events that follow game time rather than real time. Today they must construct the native callback and bridge System.Action/Il2CppSystem.Action themselves or rebuild timing on top of OnTick.

Extra Context (Optional)

The handle should detach and become inert across menu/scene teardown so stale callbacks do not retain mod state. Recurring schedules, persisted timers, cron-like calendars, and custom networking should remain separate work.

Add focused tests for cancel/reset semantics and validate normal ticking, sleep/time skip, end-of-day, return-to-menu, and reload separately on Mono and IL2CPP.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    LowVery minor issue, non gameplay hindering, fix all high prio firstenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions