I don't need to test my programs. I have an error-correcting modem.

User:Crusha/UltimateMappingTools/PlayerCountTrigger

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

by Crusha K. Rool

UT2004 Object >> Actor >> Triggers >> PlayerCountTrigger (custom)
Package: 
UltimateMappingTools

Triggers an Event when at least so many players are in the game as specified here. Untriggers it when the PlayerCount shrinks below the specified amount.

Hint: Use a LogicalNOT to make this thing work in the other direction, so that it triggers if less than x players are in the game.

Properties

Property group 'PlayerCountTrigger'

bCountHumansOnly

Type: bool

Bots are not considered in the PlayerCount.

PlayerCount

Type: byte

Triggers the Event when at least this much players are in the game.

Default value: 16

Internal variables

bHasTriggeredAlready

Type: bool

So that we don't trigger again when another player joins although we are above PlayerCount already.

Default values

Property Value
bCollideActors False

Functions

Events

SetInitialState

event SetInitialState ()

Overrides: Actor.SetInitialState

Go to the appropriate state, either for humans only or also for bots. With states can we save more performance than with boolean checks.

Other instance functions

Reset

function Reset ()

Overrides: Actor.Reset

The Event will be untriggered and is allowed to trigger again in the next Tick.

States

HumansAndBots

Counts bots too.

HumansAndBots.Tick

event Tick (float DeltaTime)

Overrides: Actor.Tick (global)

Checking Level.Game.NumPlayers + Level.Game.NumBots every Tick.

HumansOnly

Count only humans, bots can not be taken as serious players.

HumansOnly.Tick

event Tick (float DeltaTime)

Overrides: Actor.Tick (global)

Checking Level.Game.NumPlayers every Tick.