I'm a doctor, not a mechanic
User:Crusha/UltimateMappingTools/LockerWeaponsPlayerStart
LockerWeaponsPlayerStart
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
Set up the SpawnNotifier.
EquipSpawnedPlayer
Called by the SpawnNotifier.
FindClosestLocker
Finds the closest locker. Obvious.
PostBeginPlay
Find a WeaponLocker in range.
LockerWeaponsPlayerStartSpawnNotifier
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
Call EquipSpawnPlayer() in the PlayerStart that triggered the Event and pass the Instigator as the spawned player.