I love the smell of UnrealEd crashing in the morning. – tarquin

User:Crusha/UltimateMappingTools/LockerWeaponsPlayerStart

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

LockerWeaponsPlayerStart

UT2004 Object >> Actor >> NavigationPoint >> SmallNavigationPoint >> PlayerStart >> TriggeredPlayerStart >> LockerWeaponsPlayerStart (custom)

This PlayerStart equips the spawning player with the weapons from the closest WeaponLocker in the specified range. The Event is triggered when the player spawns.

Properties

Property group 'LockerWeaponsPlayerStart'

AssignLocker

Type: WeaponLocker

Modifiers: edfindable

Always use the locker that is specified here. Search for a locker in radius at runtime if none is specified. Overrides bAlwaysRefreshClosestLocker.

bAlwaysRefreshClosestLocker

Type: bool

Enabling this will perform a check to find the closest Locker every time a player respawns.

This allows to always use the closest Locker in case that this PlayerStart is attached to a Mover and moves away from it's initial location. However, performing the check is processing intense, so you should disable this if the PlayerStart is not attached to a Mover.

MaxWeaponLockerDistance

Type: float

The player will spawn with the weapons from the closest WeaponLocker within this distance.

Default value: 1000.0

Internal variables

BestLocker

Type: WeaponLocker

The closest WeaponLocker found in proximity.

Default values

Property Value
Event 'LWPSSN'

Instance functions

BeginPlay

function BeginPlay ()

Set up the SpawnNotifier.

EquipSpawnedPlayer

function EquipSpawnedPlayer (Pawn P)

Called by the SpawnNotifier.

FindClosestLocker

function WeaponLocker FindClosestLocker (Vector StartLocation, float SearchRadius)

Finds the closest locker. Obvious.

PostBeginPlay

function PostBeginPlay ()

Find a WeaponLocker in range.


LockerWeaponsPlayerStartSpawnNotifier

UT2004 Info >> LockerWeaponsPlayerStartSpawnNotifier (custom)
Package: 
UltimateMappingTools

This is a hack to get the LockerWeaponsPlayerStart to work. The PlayerStart itself doesn't get any notification when a player spawns there but the GameInfo triggers the Event of the PlayerStart where the player was spawned.

So we simply let every LockerWeaponsPlayerStart trigger us and then re-route the necessary information to him, because that is given with the TriggerEvent.

Events

Trigger

event Trigger (Actor Other, Pawn EventInstigator)

Call EquipSpawnPlayer() in the PlayerStart that triggered the Event and pass the Instigator as the spawned player.