I put together a quick HelloWorld sample mod. Steps:
1) Create a directory called HelloWorld in X4 Foundations\extensions\HelloWorld
2) Create a content.xml file in that directory, as seen below.
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<content id="HelloWorld" name="HellowWorld" description="Simple hello world extension." author="werit" version="001" date="2019-07-24" save="0">
<text language="44" name="HelloWorld" description="Sample extension" author="Werit" />
</content>
4) In the md directory, create a file called HelloWorld.xml with the contents below
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<mdscript name="HelloWorld" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
<cues>
<cue name="WaitForGameStart">
<conditions>
<event_game_loaded />
</conditions>
<actions>
<debug_text text="'Hello World!'" filter="error" />
</actions>
</cue>
</cues>
</mdscript>
6) Startup X4, go into Extensions and make sure HelloWorld is enabled. Log into a game.
7) Find debugLog.txt, it should have a line: [=ERROR=] 29816.83 Context:md.HelloWorld.WaitForGameStart: Hello World!
This may be old news, but hopefully, someone finds it useful.