Register a new ambient sound template to play.
Register a new ambient sound template to play.
1 table data
the ambient sound template.
-- taken from game/basic_ambient_sounds.lua local function genericTimeOfDayCheck(self) local time = timeOfDay:getTime() if self.timeOfDay.min > self.timeOfDay.max then return time > self.timeOfDay.min or time < self.timeOfDay.max end return time > self.timeOfDay.min and time <= self.timeOfDay.max end local birds = {} birds.id = "birds" birds.type = ambientSounds.playType.PLAYONCE birds.timeOfDay = {min = 260, max = 1260} birds.sound = {"ambient_birds"} birds.frequency = {min = 15, max = 20} birds.vol = 0.05 birds.meetsRequirements = genericTimeOfDayCheck ambientSounds.registerSound(birds) -- this registers the sound of birds chirping to play only during the day