Parameters Changing at Runtime

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

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

draconass
Posts: 4
Joined: Wed, 2. Nov 16, 15:51

Parameters Changing at Runtime

Post by draconass »

Preface:
  • I have only recently begun digging into the XML for mods and the underlying logic for how things tie together.
  • As a test of my understanding, I am trying to modify an existing mod - Civilian Fleets - (locally only, I refuse to plagiarize) to add order copying for Mules (from Station Mule).
The question I have is this:

I can clearly see what parameters are being populated by StationMule and how things are being copied across in Civilian Fleets. When I added debug logging to the Station Mule XML file and a default order is set on a ship, the values output just fine (0/1 as they are all bool). When I assign a ship and attempt to copy those default orders by param name, some copy over, but others are null. I cannot for the life of me find where these values are cleared out, and thus my question.

Is there some mechanism I'm just not seeing where values have access modifiers? For example, C# has private, internal, and protected (and public, but that wouldn't be my problem here). I'm seeing no difference between these and others in the XML directly, but I admit I am unfamiliar with this language so it is very likely some kind of newbie mistake on my end.

Any help here would be much appreciated, including the response "Here's the language, go look it up yourself."

Thanks in advance,
-D

edit: Clarified that that I added logging to Station Mule's XML (as opposed to "the XML file").
teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: Parameters Changing at Runtime

Post by teleportationwars »

Code examples would be pretty helpful.
draconass
Posts: 4
Joined: Wed, 2. Nov 16, 15:51

Re: Parameters Changing at Runtime

Post by draconass »

This is embarrassing. I had logging in place everywhere, was going back and forth between files, checking debug logs, assigning in different ways (StationMule can assign to source station), etc.

Turns out I had typed a "%" into a value attribute as opposed to a "$". I was too tired last night to see it. Apparently that breaks everything behind it, too, as after that all values came across as null (it expressed itself as lookup failing in the logs).

Welp. That's, uh.. that's that, then.

Thank you for responding, teleportationwars. Copying my code and log outputs into this chat caused me to re-examine everything with fresh eyes.

Return to “X4: Foundations - Scripts and Modding”