Verse Library verse

01 Creating A Verse Script For Player Spawning

Manages team spawn weights and enables spawners based on capture point ownership in domination matches.

extracted-snippets/documentation/en-us/uefn/deserted-domination-template-in-unreal-editor-for-fortnite/01-creating-a-verse-script-for-player-spawning.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/deserted-domination-template-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/en-us/uefn/deserted-domination-template-in-unreal-editor-for-fortnite.md
# Section:    Creating a Verse Script for Player Spawning
# Copyright Epic Games, Inc. All Rights Reserved.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Teams }
using { /Verse.org/Simulation }
using { /Verse.org/Simulation/Tags }

## This device manages the player spawners
## An intial set of spawners starts enabled
## After a short time, the initial spawners are disabled
## From there, team spawns associated with each capture point are enabled/disabled based off a weighting score
##     Owning the point adds 1 to the weighting score (or -1 if team 2)
##     Each ally in the area adds 1 to the weighting score (or -1 if team 2)
##     If the weighting score is > 0, team 1 can spawn near the point.  
##     If the weighting score is < 0, team 2 can spawn near the point

##################################################################
## Event Handler Class - We'll spawn one of these per capture point and bind events through it
##################################################################
capture_point_event_handler := class:

    CapturePointIndex:int
    DominationSpawnManagerRef:domination_spawn_manager
    TeamCollectionRef:fort_team_collection

    var CaptureWeightOfThisPoint:int = 0
    var PlayerWeightOfThisPoint:float = 0.0

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.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in