Round Modifiers & Time Based Events

This package allows you to change the Round settings (maxPlayTime, resultsCamera, roundMusic), World settings (everything that’s accessible in the “World” tab of the editor), and schedule time-based events for each round in your game. It’s designed to work seamlessly with the default Crayta round-based games (eg: Free For All, Team Deathmatch, etc) but it should work with any game that uses the default Game Package.

🛠️ SETUP
  • Create a game using one of the default Starter blueprints
  • Install the “Round Modifiers and Time Based Events” package from the Community tab
  • Drop an instance of the Round Modifier Manager template in your world
    • In the properties bag on the Round Modifier Manager, set the “gameControllerEntity” to the gameController that came with your game
  • Drop at least one instance of the Round Modifier template in your world
    • (Optional) You can change the settings on this now or later. By default, the template includes a single example event that will “Shout” once 10 seconds have elapsed since the start of the round.
  • On the default gameController entity in your game, scroll down to the events section on the gameScript
    • Add an event to the On Round Start section, the binding should be:
      • RoundModifierManager > roundModifierManagerScript > ModifyRoundSettingsStart
    • Add an event to the On Round End section, the binding should be:
      • RoundModifierManager > roundModifierManagerScript > SendAllRoundEndEvents
  • Note: Image included at the bottom to show the gameController event setup
🧬 HOW IT WORKS

For those you who are interested in the inner workings of this package, here’s the basic concept:

The Round Modifier Manager is the brains of the operation. Each time a round starts the gameScript (on the gameController entity) calls the “ModifyRoundSettingsStart” function on the Round Modifier Manager entity which triggers a few things:

  • It updates the current round number based on the settings on the Round Modifier Manager (eg: incremental, random, random with repeats)
  • It grabs all of the Round Modifier entities in the world and finds the one with the correct corresponding “roundNumber” property
  • It updates all the settings from the roundModifierScript on that Round Modifier entity (eg: maxPlayTime, resultsCamera, roundMusic, and all the World settings)
  • It grabs all of the event data from any roundEventScripts on that Round Modifier entity and starts a schedule for each one
    • When the schedule for each event equals the eventDelay time, it sends any applicable notifications, shouts, or startEvents
  • At the end of the round, the gameController calls the “SendAllRoundEndEvents” function which:
    • Cancels all of the schedules (especially useful in case the round ends early)
    • Sends all the endEvents for each roundEventScript (useful for resetting stuff at the end of the round)

That’s pretty much how it all works. Check out the config section below for some more info on setting it all up and how you can use it to do cool stuff.

⚙️ CONFIG OPTIONS

You can only have 1 Round Modifier Manager in your game but you can have any number of Round Modifier entities. Each Round Modifier entity will correspond to 1 set of round settings. So if you want a round that is during the day and then a round that is during the night, you will need 2 Round Modifier entities in your game.

Additionally, each Round Modifier entity can have any number of roundEventScripts on it and each of those roundEventScripts will fire their Start Events after the given delay. So if you want to open a door after 30 seconds and then close it after 60 seconds, you will need 2 roundEventScripts on that Round Modifier Entity.

Hopefully that makes sense but if you have questions feel free to ping me (ekelrock) on the official Crayta discord.

Ok, here are the actual properties and what they do…

On the Round Modifier Manager (roundModifierManagerScript):

  • gameControllerEntity - Needs to be set to the default gameController entity that came with your game, otherwise you can’t modify the maxPlayTime and resultsCamera properties on the Round Modifiers
  • mandatoryFirstRoundNumber - The number that corresponds to the first Round Modifier roundNumber property that should be played (most likely 1)
  • randomRoundOrder - If true, the rounds will be selected at random. Otherwise they will play sequentially (ie: roundNumber 1, 2, 3, etc…)
  • roundCanRepeat- If true, then a round can play infinitely as many times as it is randomly selected in a row. Otherwise the round will always be different (ie: you’ll never see roundNumber 2 twice in a row but it could be: roundNumber 2, roundNumber 3, roundNumber 2, etc…)

On the Round Modifier (roundModifierSettingsScript):
NOTE: None of the settings in this section will automatically reset. That means, if you change the maxPlayTime for this round then it will remain that amount of time until you change it again. The same thing applies to all of the World settings.

  • roundNumber - A unique number for each round. These numbers should start at 1 and always increment by 1 for each Round Modifier in your game (ie: 1, 2, 3, 4, etc)
  • modifyMaxPlayTime - If true, the maxPlayTime property on the gameController will be overwritten by the maxPlayTime property on this script
  • modifyResultsCamera - If true, the resultsCamera property on the gameController will be overwritten by the maxPlayTime property on this script
  • modifyMusic - If true (and a sound asset is provided int he roundMusic property on the script), the music will be updated at the start of the round with the given settings
  • WORLD SETTINGS - This section contains all of the editable settings from the World tab of the game. I’m not going to describe them all here since they have tooltips in the game.

On the Round Modifier (roundEventScript):
NOTE: As described above, you can add as many roundEventScripts to the Round Modifier as you like and each one should correspond to an event (or set of events) that should fire after the given delay.

  • eventsDelay - A delay before the startEvents on this script fire. The delay begins counting down at the start of the round.
  • sendEventNotification - If true (and the correspond eventNotification property isn’t blank) then the notification will be sent to all players after the eventDelay. Requires the default Notification package.
  • sendEventShout - If true (and the correspond eventShout property isn’t blank) then the shout will be sent to all players after the eventDelay. Requires the default Notification package.
  • startEvents - Any events you’d like to fire after the given delay
  • endEvents - Any events you’d like to fire at the end of the round (useful for resetting stuff)
💡 EXAMPLE USE CASES

There are probably hundreds of ways you could use this package – it all depends on your creativity. Some use cases will require additional scripts, of course, but here are a few of the ideas I had while making this package. (Hopefully they inspire you to come up with other cool ideas):

  • Shout to all players when there is only 30 seconds remaining in the round.
  • A game where the map starts out very limited (like a single corridor) but doors open as the round progresses leading to new weapons, routes, etc…
  • A game where all weapons become much stronger for the last 30 seconds.
  • A game where kills are worth 2x for the last 30 seconds.
  • A map where you play at dawn, then mid day, then dusk, then at night.
    • You could even use the event system to turn on different lights, populate the market with NPCs during the day, all kinds of cool stuff to add to the feeling that the map is different.
  • A map you play in different seasons (spring, summer, fall, winter)

I’m sure there are tons of other ideas I had while making this, but I’m getting tired of typing…

Ok, that’s about all I’ve got. As always, find me (ekelrock) on the Discord if you have any questions or suggestions.

Example use case of opening 3 doors after 10, 15, and 20 seconds (respectively):

Example setup of the gameController events:

1 Like