Announcement

Collapse
No announcement yet.

sound players

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • sound players

    Hi folks, I'm trying to make a generic sound player where you can specify the filepath of the sound to be played in-editor. I'm not sure what's the correct way to go about it.

    Looking at quake's default ambient sound players, I was wondering if you could grab the key/value set in the editor. The key being something like "filepath" and the value being a string like "ambient/test.wav".

    Code:
    void() soundbox =
    {
    	precache_sound ("X");
    	ambientsound (self.origin, "X", 0.5, ATTN_STATIC);
    };
    if this is the right way to go about it, how can I grab the key value assigned in the editor and put it where "X" is in the above code?
    www.youtube.com/user/KillPixel

  • #2
    See Arcane Dimensions source code. Similar to misc_model but there should be a "play a sound by name" function (misc_sound? I don't know what they called it), it is probably listed in the readme.

    The short version is that you have to the precache the sound based on one of the fields.

    For misc_model in Arcane Dimensions, I think you specify "mdl" "progs/zombie.mdl" so the misc_sound or whatever they called it would be similar.
    Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

    So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

    Comment


    • #3
      thanks, baker. I'm checking it out.

      EDIT: figured it out. it's just self.noise.
      Last edited by KillPixel; 01-27-2017, 09:26 PM.
      www.youtube.com/user/KillPixel

      Comment


      • #4
        A lot of the player sounds are just using the sound command, seems other items have 1 sound ie self.noise.

        Code:
        sound (self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM);
        www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

        Comment

        Working...
        X