Author Topic: three basic modding questions  (Read 4001 times)

0 Members and 1 Guest are viewing this topic.

Javolenus

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Re: three basic modding questions
« Reply #15 on: November 10, 2008, 11:14:52 PM »
3. Music: I'd liie to add my own music. I tried already, using a very clear tutorial by Archonsod, but without success. I'm guessing that I must have done something wrong. I'm wondering if the problem has something to do with editing music.txt? This file contains lots of numerical values and I do not know what they mean. I simply want to indicate which mp3 files to play on the strat map, and which to play during battles.


I've skimmed through this topic and couldn't see anyone answering this.. It's quite easy so i'm sorry if i'm stating the obvious, but here i go:

1. Download module system!

2. Follow the instructions on how to get it to work, and right-click the "module_music.py".

3. Select "edit with IDLE" (or anything you'd prefer over that {NOT notepad..})

4. The spoiler beneath contains how the bottom of the file looks unedited:
(click to show/hide)

Copy the second last line, and paste it right beneath, so it looks like the spoiler below..
(click to show/hide)

5. Change the two names in the second line (red) to the name of your track.. Example below using "ramund_hin_unge". (remember to edit the type of file if needed {original= ".ogg" and mine's ".wma"})

(click to show/hide)

6. Add "mtf_module_track" to the description. (this is to tell the file to read from the module folder)..

(click to show/hide)

7.  Edit/add/replace the description so that the track is played when you want it to play.. Here i have an example to make it play at the very start of Mount&Blade..

(click to show/hide)
note that if you want it to play at the start of MnB, you need to put an "#" before the original title song..
(which looks like:)
(click to show/hide)

(change it to:)
(click to show/hide)

8. You can mess around with the MS to play the track when you want it to play by editing the description, or the "mtf's". Just look at how the other tracks are arranged..

9. Add the file of the song to Mount&Blade/Modules/(you mod)/Music

10. Open Mount&Blade and you'll hear the changes..



Thymo


PS: Sry about the tediousness of the post, wanned to make it detailed to impress!  :mrgreen:

Hi Thymo,

That's absolutely fantastic - I'm really grateful. Gonna get to work now and get some good sounds into M&B. Thanks again for a brilliant reply and all the best. Very Helpful!

Jav.

Thymo

  • Sergeant at Arms
  • *
  • Snow and science!
    • View Profile
  • Faction: Nord
  • M&B
Re: three basic modding questions
« Reply #16 on: November 11, 2008, 01:11:31 AM »
Hi Thymo,

That's absolutely fantastic - I'm really grateful. Gonna get to work now and get some good sounds into M&B. Thanks again for a brilliant reply and all the best. Very Helpful!

Jav.

Yay! My first time doing something that might be useful to someone..  8-)
e^(i*π)+1=0

Fujiwara

  • Sergeant at Arms
  • *
    • View Profile
  • Faction: Neutral
Re: three basic modding questions
« Reply #17 on: November 11, 2008, 08:54:26 PM »
I would not DL Notepad++, rather than try and use IDLE. It loads faster and the text editing features are VASTLY superior.
Fujiwara, I wonder what one of those bolded two you meant and missed :)

My brain is faster than my fingers.  :D

Should read: I would DL NP++, rather than use IDLE.
M&B: Onin no Ran - THE Japan Mod

Pythonic Module Editor

Johnny is a hacker's son
But Johnny is not 133t
What Johnny thought was ADD_AND_SHIFT
Instead was REG_DELETE

Galtran

  • Knight
  • *
    • View Profile
  • Faction: Sarranid
  • MP nick: Galtran
  • WB
Re: three basic modding questions
« Reply #18 on: November 11, 2008, 09:26:40 PM »
I would not DL Notepad++, rather than try and use IDLE. It loads faster and the text editing features are VASTLY superior.
Fujiwara, I wonder what one of those bolded two you meant and missed :)

My brain is faster than my fingers.  :D

Should read: I would DL NP++, rather than use IDLE.

agreed on the NP++

llamalad

  • Recruit
  • *
    • View Profile
  • WBWF&SNW
Re: three basic modding questions
« Reply #19 on: December 19, 2008, 03:55:53 PM »
Just by the way, I tried doing the thing to add music to the game as the title music, just as was said up there, but mine didn't work. Is this because the game doesn't accept mp3 files (as that's what I'm using) or should I just go back over it and recheck the code?

BerserK

  • Regular
  • *
    • View Profile
Re: three basic modding questions
« Reply #20 on: December 19, 2008, 04:39:49 PM »
Hmm, I see you all use NP++. I am currently using NP2 and it works very good. Is there something NP++ does better when working with module system?

BobTD

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Re: three basic modding questions
« Reply #21 on: March 17, 2009, 03:19:44 AM »
Just by the way, I tried doing the thing to add music to the game as the title music, just as was said up there, but mine didn't work. Is this because the game doesn't accept mp3 files (as that's what I'm using) or should I just go back over it and recheck the code?

You might not have remembered to disable the sounds for the same events. Im going to try this using MP3s as well and see what happens. If I get no sound then you would probably conclude it was due to the MP3s. Though Im not sure because I see MP3 format used in reference:

(click to show/hide)

I added a few MP3s and it works fine when I run Build_module, Im play testing now to see if my mounds work.

Edit: Yeah I cant get an MP3 to play. Im trying to set it to the title menu and I cant see anything wrong:

(click to show/hide)

This should not be doe to the use of an MP3.

Edit:

Yay I figured it out. I had a small typo that kept it from working, and after I fixed the typo I did not run Build_module but corrected the typo and posted what I had on here. So what I ran must not have match what I posted. Boy was I confused. But at least I'm getting the hang of what order to do things.
« Last Edit: March 17, 2009, 04:31:23 AM by BobTD »

mr.master

  • Grandmaster Knight
  • *
  • A Proud Christian, A Member of Knights Of WEe, 6-1
    • View Profile
  • Faction: Neutral
  • MP nick: WEe
Re: three basic modding questions
« Reply #22 on: March 18, 2009, 03:30:06 PM »
My problem is that the first time I tried this, it worked (last month) when i was doing some tests on this but now when im trying, it's not working. this is the code
(click to show/hide)

And i have the # mark before the original title song.



BobTD

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Re: three basic modding questions
« Reply #23 on: March 18, 2009, 05:38:02 PM »
You might have the run Build_module every time you restart your computer. I'm completely new to this but I run the build_module directed at a native file in an alternate installation of MnB ,just to make sure no mods interfere with what I'm doing. 

Fatescalling

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Re: three basic modding questions
« Reply #24 on: March 18, 2009, 07:15:55 PM »
I'm not sure what you guys are talking about with the "#" sign, but I got my title music working fine just like this by replacing the original title music line in module_music with this and changing of course the "?" marks with your file name and file type. BTW I use a mp3 for my title music just in case you were wondering. 

(click to show/hide)

Also a bit off-topic, but this gave me some problems since I use 17 factions and it took me a bit to figure out how to add new mtf_cultures. This is the solution just in case someone was wondering...

search for this line in module scripts
(click to show/hide)

Here is where you'll add this line for how many cultures you have almost like this line while replacing "?" with a number for each faction
 
(click to show/hide)
next in HEADER_MUSIC, I know it says don't edit it, but you have no choice. First you'll need to insert each faction like the other lines and replace the first "?" with that mtf_culture number. Second, you'll need to add a hex number where the "?" marks are, and I'm not entirely sure on there use, but I would pick numbers not defined already in there.
(click to show/hide)

and that's it define cultures in the module_music file just like any other one.

mr.master

  • Grandmaster Knight
  • *
  • A Proud Christian, A Member of Knights Of WEe, 6-1
    • View Profile
  • Faction: Neutral
  • MP nick: WEe
Re: three basic modding questions
« Reply #25 on: March 18, 2009, 08:14:29 PM »
Well could someone possibly tell why wont my songs play example in battles?'
Code:
(click to show/hide)
In battles it clearly cant play the songs and skips them untill it finds a song that can be played. So what am i doing wrong?



Scouten

  • Regular
  • *
  • King of The Trolls
    • View Profile
  • Faction: Rhodok
  • WB
Re: three basic modding questions
« Reply #26 on: March 19, 2009, 08:41:00 PM »
Well could someone possibly tell why wont my songs play example in battles?'
Code:
(click to show/hide)
In battles it clearly cant play the songs and skips them untill it finds a song that can be played. So what am i doing wrong?
ok well im not sure about the mod System but i did edit mine but that shouldn't be important to get the music to play when ever see i did a track for a a battle in the music.txt i changed fight_1 to Fight_5 exp "fight_5.ogg 5120 5120"
and i got rid of all unnecessary tracks (ones i didn't copy over) that left me with 45 in the music.txt folder and all my music plays with no stock music also you have to make the first name and last name the song name exp:
Code: [Select]
#  ("Menu_Music", "Menu_Music",  mtf_module_track|mtf_sit_main_title|mtf_start_immediately, 0),that plays the menu music while

these play over the Fight_# music
Code: [Select]
  ("Fight_5", "Fight_5.ogg", mtf_module_track|mtf_sit_fight|mtf_sit_ambushed, 0),
  ("Fight_6", "Fight_6.ogg", mtf_module_track|mtf_sit_fight|mtf_sit_ambushed, 0),
  ("Fight_4", "Fight_4.ogg", mtf_module_track|mtf_sit_fight|mtf_sit_ambushed, 0),

make sure you put your music in the main directory and mod directory while an eidited music .txt hope this helps :mrgreen:

                                                                                                                                     -Tech Savvy Stan