Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: WAV String Recycling (MPQ)
WAV String Recycling (MPQ)
Nov 3 2015, 4:08 am
By: Oh_Man  

Nov 3 2015, 4:08 am Oh_Man Post #1

Find Me On Discord (Brood War UMS Community & Staredit Network)

So I remember talking to Farty about this back in the day but I can't find the thread...

Basically as part of my string recycling endevour I wish to convert every single WAV I have into an already used string, becaues the WAV strings use up a solid chunk of the limit. I know it has something to do with MPQ files.

Can someone please explain to me how I go about doing this?




Nov 3 2015, 5:26 am poiuy_qwert Post #2

PyMS and ProTRG developer

Triggers that play WAV's are just referencing a string that contains the path to a wav file in any of starcrafts open mpq's (which includes your map, scm/scx files are renamed mpq files). So for each wav you should be able to:
1) Update all triggers referencing the wav to reference your chosen reuse string (preferable a short string)
2) You can now delete/reuse the old string with old WAV path
3) Open map in MPQ editor (WinMPQ or PyMPQ for example)
4) Rename the wav to match the reuse string exactly

I don't remember how the various map editors handle mpq's, so you might have to close the map in your editor to be able to edit it in step 3.

Hope this makes sense!




Nov 22 2015, 8:41 am Oh_Man Post #3

Find Me On Discord (Brood War UMS Community & Staredit Network)

Quote
2) You can now delete/reuse the old string with old WAV path
I do this in string editor, right? How the hell can I navigate the editor more efficiently?? All I've got is a scroll bar. :S

Can I just move step 2 down to the bottom? Delete all the strings after? Would probably be a lot easier than one at a time.

I can't get this to work. What am I supposed to do with WinMPQ when I rename, just close it? There's no save option. The WAV has disappeared from the list on WinMPQ now, but the WAV itself is no longer playing in-game.

Post has been edited 1 time(s), last time on Nov 22 2015, 8:52 am by Oh_Man.




Nov 22 2015, 1:51 pm Moose Post #4

We live in a society.

Quote from Oh_Man
Quote
2) You can now delete/reuse the old string with old WAV path
I do this in string editor, right? How the hell can I navigate the editor more efficiently?? All I've got is a scroll bar. :S

Can I just move step 2 down to the bottom? Delete all the strings after? Would probably be a lot easier than one at a time.

I can't get this to work. What am I supposed to do with WinMPQ when I rename, just close it? There's no save option. The WAV has disappeared from the list on WinMPQ now, but the WAV itself is no longer playing in-game.

We solved the process, copying shoutbox conversation for reference:

Quote
[09:23 am] Oh_Man -- thanks for all ur help
[09:23 am] Oh_Man -- YES
[09:22 am] Oh_Man -- okay i will now play my map, and see if it works
[09:22 am] Mini Moose 2707 -- Yeah, it can't play it because it's looking for \\wav\\WW.wav and it doesn't know it's actually TEST
[09:22 am] Oh_Man -- okay i will now delete it from sound editor
[09:22 am] Oh_Man -- its still thre, but when i press play no sound occurs
[09:22 am] Mini Moose 2707 -- If it's there, try to play it. It shouldn't work. Then delete it from there
[09:21 am] Mini Moose 2707 -- Hmmmm, go to the .WAV editor, see if it's there
[09:21 am] Oh_Man -- WARNING: Deleting raw strings can cause Staredit and Starcraft to crash. Continue?
[09:21 am] Oh_Man -- and it says string usage: wav files: 1
[09:20 am] Oh_Man -- its still there in the string editor
[09:20 am] Oh_Man -- hmm
[09:20 am] Mini Moose 2707 -- Because it isn't used anymore
[09:20 am] Oh_Man -- damn, wen u got 1877 strings, u really wish for a better string editor
[09:20 am] Mini Moose 2707 -- Yeah, or if you changed all instances of the WAV in your triggers, SCMD2 should just get rid of it for you
[09:20 am] Oh_Man -- and for final step, i delete the string in string editor
[09:20 am] Oh_Man -- k
[09:19 am] Mini Moose 2707 -- If you rename another WAV to TEST, idk wtf winmpq would do
[09:19 am] Oh_Man -- yeah, yeah, thats rite
[09:19 am] Mini Moose 2707 -- So each WAV maps to one recycled string
[09:19 am] Mini Moose 2707 -- Every use of a single WAV to one name
[09:19 am] Oh_Man -- surely i cant change every single WAV to the same name, that wuld not work
[09:18 am] Oh_Man -- coz i'm just testing
[09:18 am] Oh_Man -- no i'm only changing one WAV atm
[09:18 am] Mini Moose 2707 -- Yeah, because staredit\\wav\\WW.wav isn't even in the MPQ anymore, you already changed that to TEST
[09:18 am] Mini Moose 2707 -- According to poiuy, you were supposed to set all the sounds to TEST
[09:18 am] Oh_Man -- sorry i'm changing "staredit\\wav\\WW.wav" to "TEST" thats the full string name
[09:17 am] Oh_Man -- then i delete WW.wav in string editor, but NOT in sound editor; yes?
[09:17 am] Oh_Man -- now i replace all trigger mentions of WW.wav to TEST
[09:16 am] Oh_Man -- now im gonna open my map back up
[09:16 am] Oh_Man -- okay im closing winmpq
[09:16 am] Mini Moose 2707 -- Yeah, pretend it's like working with folders or a ZIP
[09:16 am] Oh_Man -- i close winmpq
[09:16 am] Oh_Man -- so i close it
[09:16 am] Mini Moose 2707 -- Shouldn't have to do anything
[09:16 am] Oh_Man -- coz there's no save feature
[09:16 am] Oh_Man -- do i just close winmpQ?
[09:16 am] Mini Moose 2707 -- SC will be able to find it because it's looking for TEST and TEST is there
[09:16 am] Oh_Man -- but after i rename, then whatdo i
[09:16 am] Oh_Man -- yeah
[09:15 am] Mini Moose 2707 -- Then you rename the .WAV in the MPQ to TEST, because you're not translating any ascii color characters
[09:15 am] Oh_Man -- how do i do that
[09:15 am] Oh_Man -- i'm renaming my WAV file, WW.wav, to TEST
[09:15 am] Oh_Man -- lets say i'm renaming it to TEST
[09:15 am] Oh_Man -- wat the f im doing in this winmpq program
[/quote]

Post has been edited 3 time(s), last time on Nov 22 2015, 2:34 pm by Mini Moose 2707.




Nov 22 2015, 3:56 pm Oh_Man Post #5

Find Me On Discord (Brood War UMS Community & Staredit Network)

New problem now. I did what you said about copy pasting strings from Staredit default:

Looks like this: Verius [Warrior]. Okay SEN isn't even letting me copy paste the character.
Screenshot:


Basically it isn't working, not showing all the colours, and just two identical square boxes.

In SCMDraft it looks like this:
<08>Verius <1D>[<16>Warrior<1D>]
In Trigedit it looks like this:
\x008Verius \x01d[\x016Warrior\x01d]

So which do I use for WinMPQ?




Nov 22 2015, 4:13 pm O)FaRTy1billion[MM] Post #6

👻 👾 👽 💪

You need to use the actual character code, like what you see in StarEdit. They generally aren't printable characters, which is why they are used for color codes. They may not appear to be there but they are (they are basically zero-width spaces).

EDIT:
Your "Verius [Warrior]" does in fact have the characters in it, and is correct.


Post has been edited 5 time(s), last time on Nov 22 2015, 4:26 pm by FaRTy1billion.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Nov 22 2015, 7:17 pm poiuy_qwert Post #7

PyMS and ProTRG developer

Quote from Oh_Man
Quote
2) You can now delete/reuse the old string with old WAV path
Can I just move step 2 down to the bottom? Delete all the strings after? Would probably be a lot easier than one at a time.
You can delete/reuse the string at any point after step 1, you don't have to do it in step 2.

Quote from Oh_Man
In SCMDraft it looks like this:
<08>Verius <1D>[<16>Warrior<1D>]
In Trigedit it looks like this:
\x008Verius \x01d[\x016Warrior\x01d]

So which do I use for WinMPQ?
You should try to use strings that don't have special characters (colors/justify) just to make things easier, but as FaRTy said if you need to use one of them you'll have to use the actual character not the escape sequence used by editors.




Nov 24 2015, 8:06 am Oh_Man Post #8

Find Me On Discord (Brood War UMS Community & Staredit Network)

So does the colour code <08> use four characters or one character in the string limit?

I'm trying to understand how this conversion process affects the string limit.




Nov 24 2015, 8:33 am O)FaRTy1billion[MM] Post #9

👻 👾 👽 💪

<08> uses one character. SCMDraft just shows it as <08> so you can easily read it and type it, but it is stored as the single character in that txt file I sent you between the []s.

For example, paste "[]" in to SCMDraft and then close & reopen the string and it should show something like "[<1D>]". SCMdraft is just doing that so you can see it when otherwise you wouldn't be able to.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Nov 24 2015, 5:06 pm Oh_Man Post #10

Find Me On Discord (Brood War UMS Community & Staredit Network)

Question: can I post the raw code into trigedit and then compile and it will recycle properly, or do I have to use this format:
\x008Verius \x01d[\x016Warrior\x01d]

Just asking to be sure because I can save myself a marginal amount of time if so.

Also I'm working with 150 WAVs FYI.




Nov 24 2015, 11:29 pm Roy Post #11

An artist's depiction of an Extended Unit Death

ScmDraft will compile it. It's just a character inside a string, after all.




Nov 27 2015, 5:46 pm Oh_Man Post #12

Find Me On Discord (Brood War UMS Community & Staredit Network)

The job is done.

BEFORE: 97.6% used (63983 bytes) 1872/1877 strings
AFTER: 92.4% used (60584 bytes) 1727/1877 strings

Thanks for all your help everyone. This helps immensely.

EDIT:
Recycling Comments
AFTER: 90.0% used (59010 bytes) 1611 / 1877 strings

Post has been edited 1 time(s), last time on Nov 29 2015, 11:49 am by Oh_Man.




Nov 30 2015, 12:19 pm Stranger Post #13



Good job, this should make it easier indeed =)

I'm about to run into a similar string problem as Oh_Man... and althought I already recycled a good number of Comment strings, it won't be enough. Also, I'd hate to lose my comments or to recycle them too much (I have over 80000 of trigger lines and they will keep going... I need my comments to make sense ^^')

What's left in order to free some of the string limit ?

Comments, named Switches and named locations, isn't it ?

My next step might be to recycle a few more comments and reset the names of all the switches (130 currently) after stocking them in a Excel file...



None.

Nov 30 2015, 12:25 pm NudeRaider Post #14

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

When working with the text based trigger editor you can add comments without taking strings. Drawback is that you got to keep a separate text file with the triggers because those are not compiled into the map.




Dec 1 2015, 1:12 am Oh_Man Post #15

Find Me On Discord (Brood War UMS Community & Staredit Network)

Quote from Stranger
Good job, this should make it easier indeed =)

I'm about to run into a similar string problem as Oh_Man... and althought I already recycled a good number of Comment strings, it won't be enough. Also, I'd hate to lose my comments or to recycle them too much (I have over 80000 of trigger lines and they will keep going... I need my comments to make sense ^^')

What's left in order to free some of the string limit ?

Comments, named Switches and named locations, isn't it ?

My next step might be to recycle a few more comments and reset the names of all the switches (130 currently) after stocking them in a Excel file...
Comments, Locations, WAVs and Switches.

Can't think of anything else that can be recycled.

You can also use the string bleeding effect if you have multiple strings of the same colour. The trick is to use <01>, which mimics the colour above it.

So instead of two strings:
Display Text Message <03>String
Display Text Message <06>String

You have only one string:
Display Text Message <03>
Display Text Message <01>String

Display Text Message <03>
Display Text Message <06>String

Also if you have strings which have multiple spaces in them you could consider swapping those for a tab instead.

Otherwise just look through your strings and make sure you're splitting up your DTMs where possible.

For instance:
Display Text Message <03>Character Name
<03>Character Dialogue

Split up into two DTMs:
Display Text Message <03>Character Name
Display Text Message <03>Character Dialogue




Dec 1 2015, 5:15 pm Oh_Man Post #16

Find Me On Discord (Brood War UMS Community & Staredit Network)

Okay so I've noticed my first error as a result of recycling. This WAV is no longer playing. It used to be called Ocean.WAV. Now it is called:
<07>1 <04>- Elemain City

Any reason why it's not working, or is this some weird glitch?




Dec 2 2015, 1:12 am Oh_Man Post #17

Find Me On Discord (Brood War UMS Community & Staredit Network)

Okay, so I noticed what I have done wrong is accidently overwrote the WAV file in WinMPQ by recycling two WAVs with the same string.

How do I revert this process?




Dec 2 2015, 2:48 am O)FaRTy1billion[MM] Post #18

👻 👾 👽 💪

The best I can think of is rename the one and hope that it doesn't rename both. It is probably still in the mpq data, but it's encrypted so I'm not sure how to just hexedit the file back...



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Dec 2 2015, 10:59 am Oh_Man Post #19

Find Me On Discord (Brood War UMS Community & Staredit Network)

Okay, I couldn't get them back.

I just re-added the sound files, and renamed them correctly this time. :P




Dec 2 2015, 10:27 pm Stranger Post #20



Thank you guys.

Oh and I just figured out something.
Oh_Man's highest string limit seems to be at 1877 strings.
And mine is only at 1049 :

String Section Info: 78.0% used (51102 bytes), 1023 / 1049 strings

Where does the difference come from ?



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: 1nFectEd, jjf28