Maybe there is a way to do it, but you need to dig in lua and CSP lua sdk.
You could write you code in the main loop and overwrite the intensity value:
Now you just have to code something, to control this variable. For this you can just use standard lua code. To get the seconds till AC session is start, you can use os.clock().
This little script will make firework for 10 seconds, every 20 seconds:
Just paste it after line 15:
local last = os.clock()
local duration = 0
function update(dt, intensity, holidayType)
audioPoolPrepare(dt)
if os.clock() - last > 10 then --time after last firework ends
intensity = 1
if duration == 0 then
duration = os.clock()
end
if os.clock() - duration > 10 then --duration of the firework
last = os.clock()
duration = 0
end
else
intensity = 0
end
local piecesSize = #piecesList
for i = piecesSize, 1, -1 do
if not piecesList
:updateBase(dt) then
table.remove(piecesList, i)
end
end
local allowToSpawn = intensity > 0 and piecesSize < 150
for i = 1, pyrosSize do
pyros:update(dt, allowToSpawn, intensity, holidayType)
end
if holidayType == ac.HolidayType.Halloween then
intensity = math.min(intensity, 0.05)
end
-- ac.debug('items', piecesSize)
-- ac.debug('holiday', holidayType)
-- ac.debug('intensity', intensity)
-- runGC()
end