Page 3 of 5 FirstFirst 12345 LastLast
Results 41 to 60 of 100

Thread: Faction-Specific Music

  1. #41
    roy1593's Avatar Foederatus
    Join Date
    Jun 2009
    Location
    Netherlands
    Posts
    25

    Default Re: Faction-Specific Music

    Thanks i tried it at the vanilla game and it worked. It did not work at the mod. Will reinstall it help?

  2. #42
    irishron's Avatar Cura Palatii
    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: Faction-Specific Music

    Did you delete the vanilla's or the mod's music .dat and music .idx?

    Have you found the logs folder?

  3. #43
    roy1593's Avatar Foederatus
    Join Date
    Jun 2009
    Location
    Netherlands
    Posts
    25

    Default Re: Faction-Specific Music

    yes i did but the mod i want to change is not in the logs folder. I think it is better that I just Reinstall the mod
    Last edited by roy1593; February 02, 2011 at 06:28 AM.

  4. #44
    irishron's Avatar Cura Palatii
    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: Faction-Specific Music

    Does the mod have its own logs folder?

  5. #45
    roy1593's Avatar Foederatus
    Join Date
    Jun 2009
    Location
    Netherlands
    Posts
    25

    Default Re: Faction-Specific Music

    No. I am now reinstalling the mod. Maybe it helps

  6. #46
    roy1593's Avatar Foederatus
    Join Date
    Jun 2009
    Location
    Netherlands
    Posts
    25

    Default Re: Faction-Specific Music

    I reinstalld the mod and it works all fine now. Thanks for the help.

  7. #47
    irishron's Avatar Cura Palatii
    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: Faction-Specific Music

    Sometimes that's what it takes. You're welcome.

  8. #48

    Default Re: Faction-Specific Music

    Thank you very much! Till yet, I thought that it is only possible to make it culture specific. I try it and it works. =)

  9. #49

    Default Re: Faction-Specific Music

    Quote Originally Posted by Scout of Imladris View Post
    Thank you very much! Till yet, I thought that it is only possible to make it culture specific. I try it and it works. =)
    My pleasure.

  10. #50
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: Faction-Specific Music

    (+rep)

    EDIT: why in some modifications the "events" and the "Music" files are NOT recreated after the start of the game???
    Last edited by SpyrosM91; July 03, 2011 at 01:01 PM.
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  11. #51

    Default Re: Faction-Specific Music

    First off: This tutorial is great!
    But I have a problem. I've created some custom music types, and I gave them a list of winter tracks. But even in winter they will only play summer tracks. The entries are exactly like in vanilla, except for the tracks given. Can someone help me?

  12. #52

    Default Re: Faction-Specific Music

    The winter code "MUSIC_STRATMAP_WINTER" is broken, it doesn't works unfortunately.

  13. #53

    Default Re: Faction-Specific Music

    A pitty

    But thanks for the information.

  14. #54

    Default Re: Faction-Specific Music

    That's because the M2TW parser either doesn't pick it up or overwrites the contents with that of the MUSIC_STRATMAP_SUMMER block. However, it still generates the binary structure needed to make things work, so presumably the engine will still play ball if only we fix the paths to the MP3's in the binary structure manually. (More advanced work such as actually changing the number of tracks require more understanding of the file format.)

    So adventurous modders could do the following to fix their packs right now:
    • Extract the event packs into an empty directory using XIDX. Use the -xeb flags to extract, events and append bin suffixes to the (generated) file names.
    • Open the 4th last file (the file with the highest number before the .bin suffix). E.g. if your pack extracts to 1024 files you want the file which ends with _1020.bin. If it extracts to 997 files, you want _993.bin and so on.
    • Find the sequence 05 00 00 00, followed by 01 00 00 00 00 01 00 00 00. This marks the end of the MUSIC_STRATMAP_WINTER block in the binary structure. The music files for this trigger/event are encoded between that and the previous sequence of 01 00 00 00 00 01 00 00 00. With careful editing you can fix the filenames manually.
    • Save the file.
    • Regenerate the event packs with XIDX (use the -ceb flags). Be careful to ensure that your filenames are fed in the proper order to the XIDX program, the numbers in their names indicate their order. You may want to create a text file first which lists them in the right order (one name per line), then do something like:
      Code:
      type name_of_text_file | path/to/xidx.exe -ceb events
    • Move the new event packs in the mod & test. When you hit winter your custom winter tracks should now play.


    FWIW here's what I (think to) know about this particular binary structure, excerpted from my notes about the structures in the event packs:
    Spoiler Alert, click show to read: 
    Code:
    Type2_has_more_marker:
      1 byte bool (0x1 if structure has more, 0x0 if not...?)
      4x NULL (single 4byte int, 0x00)
    
    Type2_payload:
      Type2_has_more_marker
      
      Payload (event):
        4 byte u int (0x1)
        4 byte u int (number of records for the event)
        
        Records:
          NULL terminated char array (path to audio file)
          
          +0  1byte bool: 0x1 if 3d, 0x00 if 1d.
          +1  1byte u: floor(probability * 0xff)
          
          +2  2byte signed short (volume adjustment for record)
          +4  2byte short (floor(.5 + minpitch * 0x7ff) )
          +6  2byte short (floor(.5 + maxpitch * 0x7ff) )
          +8  2byte u short/4byte u int? (priority value of record)
          ...
          +12 2byte short (floor(fadein * (0.5+ 0xda)) )
          +14 2byte short (floor(fadeout* (0.5+ 0xda)) )
          
          +16 1byte bool (looped)
          
          +17 32bit float (rndvolume)
          
          +21 2byte u short (floor(randomdelay* (0.5+ 0xda)) )
          +23 2byte u short (floor(delay * (0.5+ 0xda)) )
          +25 2byte u short/4byte u int? (pref key: INTERFACE = 0x3, SPEECH = 0x2, MUSIC = 0x0, SFX = 0x1)
          ...
          
          +29 1byte bool (ingore_pause):
    	false (0x0) if ignore_pause = 0, true (0x1) otherwise.
          
          +30 32bit float.
    	if 3d:
    	  mindist, default is 1.0 (0x3f800000). 
    	  according to descr_sounds.txt mindist must be > 1.0
    	if 1d:
    	  0 (0x0), default.
    	bitmask:
    	  If {streamed, ducking} is set and mindist is not specified or 
    	  if {streamed, ducking} follows the mindist declaration, apply: value | {0x1, 0x2}
          +34 32bit float (maxdist or pan)
    	if 3d: 
    	  maxdist, default is 1.0 (0x3f800000) ? 
    	  If pan is set and maxdist is not specified, the value will be pan or
    	  if pan follows the maxdist declaration, the value will be pan instead.
    	  
    	  pan must not be specified if maxdist is.
    	  presumably, must be >= mindist, therefore must be > 1.0
    	if 1d: 
    	  pan. according to descr_sounds.txt must be between 0.0 and 1.0 (inclusive).
    	  maxdist must not be specified.
          +38 32bit float (dry_level or distancepriority)
    	last one of dry_level, distancepriority is used. the two conflict.
          +42 32bit float (wet_level or probradius)
    	last one of wet_level, probradius is used. the two conflict.
          +46 32bit float (effect_level)

    Spoiler Alert, click show to read: 
    Code:
    music_struct:
      +29 (number_of_music_types) 4byte u int
      1byte bool array, of length number_of_music_types (music types which apply):
        1byte bool index = id_of(music_type), 0x1 if type applies, 0x0 if not.
      4byte u int (state):
        MUSIC_BATTLE_TENSION 		0
        MUSIC_BATTLE_MOBILIZE 		1
        MUSIC_BATTLE_BATTLE			2
        MUSIC_STRATMAP_SUMMER		4
        MUSIC_STRATMAP_WINT	ER		5
        MUSIC_FRONTEND			6
        MUSIC_RESULT_WIN_CLOSE		7	
        MUSIC_RESULT_WIN_AVERAGE		8
        MUSIC_RESULT_WIN_CRUSHING		9
        MUSIC_RESULT_LOSE_CLOSE		10
        MUSIC_RESULT_LOSE_AVERAGE		11
        MUSIC_RESULT_LOSE_CRUSHING		12
        MUSIC_RESULT_DRAW			13
        MUSIC_PREBATTLE_SCROLL		15
        MUSIC_RESULT_STRAT_WIN_CLOSE 	16
        MUSIC_RESULT_STRAT_WIN_AVERAGE	17
        MUSIC_RESULT_STRAT_WIN_CRUSHING	18
        MUSIC_RESULT_STRAT_LOSE_CLOSE	19
        MUSIC_RESULT_STRAT_LOSE_AVERAGE	20
        MUSIC_RESULT_STRAT_LOSE_CRUSHING	21
        MUSIC_RESULT_STRAT_DRAW		22
        MUSIC_CAMPAIGN_VICTORY		23
        MUSIC_CAMPAIGN_DEFEAT		24
        MUSIC_CREDITS1			25
        MUSIC_CREDITS2			26
        MUSIC_CAMPAIGN_LOADING		27
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  15. #55

    Default Re: Faction-Specific Music

    Is it possible to have music for a faction regardless of region? Like, I wanted to give the Byzantines some unique regardless of location, is that at all possible?

  16. #56

    Default Re: Faction-Specific Music

    Yes. You create a dedicated music type, you bind your custom music to that music type and you bind the faction to that music type in your campaign map.

    You'll need to edit data/descr_sounds_music.txt to do the first part, and data/world/maps/base/descr_sounds_music_types.txt for the second.
    -Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool

    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  17. #57

    Default Re: Faction-Specific Music

    I am having a lot of problems with this because my mod is made from scratch so I really dont know what I am doing wrong or right.
    I have some previous experience with descr_sounds_music

    but everything goes to when I do the steps.
    here is what I do and what happens basically.

    so I use the extractor to extract music, SFX and voice. I check to see if all the files are extracted and sure enough my extracted files are the same size as my .dat files.
    i do my little editing like adding new music in the folder, and thats that.

    I do my editing in descr_sounds_music which I am 100% sure I am doing right and save the text file.

    I boot the game and it crashes on start up. this is the game's first attempt to rebuild my sound files which fails. what happens is very interesting, my new menu music is there (hurray!) so I know I did that part right but my faction (campaign) music are vanilla and all my SFX stuff is gone!

    I always hated dealing with sounds because I have to deal with this kind of hell. can anyone help me?

  18. #58
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Faction-Specific Music

    Do you have all 39 sound text files in your \mod\data folder?
    Also, the default path for extracted .dat files is \mod\data\sounds\data\sounds\voice (or sfx or music &c.) and not \mod\data\sounds\voice(sfx, music, &c.) as it should be, hence you have to cut your sounds and place them in the right folder first before restarting the game to rebuild the .dat and .idx files.


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  19. #59

    Default Re: Faction-Specific Music

    ok so what you are saying is that when I extract my files they would be in
    mod/data/sounds/data/sounds/music and SFX and Voice

    well what you said is true, when I extracted my sounds files that is certainly where they went.
    I followed your advice and removed my events, music and SFX idx and dat files.
    I booted the game and crashed again, this time it is even worse all 6 files that I removed are now 1kb.

    I previously moved my music, SFX and voice from data/sounds/data/sounds/*all 3 files* to data/sounds/*all 3 files*
    this technique at least gave me the menu music...

    regarding your comment about the text files, my mod is based on Teutonic campaign and so I downloaded and placed M2TW sound files first and then I placed Teutonic over those and replaced any conflicts if there were any.
    here is where I got the sound files
    http://www.twcenter.net/forums/showthread.php?t=74106

  20. #60
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Faction-Specific Music

    Quote Originally Posted by Toho View Post
    ok so what you are saying is that when I extract my files they would be in
    mod/data/sounds/data/sounds/music and SFX and Voice

    well what you said is true, when I extracted my sounds files that is certainly where they went.
    I followed your advice and removed my events, music and SFX idx and dat files.
    I booted the game and crashed again, this time it is even worse all 6 files that I removed are now 1kb.

    I previously moved my music, SFX and voice from data/sounds/data/sounds/*all 3 files* to data/sounds/*all 3 files*
    this technique at least gave me the menu music...

    regarding your comment about the text files, my mod is based on Teutonic campaign and so I downloaded and placed M2TW sound files first and then I placed Teutonic over those and replaced any conflicts if there were any.
    here is where I got the sound files
    http://www.twcenter.net/forums/showthread.php?t=74106
    Sounds fine concerning the sound text files.

    Concerning the folder structure, that should indeed be:
    mod\data\sounds\Voice
    mod\data\sounds\Sounds
    mod\data\sounds\SFX
    mod\data\sounds\Music

    including their vanialla subfolder structure.

    If you have all sound text files in your data folder and placed your extracted sounds in the corresponding folders the game rebuilds the .dat and .idx files if deleted. You can test this by using a bare mod folder put the unmodded sound text files into the data folder, extract the vanilla sounds into the bare mod\data\sounds &c. folders and start the bare mod, you will have the game create the vanilla .idx and .dat files in your bare mod\data\sounds folder.

    According to my experience 1kb .dat and .idx files can result from wrong sound formats or any custom folder structure for sounds that differs from the vanilla structure while CTD's normally indicate typos in the text files, including space deletion of the last space ending the text files.


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

Page 3 of 5 FirstFirst 12345 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •