Santa's Toy Factory Order Generation
Santa's Toy Factory — Order Generation
How the tycoon hands out work: a scripted set of FirstOrders for a predictable tutorial onboarding, then random order generation from the products the player can currently build. Teaches struct, <decides><transacts> effects, and random selection over available options.
From the Santa's Toy Factory Epic starter project (SampleVerse/SantaToyFactory/Config/order_config.verse). Epic Games reference Verse, shown for study.
-
# This file contains the data used to configure how orders are generated in the game. # It also contains functions for getting and generating the next order. using { /Verse.org/Random } using { /Verse.org/Simulation } using { Persistence } # Contains information for one line in an order. order_line<public> := struct: ProductNumber<public>:int ProductsOrdered<public>:int BasePrice<public>:int # Defines the first orders a player will get. # This gives a predictable beginning to the game and ensures that placed orders play well with the tutorial. # This also ensures that the player becomes accustomed to the game before random orders are generated. FirstOrders: [][]tuple(int, int, int) = # Each row is an order. # Each column is an order line (product number, amount ordered, base price per unit). array{ array{(0, 1, 5)}, array{(0, 5, 5)}, array{(0, 10, 5), (1, 5, 10)}, array{(0, 20, 10)}}
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.