Page 1 of 4
some questions
Posted: Sat Aug 20, 2005 8:58 pm
by Barttje
hi all
im making an map but i want on a trigger a sound (mohaa/main/mechanics/Mec_Alarm_10.wav) that if you press the use key this sound will play...
And how do i say that if you use the trigger then you must wait 120 seconds and then you can use it again...
Posted: Sat Aug 20, 2005 9:19 pm
by At0miC
Make in your map a trigger:
make a brush with the green trigger texture (under textures/common).
Hit N and give it a key: classname and value: trigger_use and also key: targetname and value: trigger
Now you got the trigger in your map.
You also need a speaker somewhere from wheere the sound is coming:
Rightclick > sound/speaker, and hit N and give it a key: targetname and value: speaker.
In your .scr file:
Under main:
local.master aliascache alarm sound/mechanics/Mec_Alarm_10.wav soundparms 1.0 0.0 1.0 0.0 1024 6000 auto loaded maps "m dm moh obj "
and
thread alarmtrigger
-------
alarmtrigger:
$trigger waittill trigger // when u hit 'use'at the trigger, the script will start
$speaker playsound alarm // the speaker will play the sound, "alarm" is the link to local.master aliascache (see above)
wait 120
thread alarmtrigger
end
-------
This should work fine, you can change the targetnames or threadname etc ofcourse. Also you might have to change the value's of the soundparms, it depends in what you want. Anyway, the speaker can also be something else, like the trigger itself ($trigger playsound alarm) so it doesn't have to be a speaker model.
?
Posted: Sun Aug 21, 2005 12:09 pm
by Barttje
what does 1.0 0.0 1.0 0.0 1024 6000 means in
local.master aliascache alarm sound/mechanics/Mec_Alarm_10.wav soundparms 1.0 0.0 1.0 0.0 1024 6000 auto loaded maps???
Posted: Sun Aug 21, 2005 12:19 pm
by Cobra
Soundparms are for BaseVolume, RandVolume, BasePitch, randPitch, minDist , maxDist , Channel codes etc.
Posted: Sun Aug 21, 2005 12:20 pm
by At0miC
It's all explained here:
http://dynamic.gamespy.com/%7Emap/mohaa/t.php?id=11
I forgot to say u also need to put "local.master = spawn ScriptMaster" above:
local.master aliascache alarm sound/mechanics/Mec_Alarm_10.wav soundparms 1.0 0.0 1.0 0.0 1024 6000 auto loaded maps "m dm moh obj "
Posted: Sun Aug 21, 2005 12:37 pm
by Barttje
my trigger still doesn't work....

Posted: Sun Aug 21, 2005 6:57 pm
by jv_map
Trigger can't play sound, use something that has a TIKI model.
Posted: Sun Aug 21, 2005 7:29 pm
by Barttje
can you say me how by a radio...?
Posted: Sun Aug 21, 2005 9:10 pm
by At0miC
Give the model a key: targetname and a value: speaker (or whatever you want)
then in the script (see above):
$speaker playsound alarm
Trigger can't play sound
It is possible to use brushes as a speaker, I've done it myself once =)
Posted: Mon Aug 22, 2005 10:29 am
by Barttje
can you say me how to place a sound on a object...?
like
by a phone rings the phone sound....
Posted: Wed Aug 24, 2005 2:06 pm
by Barttje
???
Posted: Wed Aug 24, 2005 5:15 pm
by panTera
In Radiant,
-make a speaker entity near the phone: (Rightclick -> sound > speaker),
-press N and set a targetname of phone_speaker (or anything you like).
key: targetname
value: phone_speaker
In your script file,
under 'main' write the next (only the yellow parts):
----------
main:
local.master = spawn ScriptMaster
local.master aliascache telephone sound/mechanics/Mec_PhoneRing_01.wav soundparms 1.0 0.0 1.0 0.0 200 1200 auto loaded maps "m dm moh obj " //this is for the phone sound
local.master aliascache alarm sound/mechanics/Mec_Alarm_10.wav soundparms 1.0 0.0 1.0 0.0 1024 6000 auto loaded maps "m dm moh obj "" //this is for the alarm sound
level waittill prespawn
exec global/DMprecache.scr
level.script=maps/dm/yourmapname.scr
level waittill spawn
wait 1
$phone_speaker loopsound telephone
end
----------
Extra info:
To make sounds work in mohaa you first need to know which sounds will work in custom maps and which won't. Most of the cool sounds only work in the Singleplayer maps because of the Ubersound.scr. Okay, let's say you're looking in Pak3.pk3 and you find a cool sound. Write down the name of the .wav file. For example Mec_PhoneRing_01.wav
Now open Pak0.pk3 and look for the file ubersound.scr and extract it. (it can be found in the Ubersound/ directory)
The next step is important. Once you have opened the ubersound.scr (in Wordpad), press Ctrl+f to get a searchwindow; type the name of the wav and Search. I searched for Mec_PhoneRing_01.wav
Wordpad found this line in the Ubersound script:
local.master aliascache telephone sound/mechanics/Mec_PhoneRing_01.wav soundparms 1.0 0.0 1.0 0.0 200 1200 auto loaded maps "m1l2b "
This means that the phone sound only works in the map m1l2b.
But if you look for a sound and you see something like this -> "dm moh obj train" at the end, then the sound will work in your DM map.
Now, because you want to use that telephone sound which only works in m1l2b, you need to make a new alias (the yellow parts) for the sound in your own script file.
----------
Posted: Thu Aug 25, 2005 7:22 pm
by Barttje
tanks, but it still doens't work...

Posted: Thu Aug 25, 2005 7:26 pm
by At0miC
-make a speaker entity near the phone: (Rightclick -> sound > speaker),
-press N and set a targetname of phone_speaker (or anything you like).
Be sure the speaker has to be highlighted before you hit N.
Anyway, can we see your .scr file?
Posted: Thu Aug 25, 2005 7:38 pm
by Barttje
i'm writing in notepad. i don't get:
In Radiant,
-make a speaker entity near the phone: (Rightclick -> sound > speaker),
-press N and set a targetname of phone_speaker (or anything you like).
what are you talking about....
