Sound Lua API: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
(Add sound lua api documentation)
 
(Update old slate italics to wiki format)
Line 12: Line 12:
| sourceName || string
| sourceName || string
|}
|}
'''Description''': Triggers a sound even with name _eventName_
'''Description''': Triggers a sound even with name ''eventName''


'''Returns''': The event id, this can be used in other sound API functions (see [[#StopAudio|StopAudio]])
'''Returns''': The event id, this can be used in other sound API functions (see [[#StopAudio|StopAudio]])
Line 30: Line 30:




'''Docs last hacked together on''': 09/05/2017 12:59
'''Docs last hacked together on''': 09/05/2017 13:17

Revision as of 12:18, 9 May 2017

Sound

Description

The sound API allows modders to trigger sound events in game

Functions

TriggerEvent

Sound.TriggerEvent(eventName, sourceName)

Expected parameter types

eventName string
sourceName string

Description: Triggers a sound even with name eventName

Returns: The event id, this can be used in other sound API functions (see StopAudio)

Notes: If _sourceName_ is not provided the sound will be played as a '2D' event

StopAudio

Sound.StopAudio(audioID)

Expected parameter types

audioID number

Description: Stops a playing audio track

Returns: Nothing


Docs last hacked together on: 09/05/2017 13:17