Pickup Template Scheduler Package

Pickup Template Scheduler Package

Requirements:

  • Inventory Tutorial for pickupSpawnerScript
  • Basic scripting

Prequesites

  • PickupScheduler: using the Offiical Package

Installed Packages

  • Pickup Template Scheduler
  • Inventory (crayta)


Overview

PickupSchedulerScript is the offical crayta scheduler. PickupSchedulerTemplateScript expands this model to filter by template; allowing each template to have its own schedule.

The adventure game has two apples to be collected by default. Using a scheduler, only one apple can be set to be available at a time.

This same method can be expanded to on collision items to be picked up and so on. These items will not be covered in this document.



Pickup Controller

  • Create a locator in the world for the pickupController.
  • Create a script folder called schedule Apples.
  • Add pickupTemplateSchedulerScript to the folder

This creates a place to organize the pickupTemplateScheduler and folders for each template to be scheduled.


pickupTemplateSchedulerScript

  • startSchedulder = 1
  • pickupType = template
  • template = Resource Spawner



Resource Spawner

This template needs to be modified. The pickupTemplateSchedulerScript will handle the initial spawning and respawning. Make the following changes to the template.

pickupSpawnerScript

  • Respawning = FALSE
  • SpawnTime = adjust as desired
  • ShowOnInit = FALSE



Summary

On previewing the game, only the number of apples will appear in the game determined by the pickupTemplateScheduler.

The respawn time will depend on whether the pickupTempalteScheduler is instantly spawning another item or using the respawn timer in the pickupSpawnerScript.

After a working model is established, feel free to play around and work onward from there.