using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# This is our script. It lives on the cave device.
CaveScript := class(creative_device):
# Wire the trigger device in the UEFN editor.
@editable
CaveTrigger : trigger_device = trigger_device{}
# Wire the campfire device in the UEFN editor.
# note: campfire_device is the real Verse type for the Campfire Device.
@editable
Campfire : campfire_device = campfire_device{}
# This variable is our sticky note.
# It starts as false (0). The fire is off.
var IsFireLit : logic = false
# OnBegin runs once when the game starts.
# We use it to connect the doorbell to the recipe.
OnBegin<override>()<suspends> : void =
# This binds the function to the trigger.
# It means: "When the trigger is entered, run OnPlayerEnter."
CaveTrigger.TriggeredEvent.Subscribe(OnPlayerEnter)
# This function is the recipe.
# It runs when a player enters the trigger zone.
OnPlayerEnter(MaybeAgent : ?agent) : void =
Verse Library
verse
01 Device
Lights a campfire when a player enters a designated trigger zone inside a cave.
verse-library/build-it-yourself/01-device.verse
Sign in free to read the full source 🌴
This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.