Switch

From Serious Sam Wiki
Revision as of 09:22, 7 May 2016 by MousseMoose (Talk | contribs) (switch entity only in sse4)

Jump to: navigation, search

SEd4.0 only

Model of CSwitchEntity using the default params. The Switch is activated.Info 16x16.png Note: There is no editor model when a new CSwitchEntity is created.

General information

Class: CSwitchEntity

A Switch is a basic switch that is generally turned on or off by the player. When a Switch is on/activated, it shows a green light. When it is off/deactivated, it shows a red light. A Switch can be connected to other entities to influence them.

Properties

The parameters of the Switch


Activated by default (BOOL)

Set the initial state of the Switch (activated or deactivated)


Spawn flags (LFLAGS)

Defines in which difficulty levels and game types the Switch is spawned.


Name (CString)

Defines the name of the Switch.


Defines a entity pointer to the parent of the Switch.


Platforms (LFLAGS)

Defines on which platforms the Switch is spawned.


Entity ID (ULONG)

Displays the entity ID of the Switch.


Info 16x16.png Note: Entity ID cannot be edited.

Script Functions

Methods

CSwitchEntity Methods
Name Parameters Return Data Type Description
Name Data Type
Activate - void Activates the Switch.
AssureActivated - void To do: Add description.
Info 16x16.png Note: Appears to work the same as Activate(), except that it does not play the sound of the switch being flipped.
Deactivate - void Deactivates the Switch.
IsActivated - BOOL Returns TRUE if the Switch is on.
SetUsable bUsable BOOL void When bUsable is set to FALSE, the player is not able to flip the switch. When bUsable is set to TRUE, the player is able to flip the switch.
Info 16x16.png Note: Setting bUsable to FALSE still allows scripts to change the state of the Switch
CBaseEntity Methods
Name Parameters Return Data Type Description
Name Data Type
ApplyDamageTool
SEd3.5 or higher
DamageSource CString void To do: Add description
DamageType CString
WeaponIndex WeaponIndex
CharacterClass IDENT
Damage SLONG
EnableReceiveDamageScriptEvent
SEd3.5 or higher
- void Enables ReceiveDamage script events (see below).
Warning 16x16.png Warning: This function disables native damage handling.
EnableTouchAutoMoveTarget
SEd4.0 only
Enabled BOOL void Enables the entity to become an auto move target.
GetAngularVelocity - Vector3f Returns angular velocity of the entity in Vector3f format.
GetAttachmentAbsolutePlacement Attachment IDENT QuatVect Returns placement of attachment in relation to World Spawn in QuatVect format.
GetAttachmentRelativePlacement Attachment IDENT QuatVect Returns placement of attachment in relation to entity in QuatVect format.
GetClassName
SEd3.5 or higher
- CString Returns classname in CString format.
GetLinearVelocity - Vector3f Returns linear velocity of entity in Vector3f format.
GetName - CString Returns the name of the entity in CString format.
GetParent Name IDENT Handle Returns a CBaseEntity handle of the parent of the entity.
GetPlacement - QuatVect Returns position and orientation of the entity in QuatVect format.
GetWorld
SEd3.5 or higher
- CWorld* To do: Add description
GetWorldInfo
SEd3.5 or higher
- CWorldInfoEntity* To do: Add description
InflictDamage Amount SLONG void Inflicts damage to entity.
InflictDamageOfType Amount SLONG void Inflicts damage of a specified damage type to entity.
DamageType CString
InflictDamageToTarget
SEd3.5 or higher
Target Handle void To do: Add description
Amount SLONG
Weapon IDENT
DamageType CString
InflictWeaponDamage
SEd3.5 only
Amount SLONG void To do: Add description
Weapon IDENT
DamageType CString
IsDestroyed - BOOL Returns 1 if entity is destroyed.
IsReceiveDamageScriptEventEnabled
SEd3.5 or higher
- BOOL Returns 1 if ReceiveDamageScriptEvent is enabled (see above).
SetAngularVelocity AngVelocity Vector3f void Sets angular velocity of entity to the specified Vector3f value.
SetLinearVelocity Velocity Vector3f void Sets the velocity of the entity to the specifed Vector3f values.
SetPlacement Placement QuatVect void Sets position and orientation of the entity to the specified QuatVect values.

Events

Activated
Triggers when the Switch is activated.
Destroyed
Triggers when the Switch is deactivated.
Destroyed
Triggers when the Switch is destroyed.
EntityDeleted → SEd3.5 or higher
Triggers when the Switch is deleted.
ReceiveDamage → SEd3.5 or higher
Triggers when the Switch receives damage.
Info 16x16.png Note: This event requires enabling via EnableReceiveDamageScriptEvent method.

Other Information

Relevant Pages and Links

Plasma Wall