Summary

Methods

Draw()client
Draws the post and the shield on both sides of the field, sized to reach the far post.
Draws one side of the shield as a textured quad up to the far post, unless the field is off.
Fades the touch sound out when a player stops touching the field.
Sets up the post, spawns the far post at the nearest wall and builds the field's collision mesh.
Stops and clears the humming loop and the field's ShieldTouch sound.
Sets the field's mode and power state before it spawns, when restoring saved fields.
Sets up the networked int 0 (Mode) and entity 0 (Dummy, the far post).
Spawns a forcefield where the player is looking, facing along the hit surface.
Starts the shield touch sound on a non-Combine player touching the powered field.
Think()server
Plays the shield's humming loop while it is powered and keeps the field frozen, once a second.
Keeps the touch sound's volume up while a non-Combine player touches the powered field.
Cycles a Combine player's forcefield to the next mode, at most once a second.

Methods

Draws the post and the shield on both sides of the field, sized to reach the far post.

Draws one side of the shield as a textured quad up to the far post, unless the field is off.

Based on how Chessnut draws his forcefields.

Parameters

  • vertex Vector The far post's position, local to this post

Fades the touch sound out when a player stops touching the field.

Also when the field has been switched off in the meantime, or the sound would play on.

Parameters

  • ent

On the server

Sets up the post, spawns the far post at the nearest wall and builds the field's collision mesh.

Unless noCorrect is set, snaps the post to the floor first. Starts in mode 1 and switched on unless ENT:RestoreMode set otherwise; mode 4 starts switched off. Saves the forcefields afterwards, unless the field is one being restored from that save.

On the client

Builds the field's collision mesh between this post and the wall up to 600 units to its side.

Defined in

Stops and clears the humming loop and the field's ShieldTouch sound.

Touch sounds are stored on the touching players, so the field's own ShieldTouch is normally nil.

Sets the field's mode and power state before it spawns, when restoring saved fields.

Parameters

  • mode Number The mode, 1 to 4, as in cwForceField.modes
  • bIsOn Boolean Whether the field is powered

Sets up the networked int 0 (Mode) and entity 0 (Dummy, the far post).

Spawns a forcefield where the player is looking, facing along the hit surface.

Parameters

  • player
  • trace

Returns

  • Entity The new forcefield, or nil when the trace hit nothing

Starts the shield touch sound on a non-Combine player touching the powered field.

Parameters

  • ent

Plays the shield's humming loop while it is powered and keeps the field frozen, once a second.

Returns

  • Boolean true, so the next think time is used

Keeps the touch sound's volume up while a non-Combine player touches the powered field.

Parameters

  • ent

Cycles a Combine player's forcefield to the next mode, at most once a second.

Mode 4 switches the field off and lets everything through. Tells the player the new mode and saves the forcefields.

Parameters

  • act
  • call
  • type
  • val

Defined in