[ASK] Convert a C++ Extractor Code to BMS Script !

Doubts, help and support about QuickBMS and other game research tools
Tgames
Posts: 81
Joined: Mon Apr 01, 2019 10:49 am

[ASK] Convert a C++ Extractor Code to BMS Script !

Post by Tgames »

Hi,

Here is the C++ code to extract sounds and TGA files from a HNM V1 archive file (used in Dune CD).

We only need the sound.voc part !!

Can someone just convert it to a BMS Script ?

C++ Code made by Vag :

https://we.tl/t-ZEGz73gGAA

Documentations here :

https://wiki.multimedia.cx/index.php/HNM_(1)

Thanks !!
Last edited by Tgames on Sun Apr 07, 2019 5:31 pm, edited 2 times in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: [ASK] Convert a C++ Extractor Code to BMS Script !

Post by aluigi »

Why do you need a script if already exists a tool?

The tool is mainly a converter that takes the input data and save it as TGA, quickbms is good as extractor but not as converter
Tgames
Posts: 81
Joined: Mon Apr 01, 2019 10:49 am

Re: [ASK] Convert a C++ Extractor Code to BMS Script !

Post by Tgames »

Hi Aluigi !
Thanks for your answer

I need to reinject a sound.voc into a HNM.
(Original is english voice, we have a new one with french voice).

This C++ code only extract the data :(

This tool extract TGA files and a single sound.voc.

We don't need the TGA files at all, only the sound.voc.

We already finished at 99% the entire translation of the game with french voices.
But the HNM file (opening cutscene) is the only one who got a english voice to replace. And we are not able to do that.
We hope that a BMS Script will allow to inject the sound.voc to replace an existant one.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: [ASK] Convert a C++ Extractor Code to BMS Script !

Post by aluigi »

I have seen you created another topic in the Code section, is it a duplicate? can I delete it?
Tgames
Posts: 81
Joined: Mon Apr 01, 2019 10:49 am

Re: [ASK] Convert a C++ Extractor Code to BMS Script !

Post by Tgames »

Yes please, i posted to the wrong section for the other topic !

This fan translation project is up since 2 years.

And another question, is a BMS Script able to cut in files the export we made of french voices from the Mega CD Version ?

https://we.tl/t-xccAS6Qcwa
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: [ASK] Convert a C++ Extractor Code to BMS Script !

Post by aluigi »

Try this:

Code: Select all

get NAME basename
string NAME + ".voc"
log NAME 0 0
append
math i = 0
get HNM_SIZE asize
for NEXT_OFF = 0 != HNM_SIZE
    get SIZE short
    math NEXT_OFF + SIZE
    math SIZE - 2

    if i == 0
        # palette
    else
        do
            savepos CHK
            get TAG short
            get TAG_SIZE short
            math CHK + TAG_SIZE
              if TAG u== 0x7470 #'tp'
            elif TAG u== 0x6c6b #'lk'
            elif TAG u== 0x6473 #'ds'
                math TAG_SIZE - 4
                savepos OFFSET
                log NAME OFFSET TAG_SIZE
            elif TAG u== 0x6c70 #'lp'
            else
                break
            endif
            goto CHK
        while CHK != NEXT_OFF
    endif

    goto NEXT_OFF
next i
append


Reimporting is limited by size
Tgames
Posts: 81
Joined: Mon Apr 01, 2019 10:49 am

Re: [ASK] Convert a C++ Extractor Code to BMS Script !

Post by Tgames »

Thanks a lot aLuigi !

It's work !

I have just an issue now the cutscene is speedup a lot.
Maybe indeed the size issue, i have to compress more my .Voc file.
I will confirm if it's this in a few minutes.

Do you think there is a way to split theses voices from the export we made from the DUNE.DAT of the Mega CD ?
Or it's still better to search for the header to re-extract theses files from the Mega CD ISO ?

Here is the ISO :
https://we.tl/t-yFHrgOt2iU

Edit 1: Indeed you have right, i just have to import a less or equal .VOC file in size and it's work perfectly.