The LEGO® Action Adventure Template provides the building blocks for a classic action-adventure gameplay complete with quests, combat, and puzzles. Most of all, this template showcases the LEGO® Assembly Devices device so you can prove to the world that you're a certified LEGO professional builder. Lock into this experience while enjoying its relaxing vibes and soothing sounds.
In this gameplay, there is one universe - but many worlds to save and many hats to wear. Become a Warrior, Blaster, or Thief, and unlock quests that utilize unique tools as you change your play style for each class persona. With each class, carry out your heroic duty to save the universe as you combat pesky enemies.
In the land of LEGO, it pays to be a hero. Your actions can award studs which you can use to assemble props that unlock new areas, fulfill quest requirements, and unlock in-game trophies. As you progress through each class, you will encounter rewarding trials that keep you on your toes as you navigate through obstacles.
At the end of each class quest, you will find that the banana has gone bad! It's up to you to boss battle the rogue Peely Bone NPC in a Verse-based attack system. You will encounter this battle with each class as you change your fighting style to match your weapon.
When it's all over, finish the gameplay with a tutorial alongside the following walkthrough, and save your universe by learning the mechanics to recreate this experience. Good luck on your adventure, hero!
Access the LEGO Action Adventure Template
Follow the steps below to access this template within UEFN.
Within the Project Browser, navigate to Brand Templates, then use the All Brands dropdown to select LEGO® Island.
Select LEGO Action Adventure Template. Then under Project Name, type your project's name.
Under Project Defaults, set if your project will be under Unreal Revision Control and set the Team Selection.
Click Create to load your project.
Create a Custom Quest
The Action Adventure template offers many quests that give players a sense of purpose throughout the gameplay. These quests are tracked individually through persistent data.
Launch a session so that you can test your quest as you create it.
You can create a Verse device to set up quests within your game and grant items such as LEGO® Collectible studs as rewards for players. You can also use this quest system to progress the story of your gameplay.
Through events such as Quest Started, Quest Aborted, and Quest Completed, you can make items appear when the quests start.
To create a quest system, follow the steps below.
In the Viewport toolbar, create a Verse device named LEGO_quest_giver, and drag it into your project.
Then, drag two
Button devices into your project.Name one as button_quest_giver and the other as button_quest.
Add the following Verse code to your project.
Verseusing { /Fortnite.com/Characters } using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # ==================================================================================================================================== # LEGO quest giver device that manages a linear quest system # ====================================================================================================================================
From the Content Browser, navigate to Fortnite > Devices > Logic, and drag two
Tracker devices into your project.Name one as tracker_main_quest and the other as tracker_quest_giver.
Place the button_quest button device in a visible location near your NPC so players can activate the quest.
Place the button_quest_giver button device inside the hologram of the NPC so that it is hidden.
From the Content Browser, navigate to Fortnite > Devices > !Beta, and drag an NPC Spawner device into your project.
Configure the Quest Device
Next, configure the LEGO_quest_giver device, and link your devices to set up your first quest system. To do so, follow the steps below.
In your project or in the Outliner panel, select the LEGO_quest_giver device.
In the Details panel of the device, navigate to QuestGiverName, and set the quest-giving name of the NPC.
Next, navigate to Button_Interact, and set the option to button_quest_giver.
Navigate to TrackerDevice, and set the option to tracker_quest_giver.
The quest system is set up as an array of either lego_quest or lego_quest_repeatable. A LEGO quest is a single quest system that players can progress through in any order.
Create Repeatable Quests
For repeatable quests, you can even create a mechanic that requires constant stud pickups or set enemies that can be defeated multiple times.
In the Details panel of the LEGO_quest_giver device, select the + icon for Quests to add an array element to the quest.
Make sure the array is set to LEGO_quest, then navigate to Name, and type the name of the quest.
Expand the Display Text array, and set the text for dialogue.
Under the Quest array, navigate to TrackerDevice, and set the option to tracker_main_quest.
Your players will not be able to accept new quests unless you set your quest to be repeatable. You can also configure a Trigger device to reset the progression of the quest.
Reset Quests
To set your quests to reset, follow the steps below.
From the Content Browser, navigate to Fortnite > Devices > Logic, and drag a Trigger device into the project.
In the Outliner panel, select the LEGO_quest_giver device.
Then, in the Details panel, click the Trigger_ResetProgress dropdown, then select the Trigger device.
In the Outliner panel, navigate to Demo Area > DemoDisplay_Quest to view the preconfigured demo quest.
Configure the Trackers
You can use the Tracker device to increment, decrement, and complete your LEGO quests. Each quest should have its own Tracker device assigned to manage its progression.
To create a basic, non-repeatable quest, follow the steps below.
In the Outliner panel, select the tracker_main_quest Tracker device.
In the Details panel, set Stat to Track to Events.
Set TargetValue to 1 to make sure the starting value is zero. This value is incremented every time a quest step is completed. For more quest steps, increase the value so the completion events continue to increment the tracker.
Set Amount to Change to 1.
Navigate to IncrementProgress, then set the array to ButtonQuest and the event to OnInteract. You can set multiple events as quest requirements to increment this, similar to the quests created in the Action Adventure Template. For example, you can set quest requirements such as entering the world, opening a secret door, or defeating a boss.
In the Outliner panel, select the tracker_quest_giver Tracker device. Then, in the Details panel, set Assign on Start to False.
Configure the NPC Spawners
You can use the NPC Spawner device to spawn a Guard character type, which has the behavior of patrolling and engaging players in combat.
To use a custom Verse NPC character definition with the NPC Spawner device, follow the steps below.
From the content folder of your project, create a Character Definition blueprint named NPCDef_QuestGiver.
In the Details panel of the Character Definition, change the settings to match the table below.
Option
Value
Explanation
Type
Guard
Defines what type of AI character will be spawned by this SpawnDefinition.
Selected AI
NanaSplit
Chooses an AI character to spawn from this preset.
Behavior
Verse Behavior
Defines how the spawned AI character will behave once spawned.
NPCBehaviorScript
npc_behavior_quest_giver
Select a Verse script of the type npc_behavior to control the spawned NPC
Accuracy
Moderate
Determines how accurate Guards are at shooting.
Can be Down But Not Out
False
The NPC will not enter the Down But Not Out state.
Modifiers - Index [0]
Team Modifier
Sets the modifier to apply.
Team Option
Index
Sets the team type.
Team Index
1
Sets the team type's number.
In the Outliner panel, select the NPC Spawner device.
In the Details panel, set the NPC Character Definition to NPCDef_QuestGiver.
Award LEGO® Studs
Reward players throughout their gameplay by awarding LEGO® Collectible studs for their actions and by defeating enemies. You can either manually place studs or use Verse to set them to randomly spawn throughout your environment so users can get them by eliminating NPCs, destroying props, and completing assembly minigames.
In the Action Adventure template, players are awarded studs that players can use to proceed through the story and purchase in-game trophies. Use the Collectible device to create studs for players to collect.
You can use an object pool to efficiently grant studs throughout your gameplay. Object pools are useful for spawning large amounts of objects.
Instead of constantly creating and destroying studs, you can pre-create them before the game begins and then spawn them as needed. With pre-created objects, you can activate them in their set positions to be released. Pre-initializing resources like studs can help reduce performance costs tied to memory reallocation.
This template uses Item Spawner devices alongside the LEGO_stud_spawner_pool Verse device to specify a location and number of studs to spawn with the SpawnStudsAtLocation() function. This teleports the required number of Item Spawner devices to the location that spawns studs. Once the Item Spawner device has spawned studs at that location, it’s re-added to the pool and can be reused.
You can add Item Spawner devices to the level, and then give them an associated pool tag, so they will be aggregated and spawned when and where you want them to.
Create an Object Pool
To create an object pool to spawn studs, follow the steps below.
In the Verse Explorer panel, create a Verse device named LEGO_stud_pool and drag it into your project.
Add the following Verse code to your project.
Verseusing { /Fortnite.com/Devices } using { /Verse.org/Colors } using { /Verse.org/Simulation } using { /Verse.org/Simulation/Tags } using { /UnrealEngine.com/Assets } using { /UnrealEngine.com/Temporary/Diagnostics } using { /UnrealEngine.com/Temporary/SpatialMath } # ============================================================================================================================================
In the Details panel, click +Add, and select Verse Tag Markup.
In the Tags dropdown, expand the array, and select LEGO_stud_pool_tag.
Add the Item Spawners
Each Item Spawner device can only spawn a single stud collectible. Therefore, you must have as many Item Spawner devices in the pool as the amount of studs you’d like to spawn. Follow the steps below to set up Item Spawner devices.
From the Content Browser, navigate to Fortnite > Devices > Items, and drag an Item Spawner device into your project.
In the Details panel, add an array to Item List and set it to to CP_Ingredient_GoldStud.
Navigate to Initial Movement of Item, and set the option to Toss for the bounce effect when collected.
Add a Verse Tag Markup, and set it to lego_stud_itemspawner_tag.
Copy and paste this device as many times as needed to have your desired number of Item Spawners in your pool.
Use the Pool to Spawn Studs
You can use the Item Spawners from above to spawn studs in your gameplay. This means you can respond to multiple gameplay events only using regular devices.
For example, you can spawn studs when an NPC is eliminated, an Assembly device requirement is met, or even when a quest has been completed.
To spawn pools of studs in your gameplay as a reward when the quest is completed, follow the steps below.
In the Outliner panel, select the LEGO Quest Giver device you created earlier.
Navigate to and expand your Quests array, and find the Reward section. Then, check to see if it is set to lego_stud_spawner.
Under Amount, set the amount of studs you would like to award players. Since the Item Spawner device can only spawn one item, you'll need an Item Spawner device for each award amount. So if your reward is 15, you’ll need 15 Item Spawners devices to spawn these simultaneously.
Set the SpawnType to Toss to match the Verse Markup Tag on your Item Spawner devices.
You can launch a session to test if spawning works.
Create a Verse-based Attack System
No adventure is complete without a boss battle! Challenge your players with tough NPC enemies that players must use strategy to defeat.
In this template, NPCs use area-of-effect (AOE) attacks that teleport an Explosive device to players and stun attacks that put players into temporary stasis.
Within the battle arena, players can expect class-based fight enhancements and various powerups to aid them in battle.
You can alter the npc attack controller Verse device to control how often and what attacks the NPCs use.
Insert the code below into your own projects to create your own variation of the NPC boss battle.
using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /Verse.org }
using { /Verse.org/Assets }
using { /Verse.org/Colors }
using { /Verse.org/Random }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Assets }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
Design your Island
Below are a few tips to snap the bricks of your amazing gameplay experience together.
Go the extra mile in your project by creating a custom UI to keep your players entertained. This template uses player portraits and heart health bars to deviate from the normal UI design.
Don't let your players get lost! Strategically place LEGO ® Collectible studs to guide players along a desired path.
As your puzzles increase in difficulty, be sure to offer HUD hints and text suggestions to lead your players the right way.
Use the Assembly device to unblock hidden areas. You can also combine the device with cinematic sequences and even the Prop Mover device to bring assembly builds to life.
Be sure to check out the entire Verse code used to make this gameplay by clicking Verse in the UEFN toolbar.