HPL3/SOMA/Scripting/Scripting Api/ParticleSystem

From Frictional Wiki
< HPL3‎ | SOMA‎ | Scripting‎ | Scripting Api
Jump to navigation Jump to search

Have some helpful descriptions to add to this class? Edit this page and add your insight to the Wiki!

Summary

Return Type Function and Description
void ParticleSystem_AttachToEntity(const tString &in asPSName, const tString &in asEntityName)
Attaches a particle system to an entity
cParticleSystem ParticleSystem_CreateAtEntity(const tString &in asPSName, const tString &in asPSFile, const tString &in asEntity, bool abAttach)
Creates a particle system at entity
cParticleSystem ParticleSystem_CreateAtEntityExt(const tString &in asPSName, const tString &in asPSFile, const tString &in asEntity, bool abAttach, const cColor &in acColor, float afBrightness = 1.0f, bool abFadeAtDistance = false, float afFadeMinEnd = 1.0f, float afFadeMinStart = 2.0f, float afFadeMaxStart = 100.0f, float afFadeMaxEnd = 110.0f)
Creates a particle system at entity with extra options
void ParticleSystem_Destroy(const tString &in asPSName)
Destroy a particle system
bool ParticleSystem_Exists(const tString &in asPSName)
Returns true or false if a given particle system exists
void ParticleSystem_Preload(const tString &in asFile)
Preload particle system data
void ParticleSystem_SetActive(const tString &in asPSName, bool abActive)
Activates or deactivates a particle system
void ParticleSystem_SetBrightness(const tString &in asPSName, float afBrightness)
Sets the brightness of a particle system
void ParticleSystem_SetColor(const tString &in asPSName, const cColor &in acColor)
Sets the color of a particle system
void ParticleSystem_SetVisible(const tString &in asPSName, bool abVisible)
Sets the visibility of a particle system

Function Detail

ParticleSystem_AttachToEntity

void ParticleSystem_AttachToEntity(const tString &in asPSName,
                                   const tString &in asEntityName)

Attaches a particle system to an entity.

Parameters

  • asPSName (tString) — name of the particle system, can contain wildcards(*).
  • asEntityName (tString) — name of the entity to attach the particle system to.

Returns:

  • void

ParticleSystem_CreateAtEntity

cParticleSystem@ ParticleSystem_CreateAtEntity(const tString &in asPSName,
                                               const tString &in asPSFile,
                                               const tString &in asEntity,
                                               bool abAttach)

Creates a particle system at entity.

Parameters

  • asPSName (tString) — name of the particle system entity to be created.
  • asPSFile (tString) — .ps file to create particle system from.
  • asEntity (tString) — entity to create particle system at. Can be "player".
  • abAttach (bool) — whether the particle system should be attached to the entity it is created at.

Returns:

  • cParticleSystem@—cParticleSystem, the created particle system or null if the function fails.

ParticleSystem_CreateAtEntityExt

cParticleSystem@ ParticleSystem_CreateAtEntityExt(const tString &in asPSName,
                                                  const tString &in asPSFile,
                                                  const tString &in asEntity,
                                                  bool abAttach,
                                                  const cColor &in acColor,
                                                  float afBrightness = 1.0f,
                                                  bool abFadeAtDistance = false,
                                                  float afFadeMinEnd = 1.0f,
                                                  float afFadeMinStart = 2.0f,
                                                  float afFadeMaxStart = 100.0f,
                                                  float afFadeMaxEnd = 110.0f)

Creates a particle system at entity with extra options.

Parameters

  • asPSName (tString) — name of the particle system entity to be created.
  • asPSFile (tString) — .ps file to create particle system from.
  • asEntity (tString) — entity to create particle system at. Can be "player".
  • abAttach (bool) — whether the particle system should be attached to the entity it is created at.
  • acColor (cColor) — color of the particle system.
  • afBrightness (float) — brightness of the particle system.
  • abFadeAtDistance (bool) — if the particles should fade depending on distance from the player.
  • afFadeMinEnd (float) — when the player is closer than this, the particles are invisible.
  • afFadeMinStart (float) — distance to the player where the particles will start fading if the player gets closer.
  • afFadeMaxStart (float) — distance to the player where the particles will start fading if the player gets further away.
  • afFadeMaxEnd (float) — when the player is further away than this, the particles are invisible.

Returns:

  • cParticleSystem@—the created particle system or null if the function fails.

ParticleSystem_Destroy

void ParticleSystem_Destroy(const tString &in asPSName)

Destroy a particle system. Can contain wildcards.

Parameters

  • asPSName (tString) — name of the particle system entity to be destroyed.

Returns:

  • void

ParticleSystem_Exists

bool ParticleSystem_Exists(const tString &in asPSName)

Returns true or false if a given particle system exists

Parameters

  • asPSName (tString) — name of the particle system. Can contain wildcards.

Returns:

  • bool

ParticleSystem_Preload

void ParticleSystem_Preload(const tString &in asFile)

Preload particle system data

Parameters

  • asFile (tString) — file to preload

Returns:

  • void

ParticleSystem_SetActive

void ParticleSystem_SetActive(const tString &in asPSName,
                              bool abActive)

Activates or deactivates a particle system.

Parameters

  • asPSName (tString) — name of the particle system. Can contain wildcards.
  • abActive (bool) — if is should be set to active.

Returns:

  • void

ParticleSystem_SetBrightness

void ParticleSystem_SetBrightness(const tString &in asPSName,
                                  float afBrightness)

Sets the brightness of a particle system.

Parameters

  • asPSName (tString) — name of the particle system. Can contain wildcards.
  • afBrightness (float) — the color to set

Returns:

  • void

ParticleSystem_SetColor

void ParticleSystem_SetColor(const tString &in asPSName,
                             const cColor &in acColor)

Sets the color of a particle system.

Parameters

  • asPSName (tString) — name of the particle system. Can contain wildcards.
  • acColor (cColor) — the color to set

Returns:

  • void

ParticleSystem_SetVisible

void ParticleSystem_SetVisible(const tString &in asPSName,
                               bool abVisible)

Sets the visibility of a particle system.

Parameters

  • asPSName (tString) — name of the particle system. Can contain wildcards.
  • abVisible (bool) — if is should be set to visible or not.

Returns:

  • void