This is entirely possible, as Trylon hinted, without using any python. It's all done in alcscript. You just use a start sound message. I had this as an example in the original sound tutorial, but someone wrote another sound tutorial and stripped out my demo sound message alcscript.
the original wiki article is
herethe script is here:
- Code: Select all
<some object>:
logic:
actions:
- type: responder
name: SoundResp (name or tag for modifier ref)
responder:
states:
- cmds:
- type: soundmsg
params:
receivers:
- 0011:<Name of emitter object>
cmds:
- play (start the sound)
- stop (stop the sound)
- setvolume (set the volume)
volume: 1 (volume only set if setvolume cmd is used)
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detect_trigger
Basically, to use that message, you just have some sort of trigger, such as a region, or a clickable alcscript reference SoundResp, and it will send the message to either start or stop the sound.
I've been meaning to update the sound region quickscript so that it supports one way triggers for sounds, (ie, only turns the sound on, or off) but haven't had the time recently.
(I realize this may not be an adequate explanation for those who don't already understand alcscript, but this was a quick post. Perhaps I'll either make a template, or make a new quickscript, sometime in the near future.)