[Mod Help Request] Trying to add music to True Sight

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
JasonX2000
Posts: 153
Joined: Thu, 2. Oct 14, 15:04
x4

[Mod Help Request] Trying to add music to True Sight

Post by JasonX2000 » Thu, 8. Apr 21, 11:27

Hello,

i am trying to add sector specific music to True Sight, but its not playing.
I need some help, cause i dont know where to look anymore.

I made the ogg file 44100khz and 1411kbits like the other ogg files, just in case it was a file issue

Since there was no music definition in mapdefaults for True Sight, i added it with a new music reference
and i defined that reference in sound_library but. It still does not work,
and i cannot find any other references to the sector musics with astrogrep, so i think the problem must lay
in this constelation.

Here are the files i created:

mapdefaults.xml:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<add sel="/defaults/dataset[@macro='Cluster_12_macro']/properties">
		<sounds>
			<music ref="music_soundtrack_jx" />
		</sounds>
	</add>
</diff>
sound_library.xml:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<diff>
<add sel="/soundlibrary">
  <sound id="music_soundtrack_jx" description="Truesight Music" repeat="1" is3d="0" preload="0">
    <sample start="extensions\JX_Truesight_Music\music\cluster\08101" />
    
    <volume start="0.3"/>
    <effects>
      <fade in="1.66667" out="0.666667"/>
    </effects>
  </sound>
</add>
</diff>
Thanks a lot in advance
Last edited by JasonX2000 on Thu, 8. Apr 21, 18:28, edited 3 times in total.

User avatar
Dj_FRedy
Posts: 230
Joined: Mon, 27. Jun 11, 05:58
x4

Re: [Mod Help Request] Trying to add music to True Sight

Post by Dj_FRedy » Thu, 8. Apr 21, 14:15

So at first look I see that you have not closed (>) correctly. You could start there and test again.

<add sel="/soundlibrary">

If you use Notepad++ I recommend this plugin for all these minor errors: https://github.com/morbac/xmltools
"All my contributions to the Technical Support and Public Beta Feedback sections will be concise and to the point, no diatribes, that's what the other sections are for".
Thank you for your efforts.

JasonX2000
Posts: 153
Joined: Thu, 2. Oct 14, 15:04
x4

Re: [Mod Help Request] Trying to add music to True Sight

Post by JasonX2000 » Thu, 8. Apr 21, 17:49

Thanks alot.
Sometimes two pair of eyes are better than one. :)

I looke for missing tags, wrong name, path, anything.

And yes i use N++ and looked for the plugin.
But it does not apear in the plugin manager to install it.
And i could not find how to at it other way.

/edit:
Had just to Update N++. Now i have the tools.
Last edited by JasonX2000 on Thu, 8. Apr 21, 18:24, edited 1 time in total.

JasonX2000
Posts: 153
Joined: Thu, 2. Oct 14, 15:04
x4

Re: [Mod Help Request] Trying to add music to True Sight

Post by JasonX2000 » Thu, 8. Apr 21, 18:18

Well, i fixed the tag error, but still no music playing in True Sight.

I Updated XML-Code in the first post.

User avatar
Dj_FRedy
Posts: 230
Joined: Mon, 27. Jun 11, 05:58
x4

Re: [Mod Help Request] Trying to add music to True Sight

Post by Dj_FRedy » Thu, 8. Apr 21, 21:27

There don't seem to be any other problems with your code, in fact I have tested it myself and it plays an ogg audio track in a sector of my choice.

Check DebugLog in-game, associate a key in controls to see it or browse your steam user in 'Documents/Egosoft/x4' and check 'uidata.xml'.
Something more elaborate: Enable debugging with logs in the launch properties if you haven't already done so:

Code: Select all

-skipintro -debug all -scriptlogfiles -logfile log.txt
A log.txt will be created in your steam user, mentioned above. Verify for any errors associated with your mod...
"All my contributions to the Technical Support and Public Beta Feedback sections will be concise and to the point, no diatribes, that's what the other sections are for".
Thank you for your efforts.

JasonX2000
Posts: 153
Joined: Thu, 2. Oct 14, 15:04
x4

Re: [Mod Help Request] Trying to add music to True Sight

Post by JasonX2000 » Fri, 9. Apr 21, 12:32

Ah thank you for testing.
So no need to investigate further.
I will try to debug like you suggested.
Will see what‘s causing my music not to play.

JasonX2000
Posts: 153
Joined: Thu, 2. Oct 14, 15:04
x4

Re: [Mod Help Request] Trying to add music to True Sight

Post by JasonX2000 » Fri, 9. Apr 21, 17:33

Ok, i think i found the problem.
while the other mod files creating errors in log complaining about missing signature, that one music mod does not make
a single log entry.
So it seems it does not get loaded.
But i don't know why.
Its listed as on in the extensions menu.

I disabled every other mod.
Its not working hmmmm, no log entry. As if it does not exitst :/


/edit:
Ok i got it working now.

User avatar
Dj_FRedy
Posts: 230
Joined: Mon, 27. Jun 11, 05:58
x4

Re: [Mod Help Request] Trying to add music to True Sight

Post by Dj_FRedy » Fri, 9. Apr 21, 19:46

I can only recommend that you recapitulate and start the mod from scratch.
Give a 'lower case' name to all your mods, don't get into bad habits, upper case mods are problematic on linux, I think they don't load because the linux build of the game only supports lower case extensions? not 100% sure but better use lower case.

I've uploaded a build to my drobox for you to try it on your machine, maybe it will make a difference... :gruebel:
https://www.dropbox.com/s/00x5ipvzh3jt1 ... od.7z?dl=0

Start new game on 'The Young Gun", just to check if the music changes for you in the 'Black Hole Sun IV' sector. You should listen to 'Turquoise Sea', I love that track hehe.

EDIT: I just saw your edition... nice :mrgreen:
I'd like to know, even if it's dumb, what was causing the problem... just out of curiosity, maybe the answer can be useful to someone in the future.
"All my contributions to the Technical Support and Public Beta Feedback sections will be concise and to the point, no diatribes, that's what the other sections are for".
Thank you for your efforts.

JasonX2000
Posts: 153
Joined: Thu, 2. Oct 14, 15:04
x4

Re: [Mod Help Request] Trying to add music to True Sight

Post by JasonX2000 » Fri, 9. Apr 21, 22:36

Well,

i changed two things.

First, made the path in the same Letter-Case as the original path from Egosoft.
Second, i oversaw the whole time, that i must have accidently moved my library files
under /music so they where not recognized by the game.
Took some time, to see the difference because my head started to go nuts why it did not want
to load, even it was listet in the game as on and my other mods worked :D

If you are too eager to look for a specific error, you start oversee the dumbest errors someone can make :roll:

Thanks again.

Post Reply

Return to “X4: Foundations - Scripts and Modding”