In one of my maps I have a "radio" that plays music. After awhile the song gets annoying.
So, I was wondering.. how do you add a play/stop trigger? (preferably without having to change much of the scripting)
trigger music
Moderator: Moderators
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
This is my existing code for the sound:
Should the new one be like this?:
Code: Select all
local.master = spawn ScriptMaster
local.master aliascache snd_besideyouintime sound/bestest2_music/besideyouintime.mp3 soundparms
1.0 0.1 1.0 0.0 300 2500 auto loaded maps "obj dm"
level waittill spawn
$musicspeaker loopsound snd_besideyouintime
endCode: Select all
local.master = spawn ScriptMaster
local.master aliascache snd_besideyouintime sound/bestest2_music/besideyouintime.mp3 soundparms
1.0 0.1 1.0 0.0 300 2500 auto loaded maps "obj dm"
level waittill spawn
radio_on:
$speaker loopsound (a sound)
$trigger waittill trigger
thread radio_off
end
radio_off:
$speaker stoploopsound (a sound)
$trigger waittill trigger
thread radio_on
end
-
Master-Of-Fungus-Foo-D
- Muffin Man
- Posts: 1544
- Joined: Tue Jan 27, 2004 12:33 am
- Location: cali, United States
egohavoc wrote:This is my existing code for the sound:
Should the new one be like this?:Code: Select all
local.master = spawn ScriptMaster local.master aliascache snd_besideyouintime sound/bestest2_music/besideyouintime.mp3 soundparms 1.0 0.1 1.0 0.0 300 2500 auto loaded maps "obj dm" level waittill spawn $musicspeaker loopsound snd_besideyouintime end
Code: Select all
local.master = spawn ScriptMaster local.master aliascache snd_besideyouintime sound/bestest2_music/besideyouintime.mp3 soundparms 1.0 0.1 1.0 0.0 300 2500 auto loaded maps "obj dm" level waittill spawn radio_on: $speaker loopsound (a sound) $trigger waittill trigger thread radio_off end radio_off: $speaker stoploopsound (a sound) $trigger waittill trigger thread radio_on end
no need for any of that
take a look at this:
Code: Select all
local.master aliascache [aliasname] [soundfile] soundparms [basevolume] [randvolume] [basepitch] [randpitch] [mindist] [maxdist] [channel] loaded maps "obj dm"just edit max distance to the distance that you want the sound to be played (for exmple, if you wanted ti to be played in a 128x128x128 room, youd set it to 128
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:



