More Themes

Joined
Jan 25, 2013
Messages
73
So, we know most planets have their own individual themes, but some use "generic themes" for example, yavin uses the standard "swamp theme" and the same with rori. Also, dantooine is another example of this. Now what would be good if someone good at coding ect, could make it possible that all these planets that don't have their own unique theme to have one. for example, I have tried to make it so dantooine has the kotor dantooine theme. However, im rubbish at coding and all I can do is replace "existing" themes. Not write codes for new ones. What is needed is brand new SND files for these planets.

Ones that need doing are as follows:

Dantooine
Yavin
Rori
Talus

If anyone would have the time for that, that would be amazing.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
No need to code anything! :)

You'll need to follow these three steps:

If you want to do Rori for example:

1.) Get the .mp3 you want and name it music_rori.mp3 (Just an example)

2.) Copy an existing theme .snd and rename it theme_rori.snd (Just an example, again), open it and copy in treExplorer (You can do it in a hex editor too, but treExplorer is the most fault proof) the 'music_rori.mp3' on top of the .mp3 name that's already in there. (Make sure you select the previous name fully and copy on top of it, so it doesn't mess up the other values (if you start typing in there, it'll kill it)

3.) Get the latest .iff for the specific planet, found in /datatables/environment/, Rori.iff in this case, and look into the specific music/ambient boxes, then simply write/copy & paste the specific .snd into it. So for the main theme, with the file you just created above, it would be the 'First Music (2d .snd)' column, then the fitting box (there are multiples, for different areas of the planet) 'sound/theme_rori.snd', I've never edited the .snd's before, so you'll need to find the right ones.

That's it really. Same process applies to all other .snd files in that datatables .iff, hell, actually any .snd for anything, and other files to.

You're always looking for the file above it, that links X to Y, like a .snd links to the .mp3. But I know, or can find most of the links fairly fast, so if you need help with any file chains, let me know. My way of doing things when I mod SWG, is if that file is shared with anything else, I'd rather create a whole new file chain so it's unique to whatever I want to edit, and doesn't change 10 different things.

It's the same reason why the NGE effects mod took me forever, because if you compare my datatables weapon.iff with the one that actually comes with the game, you can see that I created a file row for EVERY gun in the game, so that every gun, in the future, can be completely mapped, without screwing with other guns. Before it, you had like 6 guns on on a single row of effects, if you changed the T21 for example, you just changed basically all the other rifles too.

I'll still have to write that guide, I'll do it in the next few days, that'll teach you the core principles of all the file chains too.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Nah, you just need to learn a few key, but simple things.

I'll explain it in more detail tomorrow if you want, but it's late and I need some much needed sleep, haha.

Sounds more complicated than it really is. Once you get the hang of it, all the other files will slowly fall into place too.

But go look at the datatables/environment planet .iff files, in treExplorer. You'll see, it's really easy to change the .snd's, and you don't have to create a new .snd, you just have to copy the .snd that naboo uses, for example, switch out the name for the .mp3 it links to and that's it.


Edit:

Download this

Put both folders in your SWGEmu directory.

All you need to do, is have the 4 .mp3's that you want in your /sample/ folder.

Names have to be:

mus_theme_rori.mp3
mus_theme_talus.mp3
mus_theme_yavin4.mp3
mus_theme_dantooine.mp3


I'll explain how to do it yourself and further edit the planet music, uniquely for each planet later. Don't have the time right now, did this in a hurry, but it should work.

Talus didn't have any mus_theme_generic themes linked to it, so I had to wing it and replace ambient sounds, but it should be correct.

It's really easy, you can do it too, but I'll explain how, in detail, later.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Oh yeah, sorry, my bad. Music it is.

It's possible to link it to a completely new folder too, by the way, most of the files are.

I think I might adopt that in the future for mods, keeps it clean, or look into loading .tre files, but I've never done that before. Hotfixes are just awful with complete .tre files, unless you replace them each time.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Alright, guide time. I'll try to make it as simple as possible, since you have zero hex experience, so it might look longer than it actually is.


First, lose all fears of the editing part, it's dead simple.

For ease of use, right click on .snd files (do it for most of the SWG files, .iff, .cef, etc) > Properties > Open with:... Change button and select treExplorer.exe (You'll probably have to find it, and navigate where your .exe is).

Now, go and get a music_theme.snd (from the .tres), the Naboo one for example, make a copy and name it music_theme_rori.snd.

Once that is done, double click the .snd to open it with treExplorer and you'll see this:


Click on the + that's left of the FORM node, it'll expand and you'll see the SD2D003 chunk. Click on it and you'll see this:


On the left side, you have the hex values, on the right side, it's the converted hex into normal letters (ASCII character set), so you can read it.

What the .snd does, basically, is create a link between the planet's music manager and the .mp3, on top of that, I believe it also has control over how loud the sound plays by default and the bit rate (but I'll have to investigate further into it, that is what I posted in the other thread, hex values that control 'x'). A lot of files in SWG, basically are fancy ways of linking files together, to create a chain, each having a bit more control over the file that they link, than if you'd just link that file, with the .snd's in this case, they control volume and bit rate.

You're going to want to change the music/mus_theme_naboo.mp3 to music/mus_theme_rori.mp3, so that it links to your new .mp3.

But here comes the important part, you have to replace the 'mus_theme_naboo' with the new name, you can't just 'delete' it and start typing in the field, because it'll overwrite the other values in the file, that's just how it works.

So, what you want to do is, in notepad for example, write out the name you want to paste in, highlight it, ctrl+c to copy

then highlight the part in treExplorer that you want to change with your mouse:


Then ctrl+v to paste it over the name you want to change, which, if done correctly, will look like:


As you can see, the only values that changed, is the actual filename, the rest remains exactly the same, which is what you want. Now, in the top left corner, click on File > Save and overwrite, or use ctrl+s.

That's it, now that .snd file will link to your mus_theme_rori.mp3 in the music folder.

But, as of right now, the client won't see the newly created .snd, because it has a name it doesn't recognize, so, we'll need to find the file that uses the theme .snd's. We'll find this file, for the planet music, in the datatables folder in your .tre. Every planet has their own .iff. It controls things like the color of the lighting (color ramps), sky color, clouds, fog (view distance fog), attached camera effects (rain, dust storms, etc), and the ambient and music files, which is what we want to change.

So, from what I understand it, but you'll need to figure it out, in the Weather index, all the 1 numbers are the main theme, so if you look in the Rori.iff, you'll see in the mainswamp (area/region) and then the 1 and if you go further right, you'll see the column for First Music (2d .snd), these are the themes. It should say "sound/music_theme_generic_c.snd" for the weather index 1 in the mainswamp row (I just saw I forgot to edit the first one, so you'll have to do it! :p), just double click on it, so it's highlighted and write or paste (If you want to paste, you'll have to right click and select paste, key combinations don't work, sadly) in the new link/name to your new music_theme_rori.snd, so it'll go from:


to


Then repeat the process for every weather index 1, for every region. You can also modify the other sounds/themes/ambients in the same way.

Save again, and that's it!

Have the rori.iff in /datatables/environment/
Have the music_theme_rori.snd in /sound/
Have the mus_theme_rori.mp3 in /music/

And that's it!

Same principle applies to most files in the .tre's, so knowing this, will help you A LOT in anything you want to do.

Then the next step would be more advanced, with actually hex editing values. I'll have a part on it and how to figure out some values (simple ones) in some files, in my weapon effects guide. I'll hopefully have time to write that guide tonight, it'll help a lot with understanding medium level modding, it's really not too hard, it just looks complicated at first.


Pro tip: Extract your .tre's one by one into a 'combined' folder, starting with the lowest and going up to patch 14, and use that as an open .tre where you can copy the exact files from, that are used by the client at the moment. If you have the .toc with the NGE .tre's, it'll only show the most recent files, which you don't want, but it's good to look around where, what is.
 
Joined
Jan 25, 2013
Messages
73
ah right interesting, by the way, I been testing it out, and talus doesn't seem to be working, the other planets do however
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Is it playing "mus_swamp_amb_b.mp3"?

Or "mus_theme_generic_c.mp3"?

Or "mus_gloom_b.mp3"?

But look at my guide and do eyt! :)

Don't be scared!
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
It's Weather Index #0 on the talus.iff then, swap index #0 with #1 then.

Should fix it.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Everytime you see a 0, change that rows 'First Music' to the music_theme_talus.

I guess 0 is the loading into talus slot, I expected it to be for the other planets too, cause 0 is the first number, but apparently not.

With talus I didn't know, because both 0 and 1 had the swamp file linked.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Awesome, so 0 was it?

I find it odd, that talus seem to be different than all other planets. But it's SOE, nothing surprises me.
 
Top Bottom