Thunder and Fx for Skuggs Tileset
Posted: Sun Mar 22, 2015 10:54 am
Hi all. A friend of mine wrote this script for me. It adds Thunder noise and Light fx to the rain system that Skuggs has in his Winter Tile Set.
1 - Connect a floor trigger to: function enableThunder() to activate the script and to end add floor trigger to: function disableThunder()
2 - This code line (if party.level ~= 6 or THUNDER == false then --ONLY THIS LEVEL--) The number 6 represents the level this script will work on eg: once you leave level 6 the Thunder script stops. When you enter level 6 again the Thunder script activates. What it means if you are in level 5 you don't hear the sound etc.. until return to level 6.
3 - You can change the number to what ever level you want the script to work on. If you want more than one level then copy/paste the script to that level and change level number eg: 1 etc...
Big Thank You to ArtTru
1 - Connect a floor trigger to: function enableThunder() to activate the script and to end add floor trigger to: function disableThunder()
2 - This code line (if party.level ~= 6 or THUNDER == false then --ONLY THIS LEVEL--) The number 6 represents the level this script will work on eg: once you leave level 6 the Thunder script stops. When you enter level 6 again the Thunder script activates. What it means if you are in level 5 you don't hear the sound etc.. until return to level 6.
3 - You can change the number to what ever level you want the script to work on. If you want more than one level then copy/paste the script to that level and change level number eg: 1 etc...
Big Thank You to ArtTru
Code: Select all
THUNDER = false
function enableThunder()
if THUNDER == false then
THUNDER = true
ThunderSound()
end
THUNDER = true
end
function disableThunder()
THUNDER = false
end
-- Random Thunder Sound --
function ThunderSound()
if party.level ~= 6 or THUNDER == false then -- ONLY THIS LEVEL --party.level ~= 3 or
THUNDER = false
return false
end
playSound("lightning_bolt_hit",party.level, party.x, party.y, 0)
local dx = math.random(-6,6) + party.x
local dy = math.random(-6,6) + party.y
dx = math.max(math.min(dx, 31),0)
dy = math.max(math.min(dy, 31),0)
local Target = spawn("thunder_light", party.level, dx, dy, 0, party.elevation )
local ThTimeMin = 3.0
local ThTimeMax = 6.0
local TimeToNext = math.random(ThTimeMin*10, ThTimeMax*10)/10.0
delayedCall(self.go.id, TimeToNext, "ThunderSound")
end