Rocket Boost: Fueling Up Your Octane!
Rocket Boost: Fueling Up Your Octane!
Do you love driving fast cars in Fortnite? The Octane car is super cool. It can fly and go very fast. But it needs fuel to keep going. That fuel is called Boost. In this tutorial, we will build a power-up pad. Players will drive over it to get more speed. You will learn how to use Verse to make your own game items. Let’s make your island faster!
What You'll Learn
- What a Power-up is in game design.
- How to use Variables to change game rules.
- How to write Events that happen when players touch things.
- How to connect devices in your island.
How It Works
Imagine you are playing a racing game. You have a gas tank. When you drive fast, the tank gets empty. You need to find gas cans to fill it up. In Fortnite, this gas is called Boost.
The Octane car uses Boost to fly. Without Boost, it is just a normal car. We want to give players a way to get more Boost. We can place a special item on the ground. When a player drives over it, they get fuel.
In programming, we call this a Power-up. A power-up is an item that gives the player a special ability. It is like finding a health potion in a dungeon. Or a shield in a battle royale.
To make this work, we need to tell the game two things:
- How much Boost should the player get?
- How long should the player wait before using it again?
These settings are like dials on a radio. You can turn them up or down. We will use Variables for this. A variable is like a box that holds a number. We can change the number inside the box.
We also need an Event. An event is something that happens in the game. For example, "When a player touches this pad." We will write code to listen for that event. When the event happens, we add Boost to the player’s car.
Let's Build It
First, you need to place the device in your island.
- Open Create Mode.
- Press Tab to open the inventory.
- Click Devices.
- Search for Rocket Boost Powerup.
- Place it on the ground where players will drive.
Now, let’s add some Verse code. This code will let you control the power-up. We will use a Device Owner script. This means the device controls itself.
Here is the code. Copy it into your device’s Verse tab.
# This is a comment. It helps you remember what the code does.
# We are creating a script for our Rocket Boost device.
use: RocketBoostPowerupDevice
# This is a function. It is a set of instructions.
# The device will run this code when it starts.
OnBegin<override>()<suspends>: void =
# We set up the power-up settings here.
# This is where we use our Variables.
# amount is a variable for how much boost to give.
amount := 50.0
# cooldown is a variable for how long to wait.
cooldown := 10.0
# We tell the device to use these settings.
# This makes the power-up work with our rules.
SetBoostAmount(amount)
SetCooldownTime(cooldown)
# We print a message to the console.
# This helps us know the code is working.
Print("Rocket Boost is ready! Drive over me!")
Let’s look at the important parts.
The OnBegin function runs when the game starts. It is like the starting gun in a race. Everything happens after this.
We created two Variables.
amountis the number of Boost points. We set it to50.0. This is a decimal number. Decimals are numbers with a dot.cooldownis the wait time. We set it to10.0seconds. This means players can only use one pad every 10 seconds.
The lines starting with # are comments. The computer ignores them. But you can read them. They explain the code. Always write comments! They help you remember what you did later.
The last two lines call special functions. SetBoostAmount tells the device how much fuel to give. SetCooldownTime tells the device how long to wait. These functions are built into the Rocket Boost device. You do not need to write them. You just use them.
Try It Yourself
You did it! You wrote your first Verse script. Now, let’s make it more fun.
Challenge: Change the code so the player gets 100 Boost instead of 50. Also, change the cooldown to 5 seconds.
Hint: Look at the lines where you set amount and cooldown. Just change the numbers. Save your code and test it in the game. Drive over the pad and see what happens!
Recap
You learned how to add a Rocket Boost power-up to your island. You used Variables to control the amount of fuel. You used an Event called OnBegin to set it up. You also learned about Comments to explain your code. Great job! Keep building and coding. Your island will be the fastest one ever!
References
- https://dev.epicgames.com/documentation/en-us/fortnite/usingrocketboostpowerupdevicesinfortnitecreative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-rocket-boost-powerup-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/using-devices-in-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/using-stat-powerup-devices-in-fortnite-creative
Verse source files
- 01-fragment.verse · fragment
Turn this into a guided course
Add using-rocket-boost-powerup-devices-in-fortnite-creative to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.
References
Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.