+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Following Sounds E2

  1. #1
    Wirererer grandpapolly's Avatar
    Join Date
    Aug 2008
    Posts
    283

    Default Following Sounds E2

    Hey everybody. I need help once again.

    I need to make it so that I can play a sound file and it will follow me wherever I go.


    I/E

    Code:
    @name Something
    
    soundPlay(1, 10, "Sound File")
    soundPitch(1, Pitch Here)
    
    Something with owner()
    Then I want that sound to follow me (Owner) wherever I go.

    How can I do this without making the E2 code follow me? I just want it to play wherever I go.

    Thanks.

  2. #2
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: Following Sounds E2

    I'm not sure you can remotely play sounds like that, you'd need a sound emitter near you.

  3. #3
    Wirererer grandpapolly's Avatar
    Join Date
    Aug 2008
    Posts
    283

    Default Re: Following Sounds E2

    Well I got this code from a friend...who got it from a friend, etc. This plays the sound at the person, or whatever.

    Code:
    @name Owner Sounds
    @persist P AR:array
    
    interval(1)
    
    Play = 3
    
    if(first()) {
        AR:setString(1,"ambient/opera.wav")
        AR:setString(2,"vo/npc/female01/upthere01.wav")
        AR:setString(3,"npc/zombie_poison/pz_breathe_loop2.wav")
        AR:setString(4,"npc/zombie/moan_loop3.wav")
        AR:setString(5,"ambient/creatures/teddy.wav")
        AR:setString(6,"vo/ravenholm/madlaugh03.wav")
        AR:setString(7,"vo/Citadel/br_laugh01.wav")
        AR:setString(8,"vo/eli_lab/al_laugh02.wav")
        AR:setString(9,"vo/npc/Barney/ba_laugh02.wav")
    }
    if(owner():vel():length() > 40) {P = 1} else{P = 0}
    if (P&$P){
        if(Play == 10) {owner():soundPlay(owner():id(),0,AR:string(randint(1,9)))}
        else{owner():soundPlay(owner():id(),0,AR:string(Play))}
    }
    if(!P&$P) {soundPurge()}
    soundPitch(owner():id(),floor(owner():vel():length()*100/250))

    I want the same thing as that, except with one sound, and it does not change pitch as you move.

  4. #4
    Wire Sofaking SatansSimon's Avatar
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    513

    Default Re: Following Sounds E2

    You could test something like this pseudo:
    [highlight=E2]
    if(owner():vel():length() > 40)
    {
    owner():soundplay(<parameters here>)
    }
    [/highlight]

  5. #5
    Wirererer grandpapolly's Avatar
    Join Date
    Aug 2008
    Posts
    283

    Default Re: Following Sounds E2

    Hmmm...Didn't work. Any other suggestions?

  6. #6
    Wire Sofaking SatansSimon's Avatar
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    513

    Default Re: Following Sounds E2

    That was only pseudo-code, but I assume that you can let entities play a sound.

  7. #7
    Wire Noob 117KILLER117's Avatar
    Join Date
    Jan 2009
    Posts
    6

    Default Re: Following Sounds E2

    maybe make the sound emmiter follow you around.

  8. #8
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: Following Sounds E2

    Little note:
    If you are not near when a sound is started by E2, you won't hear it afterwards.
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  9. #9
    Wirererer Masogir's Avatar
    Join Date
    Mar 2008
    Posts
    292

    Default Re: Following Sounds E2

    Quote Originally Posted by grandpapolly View Post
    Hey everybody. I need help once again.

    I need to make it so that I can play a sound file and it will follow me wherever I go.


    I/E

    Code:
    @name Something
    
    soundPlay(1, 10, "Sound File")
    soundPitch(1, Pitch Here)
    
    Something with owner()
    Then I want that sound to follow me (Owner) wherever I go.

    How can I do this without making the E2 code follow me? I just want it to play wherever I go.

    Thanks.
    Code:
    @name Something
    if(first()) {owner():soundPlay(0,0,"Sound File")}
    Couple things to keep in mind if it doesn't work:
    Server might not have a wiremode version that supports E:soundPlay()
    When typing your file path make sure to use "/" and NOT "\" (unless they recently fixed this).

  10. #10
    Wirererer grandpapolly's Avatar
    Join Date
    Aug 2008
    Posts
    283

    Default Re: Following Sounds E2

    I tested the code I posted above on a server. It worked. I went back to that same server and am trying to get a code for this to work. But I can't seem to do it. So the server has the same wiremod svn settings, etc. It does support E:soundPlay().

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. I'm sorry if it sounds nuby
    By wicked202 in forum Installation and Malfunctions Support
    Replies: 13
    Last Post: 03-06-2009, 03:01 PM
  2. Sounds - Expression 2
    By ZeikJT in forum Wiremod Addons & Coding
    Replies: 24
    Last Post: 02-05-2009, 11:57 PM
  3. I need more wire sounds.
    By jorge in forum Installation and Malfunctions Support
    Replies: 2
    Last Post: 03-12-2008, 06:33 PM
  4. HL2 Windows sounds
    By ace1313 in forum Off-Topic
    Replies: 4
    Last Post: 07-14-2007, 04:37 AM
  5. sounds
    By red11392 in forum Wiremod General Chat
    Replies: 4
    Last Post: 07-10-2007, 07:52 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots