Wolf3d Haven Forum

Please log in or register. Smile
Wolf3d Haven Forum

A friendly Wolfenstein 3D community, about Wolfenstein 3D, the game that gave birth to first person shooters...


    [solved]Wolf4SDL - How to add a new sounds

    avatar
    Josip_2P2
    Freshmen
    Freshmen

    Number of posts : 10
    Age : 24
    Registration date : 2019-02-04

    [solved]Wolf4SDL - How to add a new sounds Empty [solved]Wolf4SDL - How to add a new sounds

    Post by Josip_2P2 on Mon Feb 04, 2019 2:02 am

    Hello, my first post.

    Can you tell me please, how can I add a new sounds(for example, enemy sight/die sound) in the Wolf4SDL that everything works properly?

    I used before an old Wolf3D source code and there was no problem with adding sounds in the game(change NUMSOUNDS and NUMSNDCHUNKS value, add sound names in audiowl6.h list and wl_main.c list, compile and that's all, and of course add sounds in mapeditor).

    Now, I see that new code(Wolf4SDL) requires another way to add sounds...
    I do the same with Wolf4SDL code as I did with Wolf3D code. Of course that I didnt change NUMSOUNDS and NUMSNDCHUNKS value(instead of numbers there is due with LASTSOUNDS), so I searched for SOMETHING to change in id_ca.h, id_ca.cpp, id_sd.h, id_sd.cpp, wl_inter.h, but I dont know exactly what to do..
    So whats happening, where is the problem? When game starts, instead of start screen music(NAZI_NOR_MUS), VICTORS_MUS plays right until menu screen...and then.. ta-da, game crashes..

    So, what can cause this problem, and again how can it be fixed that everything works properly, what I need to change and where, or its something more to do, to rewrite etc. ?

    Btw I use Code::Blocks for compiling and Chaos editor for making maps, adding sprites, sounds, music etc.

    Thank you for helping me.


    Last edited by Josip_2P2 on Wed Feb 06, 2019 1:29 pm; edited 1 time in total
    Princess Peach
    Princess Peach
    Can I Play, Daddy?
    Can I Play, Daddy?

    Female
    Number of posts : 49
    Age : 13
    Location : Canada
    Registration date : 2017-01-28

    [solved]Wolf4SDL - How to add a new sounds Empty Re: [solved]Wolf4SDL - How to add a new sounds

    Post by Princess Peach on Mon Feb 04, 2019 5:52 am

    Hi Josip_2P2,

    I think you will have to add a soundname for it to AUDIOWL6.H above LASTSOUND:
    https://github.com/AlumiuN/Wolf4SDL/blob/master/AUDIOWL6.H#L101

    There is also wolfdigimap you should add it to but that is the same as DOS:
    https://github.com/AlumiuN/Wolf4SDL/blob/master/WL_MAIN.CPP#L971

    Each new sound will need it's own pc, adlib, and digi sound added for it (I think WDC allows you to add all 3 at once).
    avatar
    Josip_2P2
    Freshmen
    Freshmen

    Number of posts : 10
    Age : 24
    Registration date : 2019-02-04

    [solved]Wolf4SDL - How to add a new sounds Empty Re: [solved]Wolf4SDL - How to add a new sounds

    Post by Josip_2P2 on Mon Feb 04, 2019 6:37 am

    Hi Princess Peach!
    I know that and I did it before as I wrote in my first post, but that didn't work!
    There must be something more to change in the code(I don't know in which files exactly)..
    Exactly, I don't understand a NUMSOUNDS and NUMSNDCHUNKS state in code for Wolf4SDL. In Wolf3d source code it was not the case(requires only to increase the values).
    My first entailment was that there should be some #define for NUMSOUNDS and NUMSNDCHUNKS or something what is connected with it somewhere in the files, but I didn't find any..
    There must be solution in the code for this (for me simple) case, but I'm not that good with Wolf4SDL, so I need help Smile
    Princess Peach
    Princess Peach
    Can I Play, Daddy?
    Can I Play, Daddy?

    Female
    Number of posts : 49
    Age : 13
    Location : Canada
    Registration date : 2017-01-28

    [solved]Wolf4SDL - How to add a new sounds Empty Re: [solved]Wolf4SDL - How to add a new sounds

    Post by Princess Peach on Mon Feb 04, 2019 7:11 am

    @Princess Peach wrote:Each new sound will need it's own pc, adlib, and digi sound added for it (I think WDC allows you to add all 3 at once).

    Did you see this part of my post? I don't think ChaosEdit allows you to do this, you will need to use WDC Wink
    avatar
    Josip_2P2
    Freshmen
    Freshmen

    Number of posts : 10
    Age : 24
    Registration date : 2019-02-04

    [solved]Wolf4SDL - How to add a new sounds Empty Re: [solved]Wolf4SDL - How to add a new sounds

    Post by Josip_2P2 on Mon Feb 04, 2019 7:23 am

    Hehe, oh well I saw it, but I think that I didn't understand it well Smile.
    I will try do this with WDC instead of Chaos Editor.


    Well, thank you a lot for help. Good luck.


    Last edited by Josip_2P2 on Mon Feb 04, 2019 2:24 pm; edited 1 time in total
    avatar
    Josip_2P2
    Freshmen
    Freshmen

    Number of posts : 10
    Age : 24
    Registration date : 2019-02-04

    [solved]Wolf4SDL - How to add a new sounds Empty Re: [solved]Wolf4SDL - How to add a new sounds

    Post by Josip_2P2 on Mon Feb 04, 2019 11:02 am

    OK, I understand why is this now, cause I use WDC for the first time.

    Now, the problem is how can I overwrite these new added sounds. In the "Sounds" window they are blue, not green like other sounds. In the "PC sounds" and "Adlib sounds" they are marked with * sign.
    What should I do?

    EDIT:

    I managed to run the game with included new sounds, but when the new sound starts to play in the game, there is error "SD_PlaySound() - Uncached sound"..I know that location, it's in id_sd.cpp in "SD_PlaySound" function. That means that the new sounds are not overwrited(properly) in vswap.wl6.
    So, I don't know how to do it in WDC.. Sad
    avatar
    Josip_2P2
    Freshmen
    Freshmen

    Number of posts : 10
    Age : 24
    Registration date : 2019-02-04

    [solved]Wolf4SDL - How to add a new sounds Empty Re: [solved]Wolf4SDL - How to add a new sounds

    Post by Josip_2P2 on Wed Feb 06, 2019 1:27 pm

    [SOLUTION]

    Use WDC program:
    In "Sound Tools" menu use "Add a new sound" wizard to add all of three types for your new sound (PC, Adlib and Digital sound).
    In "File" menu, compile all OR compile only "AUDIOT" and "VSWAP".
    In AUDIOWL6.H above LASTSOUND add a new sound name.
    In WL_MAIN add a new sound name in wolfdigimap after sound number 45(ROSESND).

    Of course, don't forget to compile all of these changes. But before that, one more thing.

    I did all of these steps already before, but where was my problem...
    It is in VERSION.H:
    WDC program needs some test folder(different from base folder). So, in that test folder I forgot to change the WOLF3D DATA FILES location.
    Every time, when I run the game with compiler or game itself in its folder, the game crushes because I forget to change this line in VERSION.H:
    #define DATADIR "/xxx/xxx/.../xxx/Wolf4SDL Folder/"

    This line represents location of the WOLF3D data files.
    Instead of that address just put:

    #define DATADIR ""

    OR

    #define DATADIR "./"

    Finally, now the game is ready for compiling and running with your new sound.

    Good luck!

    Sponsored content

    [solved]Wolf4SDL - How to add a new sounds Empty Re: [solved]Wolf4SDL - How to add a new sounds

    Post by Sponsored content


      Current date/time is Mon Nov 18, 2019 6:27 pm