Mod Editing Help for Steam

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

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

Post Reply
BravoN7
Posts: 3
Joined: Thu, 10. Aug 23, 16:54
x4

Mod Editing Help for Steam

Post by BravoN7 » Sun, 20. Aug 23, 18:57

I need a little guidance if anyone can genuinely help me out.
I've got a Steam Workshop mod I really like conceptually but it has some serious need of tweaking. I have used the Tool 1.10 and 1.11 to unpack the .dat file, made the changes I wanted, and tried both repacking and leaving it unpacked. No luck getting it to work. After reading through some more posts here, I'm more confused than not about the MD5 validation when the file is repacked and other post suggest it isn't even necessary to repack it anyway.
Here's the details on what I've done so far.
1) Subscribed to the mod I want to adjust. Loaded it and made sure it works ingame.
2) Copied that folder and contents (.dat files and content.hml) from "extensions" into a different folder and unpacked it it using the unpacking tool.
3) made the changes I want
4) updated the "content.hml" and changed the ws_###... line.
5) delete original mod folder from extensions folder.
6) unsubscribed from the mod on Steam workshop.
7) copy the edited mod with a new folder name into the extensions folder.
8) run X4
9) check extensions menu and see "my" version of the mod with my file name showing! Yay.
10) enter game
11) mod, including the changes I made don't appear in game. This mod specifically adds new weapons so it's easy to check.
12) I've tried starting a new game too... no effect

I'm fairly decent at modding generally and I can follow directions if someone can give me some insights. I just don't understand why making an edit and changing a folder name would completely break a mod. In this case I'm just toning down the original mods weapon damage, so I'm not altering the original mods working script.
Any help would be greatly appreciated!

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13299
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Mod Editing Help for Steam

Post by euclid » Mon, 21. Aug 23, 15:19

Welcome BravoN7 :-)

Based on your description there are multiple reasons why your alternations are not working. However, since you just want to change the weapon damage I'd try this:
  • Donwload and instaill the mod from the WS and check with a clean saved game (i.e. a saved game that never had neither the WS mod nor your altered version installed) that it is working.
  • Unpack the dat files of the mod to a different folder (that is your mod backup) , delete the dat file from the mod folder and copy the unpacked files (preserving the structure) to the mod folder.
  • Again, check if the mod is still working. It should be fine as the mod will read the unpacked files and you have not yet altered anything else.
  • Now make your alterations and then check again.
If this is not working then you know that your alterations are the cause. For general troubleshooting you may want to consider to activate the debug log. For details please check the sticky thread "Getting Started.." here in this forum.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Re: Mod Editing Help for Steam

Post by SirNukes » Mon, 21. Aug 23, 22:24

BravoN7 wrote:
Sun, 20. Aug 23, 18:57
I just don't understand why making an edit and changing a folder name would completely break a mod.
Changing the folder name would break any internal paths to new files. Note that euclid's approach leaves the original folder name unchanged. You also might need to delete the .cat files along with the .dats. The original ws_### name may need to be restored if there are other mods that depend upon your edited mod for load order.

You can also consider just putting your changes into a new mod that patches the original. I am guessing your changes just need some lightweight diff patches (small learning curve). This will allow you to stay subscribed to the original mod and get updates without losing your changes, or even publish your changes to the workshop if you think they would have value to others.

BravoN7
Posts: 3
Joined: Thu, 10. Aug 23, 16:54
x4

Re: Mod Editing Help for Steam

Post by BravoN7 » Mon, 21. Aug 23, 22:31

Thanks Euclid!
I followed your example and it works fine now!
I figured it was a simple mistake on my part.

In case anyone else stumbles across this post with the same issue, the short version is make sure to go into "extensions" -in game- after making the alterations and enable the mod and disable updates. It will ask you to restart X4 for the changes to take effect. I also changed the "ws_(random numbers)" in the "content.hml" as well although I'm not 100% certain that is necessary if the Workshop updates are turned off. Either way, thank you again for the assist!

BravoN7
Posts: 3
Joined: Thu, 10. Aug 23, 16:54
x4

Re: Mod Editing Help for Steam

Post by BravoN7 » Mon, 21. Aug 23, 22:35

SirNukes wrote:
Mon, 21. Aug 23, 22:24
BravoN7 wrote:
Sun, 20. Aug 23, 18:57
I just don't understand why making an edit and changing a folder name would completely break a mod.
Changing the folder name would break any internal paths to new files. Note that euclid's approach leaves the original folder name unchanged. You also might need to delete the .cat files along with the .dats. The original ws_### name may need to be restored if there are other mods that depend upon your edited mod for load order.

You can also consider just putting your changes into a new mod that patches the original. I am guessing your changes just need some lightweight diff patches (small learning curve). This will allow you to stay subscribed to the original mod and get updates without losing your changes, or even publish your changes to the workshop if you think they would have value to others.
Edit: I did keep the original file name. When I have some time I'll see if I can figure out how to change the file pathing myself. I had not concidered that the file root folder name was part of the script.

Thank you for the reply SirNukes! I'll look into this "lesser learning curve" method and see what I can drum up. I really appreciate you guys responding. I'm a quite, dyi, kinda modder. I usually don't have time to develope mods from scratch, so finding something close to what I want and making small tweaks is my go-to time saver. X4, much like X3 back in the day has so much mod potential. It's very interesting to make those changes.

Again, TY

Post Reply

Return to “X4: Foundations - Scripts and Modding”