GSC reference › Built-in
SetLoopState()
Built-in (engine)
Client
Set pitch and volume per entity/alias
Signature
SetLoopState(<aliasname>, <attenuation>, <pitch>, [attenuation_rate], [pitch_rate])
Parameters
| Name | Required? | Details |
|---|---|---|
| aliasname | Required | The sound alias to play |
| attenuation | Required | The desired volume attenuation |
| pitch | Required | The desired pitch |
| attenuation_rate | Optional | The desired attenuation rate |
| pitch_rate | Optional | The desired pitch rate |
Example (from Treyarch's docs)
car SetLoopState( "peugeot_idle_low", 0.5, 1.0, 0.5, 0.2 )
Real uses in BO3's scripts
Called 29 times in the decompiled scripts. A few, zombies first:
- scripts/zm/zm_tomb_amb.csc, line 578
self.var_29fe0572 setloopstate("zmb_tomb_slowed_movement_loop", var_fef3a6cb, 1); - scripts/zm/zm_tomb_amb.csc, line 1015
heli_bone.run setloopstate(heli_bone.run.alias, run_volume, run_pitch, 1, 0.15); - scripts/mp/_helicopter_sounds.csc, line 766
heli_bone.run setloopstate(heli_bone.run.alias, run_volume, run_pitch, 1, 0.15); - scripts/cp/_helicopter_sounds.csc, line 751
heli_bone.run setloopstate(heli_bone.run.alias, run_volume, run_pitch, 1, 0.15); - scripts/cp/cp_mi_cairo_aquifer_utility.csc, line 707
self setloopstate("veh_bullshark_dogfight_maneuvers", 0.5, 1);
Related built-ins
- PlayLoopSound()Play a looping sound with an optional fadetime in seconds.
- StopLoopSound()Stops the looping sound with an optional fadetime.
- SetZBarrierPieceState()Set's the state of the piece indexed in the zbarrier ent.
- StopAllLoopSounds()Stops a loop sound
- GetZBarrierPieceState()Returns the state of the piece indexed in the zbarrier ent.
- SoundLoopEmitter()Play a sound loop at the position
- Objective_State()Set a state for the objective
- IsInScriptedState()Checks if actor is in a scripted state (animscripted, custom, negotiation)
- SoundStopLoopEmitter()Stop the sound loop emitter at the position
- PlayRumbleLoopOnEntity()Plays a looping rumble on the given entity.
- IsAnimLooping()Gets whether an animation is looped or not
- GetZBarrierPieceIndicesInState()Returns an array of integer indices of the zbarriers pieces that are in the specified state.
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).