VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse Community Snippets›Verse Language·Up to Community Snippets · Verse Language·72 of 114 in Verse Language

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 Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Verse Language · 72 of 114
Prev
fortnite throw an error
Next
santas toy factory upgrade config

Source

Epic Games documentation

View original
VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse