Aller au contenu

Photo

Trigger Based Sound Effect


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Badwater

Badwater
  • Members
  • 113 messages
I want to do something fun for my module, and I can think of other uses for something like this as well. What I'd like to do is get a sound effect when a PC steps on a trigger. Specifically I'd like a bear roar when someone steps on a bear rug. I haven't had any experience in working with sound effects, however, and at this point I don't know where to reference sound effects that I can use in scripting.

I'd appreciate if any of you kind folk could point me in the right direction in pulling this off. I thought it would be fun and might lead to other things as well. :devil:

Thanks in advance!

#2
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
You could use a script like so:

void main()
{
    object oPC = GetEnteringObject();
    AssignCommand(oPC, PlaySound("c_bear_atk1"));
    /*These are the different bear sounds you can use:
    c_bear_atk1
    c_bear_atk2
    c_bear_atk3
    c_bear_bat1
    c_bear_bat2
    c_bear_dead
    c_bear_hit1
    c_bear_hit2
    c_bear_no
    c_bear_slct
    c_bear_yes
    */
}


The best way for me to find the sounds I want is to just slap down any sound in the area, then go into its properties and click on "Add Sounds"(If you can't click "Add Sounds" it's because you picked a looping sound. You can go into the advanced tab and then down where it says "play style" click on "once". You should be able to click "add sounds" after that.). A window will pop up with all the different sound resources that are available to play. Then just go through all the bazillion sounds and test em out by clicking the play button at the top of the window. They do follow a naming convention that eventually you will get the hang of and make it easier to find sounds.

Hope it helps. Good luck.

P.S. Funny idea by the way. :lol:

Modifié par GhostOfGod, 09 mai 2011 - 01:35 .


#3
9fires

9fires
  • Members
  • 3 messages
void main()
{
object oPC = GetEnteringObject();
string sGrunt;
switch (Random (11)+1)
{
case 1: sGrunt = "c_bear_atk1"; break;
case 2: sGrunt = "c_bear_atk2"; break;
case 3: sGrunt = "c_bear_atk3"; break;
case 4: sGrunt = "c_bear_bat1"; break;
case 5: sGrunt = "c_bear_bat2"; break;
case 6: sGrunt = "c_bear_dead"; break;
case 7: sGrunt = "c_bear_hit1"; break;
case 8: sGrunt = "c_bear_hit2"; break;
case 9: sGrunt = "c_bear_no"; break;
case 10: sGrunt = "c_bear_slct"; break;
case 11: sGrunt = "c_bear_yes"; break;
}
AssignCommand(oPC, PlaySound(sGrunt));
}

#4
9fires

9fires
  • Members
  • 3 messages
:)

#5
Badwater

Badwater
  • Members
  • 113 messages
I like both examples. Thanks very much!