Author Topic: Trigger Based Sound Effect  (Read 317 times)

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Trigger Based Sound Effect
« on: May 09, 2011, 12:16:24 am »


               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!
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Trigger Based Sound Effect
« Reply #1 on: May 09, 2011, 02:27:38 am »


               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 .
                     
                  


            

Legacy_9fires

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Trigger Based Sound Effect
« Reply #2 on: May 11, 2011, 05:30:17 am »


               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));
}
               
               

               
            

Legacy_9fires

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Trigger Based Sound Effect
« Reply #3 on: May 11, 2011, 05:31:12 am »


               '<img'>
               
               

               
            

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Trigger Based Sound Effect
« Reply #4 on: May 14, 2011, 02:53:04 am »


               I like both examples. Thanks very much!