Skip to content

Commit 1c79296

Browse files
committed
implement some main objective ambient loops
1 parent 61cd5ac commit 1c79296

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

Data/Browncoats.rte/Scenes/Objects/Breakables/RefineryConsole/RefineryConsole.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ function Create(self)
22

33
self.Activity = ToGameActivity(ActivityMan:GetActivity());
44

5+
self.loopSound = CreateSoundContainer("Yskely Refinery Refinery Console Loop", "Browncoats.rte");
6+
self.loopSound:Play(self.Pos);
57
end
68

79
function OnDestroy(self)
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
function Create(self)
2-
32
self.Activity = ToGameActivity(ActivityMan:GetActivity());
43

4+
self.loopSound = CreateSoundContainer("Yskely Refinery Refinery Generator Loop", "Browncoats.rte");
5+
6+
-- It's one loop for many generators, so avoid direct overlap
7+
-- This will potentially sound bad if loading a game near the generators, but not as bad as having them overlap
8+
self.randomLoopStartTimer = Timer();
9+
self.randomLoopStartTime = math.random(500, 10000);
510
end
611

7-
function OnDestroy(self)
12+
function ThreadedUpdate(self)
13+
if (not self.loopSound:IsBeingPlayed()) and self.randomLoopStartTimer:IsPastSimMS(self.randomLoopStartTime) then
14+
self.loopSound:Play(self.Pos);
15+
end
16+
end
817

18+
function OnDestroy(self)
919
self.Activity:SendMessage("RefineryAssault_RefineryGeneratorBroken");
10-
1120
end

Data/Browncoats.rte/Scenes/Sounds.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ AddSoundContainer = SoundContainer
8787
LoopSetting = -1
8888
AttenuationStartDistance = 190
8989
AddSound = Browncoats.rte/Scenes/Sounds/Refinery_LogisticsConsoleLoop.flac
90+
91+
AddSoundContainer = SoundContainer
92+
PresetName = Yskely Refinery Refinery Console Loop // intended repetition
93+
Priority = 127 // just above the default
94+
LoopSetting = -1
95+
AttenuationStartDistance = 190
96+
AddSound = Browncoats.rte/Scenes/Sounds/Refinery_RefineryConsoleLoop.flac
9097

9198
AddSoundContainer = SoundContainer
9299
PresetName = Yskely Refinery Drill Idle Loop
@@ -156,6 +163,13 @@ AddSoundContainer = SoundContainer
156163
PanningStrengthMultiplier = 0
157164
Priority = 50
158165
AddSound = Browncoats.rte/Scenes/Sounds/Refinery_S4DoorsExploDistant.flac
166+
167+
AddSoundContainer = SoundContainer
168+
PresetName = Yskely Refinery Refinery Generator Loop // intended repetition
169+
Priority = 127 // just above the default
170+
LoopSetting = -1
171+
AttenuationStartDistance = 150
172+
AddSound = Browncoats.rte/Scenes/Sounds/Refinery_RefineryGeneratorLoop.flac
159173

160174
AddSoundContainer = SoundContainer
161175
PresetName = Yskely Refinery Ambience Ext
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)