Another question:
I tried to set a global variable and then using it in a scripting hook.
Basically what I did was
Code: Select all
onMove = function(self, dir)
print(myvariable)
end
Code: Select all
onMove = function(self, dir)
print(myvariable)
end
Code: Select all
function rumblealot()
party:shakeCamera(1, 10)
playSound("earthquake")
end
ok I could make it work withMontis wrote:I want to emulate the random rumbles and screen shakes from the main game but at a specific point (after a trigger). I tried the following but the earthquake sound doesn't stop and loops forevermore.
[omitted code]
I tried cloning the sound object(?) and setting the loop to false but that didn't work. I also tried only having the sound play at a specific location (playSoundAt()) but then it gave an error about "trying to play non-mono sound at location".
Any ideas besides importing a custom sound?
Code: Select all
defineSound{
name = "rumble",
filename = "assets/samples/env/earthquake_01.wav",
volume = 0.5,
minDistance = 2,
maxDistance = 5,
loop = false,
}
Code: Select all
if security:isDown() then
trap1:setTriggeredByParty(disable)
trap1:setTriggeredByMonster(enable)
print("success")
end
Code: Select all
function zaptrigger()
trap1:setTriggeredByParty(disable)
trap1:setTriggeredByMonster(enable)
print("success")
end