Calendar Events package

Name: Calendar Events
By AdamO on Discord

Crayta has a Calendar Events system where Crayta’s events are scheduled. This includes things like seasons (e.g. Cursed Galleons).

This script allows you to easily control behaviour in your game based on a Calendar Event. In the above screenshot, I’m calling functions A and B on a radioactive barrel, based on whether the Calendar Event is active or inactive.

In many cases you’ll want to test an event that isn’t live yet, or create your own event with custom timings so you aren’t tied to using Crayta’s Calendar Events. This script allows you to do both, by ticking “Custom Event” and entering your own start and end times. Note that these times are in UTC. Just remember, if you’re using this to debug your event logic for an actual Calendar Event, untick “custom event” before you publish!

To check what events are listed in the Calendar Events system, you can “debugPrintEvents” at the bottom of the property list, then simulate this entity - it will print all of the events to the console.


An example using Calendar Events, Event Forwarder and Property Changer packages:

  • In this example, I have a CalendarEventScript with a custom event (set up for the time I recorded the video).
  • That has “active” and “inactive” events which are passed to CallFunctionA and CallFunctionB on the radioactive waste barrel, on the EventForwarderScript.
  • That script is set up to call “SetProperty” in function A, and “ResetProperty” in function B - these get called on all scripts on this entity.
  • SetProperty and ResetProperty are called on BOTH PropertyChangerScripts on the barrel. These are set up to change the mesh to a pirate barrel, and increase the bounce height on the RotateAndMoveScript.
  • You can see when my custom event starts, the barrel turns into a pirate barrel and bounces higher. When it ends, it goes back to the radioactive barrel, and a low bounce height.
  • You can use these 3 packages together in the same way to change all sorts of things in your own game on custom events or Crayta events, e.g. make your game pirate-themed during Cursed Galleons!

1 Like