When will changes in structure-macro.xml take effect ?

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

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

Post Reply
Starman01
Posts: 189
Joined: Wed, 20. Jun 07, 13:56
x4

When will changes in structure-macro.xml take effect ?

Post by Starman01 » Fri, 12. Apr 24, 17:28

Hi all,

quick question.. .Currently I'm deperatly trying to increase the health pool of defense structures, but my changes don't take effect it seems.

So, when I make changes to a macro.xml file (asset/structures/macro), when does it take effect ?

- immediately, for already build structures too ? (Appaerently not)
- for replaced structures (destroyed on a base, then rebuild) (appearantly not)
- for new build structures after change, only after completly adding them new in the build menu ?
- requires new game start ?

On a side related note, will these changes directly take effect inside the encyclopedia ? Doesn't seem so, but I could swear I made some weapon changes that are now displayed with modded values inside the encyclopedia...So, if the structure value does not change there, it might be a sign of it not working.

My changes happens via a line like this :

<replace sel="//macros/macro[@name='defence_arg_disc_01_macro']/properties/hull">
<hull max="400200" />
</replace>
</diff> -->

Any help would be appreciated..

Realspace
Posts: 1380
Joined: Wed, 15. Nov 06, 10:21
x4

Re: When will changes in structure-macro.xml take effect ?

Post by Realspace » Sat, 13. Apr 24, 17:02

There is a closing tag of comment, if it is also in your current document the file will be discarded. Always use notepad++ to make these edits, it finds error when saving.

Second, activate the debug log to see if the file has been accepted. It is fast, you look for any entry related to your patch and an error is shown if existing (missing .sig files are not an error).

More often than other, this is the case, error in the file. Then, if I remember correctly, vanilla ships that I mod in REM by changing the hull they show the change immediately. Maybe stations are different. Or only newly built ones, will check when at the pc. But first be sure you have no errors in the log.

Btw there is another way to ameliorate defence stations. I did it in my XRSGE mod. Prepare a custom construction plan with defence stations having many more defence modules than the vanilla ones. Then use the file exported in the document folder to patch vanilla plans in the constructionplan.xml to replace vanilla with yours. At game's start the engine will use yours instead

Starman01
Posts: 189
Joined: Wed, 20. Jun 07, 13:56
x4

Re: When will changes in structure-macro.xml take effect ?

Post by Starman01 » Sun, 14. Apr 24, 13:23

Thank you very much for your comment... Actually i do not know anything about xml coding, therefore I just didn't realized that arrow symbols are actually interpreted as a function... I was now able to change the file, and the effect is also immediately seen in the encyclopedia. Have to start a new game anyway, so it's save to go for it.

Thanks for the idea with the updated construction plan... I take a look into it, the AI could definitly need better stations for that.

Could you please elaborate a bit more in detail where I have to copy the entry into ? I suppose my own "design" is the one I save in the station building designer. Once I found that I will manage to copy it into, just need to know the place where I have to paste it too. After a quick look i can't find the constructionplan.xml from vanilla, I suppose it's inside a *.cat file too ?

Realspace
Posts: 1380
Joined: Wed, 15. Nov 06, 10:21
x4

Re: When will changes in structure-macro.xml take effect ?

Post by Realspace » Sun, 14. Apr 24, 17:30

Yes it is inside cat and is in libraries/ folder. Called construnctionplans xml. There you find different plans for shipyards, trade stations and defence. Not factories that are generated by the engine in a randomized way.
Find the plan you want to change and prepare a patch that replaces that single plan. Copypaste your plan but use the header of the vanilla plan. The rest, the numbered nodes, are from your custom plan instead. So
In your new plan replicate the same id and text reference you see at the start of the vanilla plan (names are recalled by numbers refering to page and line, inside the t folder. But you don't need to change that, names remain vanilla.

Having time to do it I could prepare a mod with only better def stations. I've redone them all for xrsge mod but they'd work also in a vanilla game.

Post Reply

Return to “X4: Foundations - Scripts and Modding”