You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to the existing functions in the disabled lua vscript. Right now the only ways to play sounds are quite cumbersome:
Spawn a point_soundevent via a template and play it, all players will hear this.
Use play via Instance.ClientCommand, in this case only the given client hears the sound. But its volume is separate from the rest of the game, controllable via snd_toolvolume only.
Ideally the sound API would consist of something like the following:
// Plays a sound event on the entity, returns the sound event GUID to use with SetSoundEventParamEntity.EmitSound(soundEvent: string): number;// Plays a sound event on the entity but only the given players can hear it, same return as aboveEntity.EmitSoundToPlayers(soundEvent: string,players: CSPlayerController[]): number;// Sets the given sound event parameter on an active sound event instance, this is what the snd_event_params entity does// For example "volume" or "pitch"Instance.SetSoundEventParam(soundEventGUID: number,paramName: string,paramValue: number): void;// Stops the given sound event instanceInstance.StopSoundEvent(soundEventGUID: number): void;
Perhaps the EmitSound functions could instead return an object representing the sound event instance, and it would then have all the relevant functions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Similar to the existing functions in the disabled lua vscript. Right now the only ways to play sounds are quite cumbersome:
playviaInstance.ClientCommand, in this case only the given client hears the sound. But its volume is separate from the rest of the game, controllable viasnd_toolvolumeonly.Ideally the sound API would consist of something like the following:
Perhaps the EmitSound functions could instead return an object representing the sound event instance, and it would then have all the relevant functions.
Beta Was this translation helpful? Give feedback.
All reactions