Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Play random music

  1. #11
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,642
    Thanks
    17
    Thanked 981 Times in 616 Posts
    Have you checked whether the playlocalsound script is actually being called?
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

    Sending me a private message makes me want to help you LESS.

  2. The Following User Says Thank You to IzNoGoD For This Useful Post:

    kung foo man (17th November 2020)

  3. #12
    Private
    Join Date
    Nov 2019
    Posts
    20
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Ummm , I added the playlocalsound in sd.gsc into spawnPlayer() function so that's must being called when player spawned... after the playlocalsound I wrote iprintlnBold("Music playing") and that's working ... but I didn't hear any sound.

  4. The Following User Says Thank You to Toxys For This Useful Post:

    kung foo man (17th November 2020)

  5. #13
    Private pollo's Avatar
    Join Date
    Jul 2012
    Location
    Spain
    Posts
    108
    Thanks
    87
    Thanked 63 Times in 30 Posts
    Could be some things:
    - Soundalias pointing to a non-existing sound in "sounds" folder -> check the "file" column points to the right file (also, in console you should see an error like "Couldn't find sound xxxxx.mp3"
    - Sound being overlapped by another sound which is also played in the same channel (eg. if you play music on the local channel and then shoot your weapon, it might kill the previous sound)-> try using another channel, I'd say "auto".
    - Problem with the sound itself: I had trouble months ago with some sounds, apparently it happened because they were being played at 48Khz and in stereo channel; changing the frequency to 44KHz, forcing them to be mono, and making sure they are at least 4 seconds-length (you can generate silence), with the help of an audio editing program (eg. Audacity) fixed it. Just check out how sounds from other mods (or stock ones) are, and edit yours like them.
    Last edited by pollo; 16th November 2020 at 02:00.
    ";" <- Hide and seek champion since 1958.

  6. The Following User Says Thank You to pollo For This Useful Post:

    kung foo man (17th November 2020)

  7. #14
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    440
    Thanks
    78
    Thanked 107 Times in 90 Posts
    Quote Originally Posted by Toxys View Post
    Ummm , I added the playlocalsound in sd.gsc into spawnPlayer() function so that's must being called when player spawned... after the playlocalsound I wrote iprintlnBold("Music playing") and that's working ... but I didn't hear any sound.
    1. attach playing sound on other event
    2. test other sounds
    3. try self playSound() before it's be working
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  8. The Following User Says Thank You to maxdamage99 For This Useful Post:

    kung foo man (17th November 2020)

  9. #15
    Private
    Join Date
    Jun 2013
    Posts
    67
    Thanks
    20
    Thanked 31 Times in 25 Posts
    make sure your folder structure is correct, with the examples posted here your folders should look like this:
    modfoldername(preffered) or main / sound / music / soundfile.xxx
    and offcourse the csv in the soundaliases folder with the header too

    here is a snippet of my file if it looks like this and is placed like described it should work ("my folder name here is fmj")

    name,sequence,file,vol_min,vol_max,vol_mod,pitch_m in,pitch_max,dist_min,dist_max,channel,type,probab ility,loop,masterslave,loadspec,subtitle,compressi on,secondaryaliasname,volumefalloffcurve,startdela y,speakermap,reverb,lfe percentage

    deathx,1,fmj/death01.mp3,1,1,,,,1000000,,auto,streamed
    deathx,2,fmj/death02.mp3,1,1,,,,1000000,,auto,streamed
    deathx,3,fmj/death03.mp3,1,1,,,,1000000,,auto,streamed
    deathx,4,fmj/death04.mp3,1,1,,,,1000000,,auto,streamed
    deathx,5,fmj/death05.mp3,1,1,,,,1000000,,auto,streamed
    deathx,6,fmj/death06.mp3,1,1,,,,1000000,,auto,streamed
    deathx,7,fmj/death07.mp3,1,1,,,,1000000,,auto,streamed
    deathx,8,fmj/death08.mp3,1,1,,,,1000000,,auto,streamed
    deathx,9,fmj/death09.mp3,1,1,,,,1000000,,auto,streamed

  10. The Following User Says Thank You to vanfreddy For This Useful Post:

    kung foo man (17th November 2020)

  11. #16
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    440
    Thanks
    78
    Thanked 107 Times in 90 Posts
    Last edited by maxdamage99; 17th November 2020 at 14:09.
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  12. #17
    Private
    Join Date
    Nov 2018
    Posts
    19
    Thanks
    0
    Thanked 5 Times in 5 Posts
    just do randomint maybe?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •