Przejdź do treści

Snd functions

Sound related functions.

Functions

Snd_GetDistToSource

Snd_GetDistToSource

Calculates the distance beetwen the npc and the source of the last played sound

func int Snd_GetDistToSource(var C_NPC npc) 

Parameters

  • var C_NPC npc - instance of the NPC

Return value
The function returns distance between the NPC and the source of the last sound in cm

Snd_IsSourceItem

Snd_IsSourceItem

Check whether the source of the last sound was item

func int Snd_IsSourceItem(var C_NPC npc) 

Parameters

  • var C_NPC npc - instance of the NPC

Globals

  • item - set to the source if it was an item

Return value
The function returns TRUE if the source was an item, FALSE otherwise

Snd_IsSourceNpc

Snd_IsSourceNpc

Check whether the source of the last sound was npc

func int Snd_IsSourceNpc(var C_NPC npc) 

Parameters

  • var C_NPC npc - instance of the NPC

Globals

  • other - set to the source if it was an NPC

Return value
The function returns TRUE if the source was an NPC, FALSE otherwise

Snd_Play

Snd_Play

Plays a sound

func void Snd_Play(var string sndName) 

Parameters

  • var string sndName - C_SFX instance name

Snd_Play3D

Snd_Play3D

Plays a sound at the position of the npc

func void Snd_Play3D(var C_NPC npc, var string sndName) 

Parameters

  • var C_NPC npc - instance of the NPC
  • var string sndName - C_SFX instance name