[X3AP] Need help with creating mod

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
michael86
Posts: 29
Joined: Tue, 8. Jun 21, 17:52
x3ap

[X3AP] Need help with creating mod

Post by michael86 » Mon, 21. Mar 22, 03:06

Hello
I want to create my own mod and have a few questions. So far, I use TC/AP and the mods for IE, IEX and TCP4AP. Last one is 07.cat.
For all my addons I want, I created the 08.cat and copied all the needed files in it but it doesn't work.
For example, CODEA.
All files which are already in /tc/addon/scripts, I copied them in the same directory and overwrote them.
The other files are in 08.cat /addon/scripts and I can't get it to work.
If I move all files in /tc/addon/scripts, then it works for some miracle.
Is there something I missed and doing wrong?

What is the priority in the file system structure?
Everything in the main directories can't be overridden by any cat-file and if not already in the regular directories, files in cat-files have the highest priority in the highest numbered cat-file. Is that correct?
What is if the same file is in /tc and /tc/addon? Does AP use files in the old TC directories?

I hope you understand what I mean.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22224
Joined: Sun, 14. Nov 04, 23:26
x4

Re: [X3AP] Need help with creating mod

Post by Cycrow » Mon, 21. Mar 22, 13:14

first off, you cant put script files inside cat files, they wont be read by the game, They must always be loose in the scripts directory.

The files will be read from lowest to highest cat files, then the selected mod file (in the mods directory), then the loose files

so each file replaces the previous ones. So the files that are loose will be the ones used if they exist.

also packed files have priority over unpacked ones

for AP, it reads all the stuff from TC first, then it reads everything from addon. Not everything can go in the addon folder though. Things like models, textures, sounds, etc go outside of assests, then the types files, scripts, md files etc go in addon.

when creating a mod for AP, any model files should be put in a cat file, and the cat file itself should be in addon. If you add types files into the cat, they must be in the addon folder within the cat

michael86
Posts: 29
Joined: Tue, 8. Jun 21, 17:52
x3ap

Re: [X3AP] Need help with creating mod

Post by michael86 » Tue, 22. Mar 22, 17:54

cool, thank you for the detailed explanation. I was just wondering because I have seen other mods with scripts in their cat-files. Now it makes sense and explains what I had tested so far.
Is there a manual or something that explains all the basics? I have a lot more questions but it's always very time-consuming to get all the information if you can get them somewhere.
I am already reading through the "Tutorials and Resources" here. I want to change the map a little and then start with scripts. Making scripts doesn't look too hard.
What else, besides changes in the main map, requires a new game start?
And another question to the admin. Do you want me to post further questions here or should I post in all the older threats, even if they are 10 years old?

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22224
Joined: Sun, 14. Nov 04, 23:26
x4

Re: [X3AP] Need help with creating mod

Post by Cycrow » Wed, 23. Mar 22, 12:16

theres no single guide for all modding, but it depends what you want to actual change

For editing the map, you can use the in-game galaxy editor.

Theres also the X3 Editor 2 program you can use for editing the various types files

for Scripting, there's the MSCI guide from X2, it covers most of the basics (it only includes the commands from X2 but the basics are the same in all games)

Most things can be edited while maintaining save game compatibility, even the map (although its more difficult to achieve)
Generally if you making a large mod with lots of changes, you will probably want to require a new start.

for just scripts, these will run fine in existing games.


For Posting, there is the general questions tread you can post it thats a sticky (dont worry about the date on that one)
Any questions about specific mods should go in the mods posts (again dont worry about the dates)
however, any generic posts that old you should really just create a new post instead.

you can also post everything here if you prefer and can keep all the questions together

michael86
Posts: 29
Joined: Tue, 8. Jun 21, 17:52
x3ap

Re: [X3AP] Need help with creating mod

Post by michael86 » Sat, 26. Mar 22, 06:23

Cycrow wrote:
Wed, 23. Mar 22, 12:16
theres no single guide for all modding, but it depends what you want to actual change
first not that much but I think it will be more than enough for a beginner.
Cycrow wrote:
Wed, 23. Mar 22, 12:16
For editing the map, you can use the in-game galaxy editor.
Theres also the X3 Editor 2 program you can use for editing the various types files
I tried that, X3 Editor 2 doesn't work for some reason and the galaxy editor is more to combine and not to split maps?
Using the older X3 Editor or just the text-files instead works better for me.
Cycrow wrote:
Wed, 23. Mar 22, 12:16
for Scripting, there's the MSCI guide from X2, it covers most of the basics (it only includes the commands from X2 but the basics are the same in all games)
I already found it but thanks. It looks a little like Java script. I have no experience with scripts in general but I have to learn it anyway for school. So the game will be a good excuse.
Cycrow wrote:
Wed, 23. Mar 22, 12:16
Most things can be edited while maintaining save game compatibility, even the map (although its more difficult to achieve)
Generally if you making a large mod with lots of changes, you will probably want to require a new start.
I always thought, the main map is the biggest problem. It shouldn’t be a big of a deal to add things afterward with sub-maps but can you also remove objects that easily?
Changes in type-files only take effect on new and not already existing objects but you can change them in-game right?
I don’t want to create a new mod itself. I just want to improve the vanilla game and make it a little more realistic and interesting but no cheats.
Cycrow wrote:
Wed, 23. Mar 22, 12:16
For Posting, there is the general questions tread you can post it thats a sticky (dont worry about the date on that one)
Any questions about specific mods should go in the mods posts (again dont worry about the dates)
however, any generic posts that old you should really just create a new post instead.

you can also post everything here if you prefer and can keep all the questions together
Ok, if its just a simple question I will post it in general questions, specific questions about the mods Iam using in those posts and the bigger problems here so its easier to understand how it works together.

I made a list with changes and broke them down into smaller problems. Will post the first part later (its about the map) and then we can analyze my conclusion.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22224
Joined: Sun, 14. Nov 04, 23:26
x4

Re: [X3AP] Need help with creating mod

Post by Cycrow » Sat, 26. Mar 22, 09:49

michael86 wrote:
Sat, 26. Mar 22, 06:23
I tried that, X3 Editor 2 doesn't work for some reason and the galaxy editor is more to combine and not to split maps?
Using the older X3 Editor or just the text-files instead works better for me.
The X3 Editor 2 should work, what problems were you having with it ?
That was actually the editor used to during the X3AP and X3FL development (and some of X3TC)

The galaxy editor is primarily used to create and edit the universe file, you can also use it to load multiple map files to merge them
The universe file defines all the sectors and parameters, as well as the stations.
michael86 wrote:
Sat, 26. Mar 22, 06:23
I always thought, the main map is the biggest problem. It shouldn’t be a big of a deal to add things afterward with sub-maps but can you also remove objects that easily?
Changes in type-files only take effect on new and not already existing objects but you can change them in-game right?
I don’t want to create a new mod itself. I just want to improve the vanilla game and make it a little more realistic and interesting but no cheats.
You can remove objects in a live game via a patch script. You create a script that finds all the items you want to remove and destroy them. You cant remove the physical sector, but you can remove everything in it including the game so its no longer usable
Some changes in types files only work on newly created objects, but not all, some changes you can make and work in a save game. For the others, you can also use a script to find all instances of those objects, and recreate them so the new versions will have the changes.
Adding new sectors into the game requires you to patch a new universe map via the MD.

Patch scripts can get quite complicated and have their limits though, which is why alot of large mods dont bother and just force a new game

michael86
Posts: 29
Joined: Tue, 8. Jun 21, 17:52
x3ap

Re: [X3AP] Need help with creating mod

Post by michael86 » Sat, 26. Mar 22, 11:52

Cycrow wrote:
Sat, 26. Mar 22, 09:49
The X3 Editor 2 should work, what problems were you having with it ?
That was actually the editor used to during the X3AP and X3FL development (and some of X3TC)
I could find anything where I can load a map. But don’t worry about that. I'm fine with text-files. I already figured out how it works with tships and so on and how to add/copy things from other mods and its easier than I thought.
Cycrow wrote:
Sat, 26. Mar 22, 09:49
Patch scripts can get quite complicated and have their limits though, which is why alot of large mods dont bother and just force a new game
Ok then the complicated things first.
Cycrow wrote:
Sat, 26. Mar 22, 09:49
Adding new sectors into the game requires you to patch a new universe map via the MD.
That was the plan. I guess the sectors are not the problem.

So, here is what I am planning to do.
I want to split the mod TCP4AP into two parts (actually 3 but more about that later). First the TC part and then, after the plots are done, the AP part.
It would be so much easier if its just the map. Remove the 4 AP sectors from x3_universe and later, load onother map. BUT, one of the Corp HQs is in there. Sure, I could just leave it like that and keep the sectors. But at least I wanted to try it. And yes, I'm aware, it will be a lot of work.
Last edited by michael86 on Tue, 29. Mar 22, 03:37, edited 1 time in total.

michael86
Posts: 29
Joined: Tue, 8. Jun 21, 17:52
x3ap

Re: [X3AP] Need help with creating mod

Post by michael86 » Tue, 29. Mar 22, 03:36

So, I changed my plan a little
I keep the map as it is, just remove a few gates and stations which the MD will place when needed instead of loading an additional map.

Can the MD add ships (for sale) to the shipyards inventory? Is it the same command as for adding an object to a ship station?

In the meantime, I have changed a few things in the mission script. would someone please take a look at it? Lines 35-54 and 65-86.

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <documentation>
    <author name="Al" alias="al_main" />
    <content reference="L2M44" name="Plutarch Missions" description="Mission to work for Plutarch" />
    <version number="0.1" date="09/07/08" status="development"/>
  </documentation>
  <cues>
    <cue name="L2M44" library="1">
      <documentation>
        <content reference="L2M44" name="Corporation Missions" type="L2"/>
        <version number="0.1" date="09/07/08" status="development"/>
        <history>
          <change date="12/03/10" author="enenra" description="Relation check added."/>
          <change date="09/07/08" author="al_main" description="Initial version"/>
        </history>
        <todo>
          <item priority="medium" description="Check missile allocations in L2M44 M02 to make them correct race?"/>
          <item priority="low" description="Small chance text wont sound good if L2M44 M09 is destination"/>
        </todo>
      </documentation>
      <condition>
        <check_age value="{player.age}" min="10s"/>
      </condition>
      <timing>
        <time min="10" max="1000"/>
      </timing>
      <action>
        <set_value name="L2M44.time" exact="0"/>
      </action>
      <cues>
        <cue name="L2M44 Setup" delay="5s">
          <condition>
            <check_all>
              <cue_is_complete cue="L2M44"/>
              <check_age value="{player.age}" min="{value@L2M44.time}"/>
              <check_any>
                <check_all> <!-- Albion Delta -->
                  <count_sectors min="1" x="17" y="5"/>
                  <count_stations typename="SS_DOCK_CORP_4" min="1">
                    <sector x="17" y="5"/>
                    <jumps max="0"/>
                  </count_stations>
                </check_all>
                <check_all> <!-- Orebelt -->
                  <count_sectors min="1" x="1" y="5"/>
                  <count_stations typename="SS_DOCK_CORP_4" min="1">
                    <sector x="1" y="5"/>
                    <jumps max="0"/>
                  </count_stations>
                </check_all>
              </check_any>
            </check_all>
          </condition>
          <action>
            <do_all>
              <set_value name="L2M44.DoMissions" exact="0"/>
              <find_sector name="L2M44.HQSector" x="17" y="5"/> <!-- Albion Delta -->
              <!--Set HQ-->
              <find_station name="L2M44.HQ" typename="SS_DOCK_CORP_4">
                <sector sector="L2M44.HQSector"/>
                <jumps max="0"/>
              </find_station>
              <do_choose>
                <do_when value="{object.exists@L2M44.HQ}" exact="0">
                  <find_sector name="L2M44.HQSector" x="1" y="5"/>  <!-- Orebelt -->
                  <find_station name="L2M44.HQ" typename="SS_DOCK_CORP_4">
                    <sector sector="L2M44.HQSector"/>
                    <jumps max="0"/>
                  </find_station>
                  <do_choose>
                    <do_when value="{object.exists@L2M44.HQ}" exact="0">
                      <set_value name="L2M44.time" exact="{player.age}+300"/>
                      <reset_cue cue="L2M44 Setup"/>
                    </do_when>
                    <do_otherwise>
                      <set_value name="L2M44.OfferRace" exact="{object.race@L2M44.HQ}"/>
                    </do_otherwise>
                  </do_choose>
                </do_when>
                <do_otherwise>
                  <set_value name="L2M44.OfferRace" exact="{object.race@L2M44.HQ}"/>
                  <!--the rest of the setup goes in here-->
                </do_otherwise>
              </do_choose>
            </do_all>
          </action>
I think, now I understand, how scripts work but Iam not so sure. Its definitely more complicated than in other languages.
How did you guys leran that without having any helpful documentation?


michael86
Posts: 29
Joined: Tue, 8. Jun 21, 17:52
x3ap

Re: [X3AP] Need help with creating mod

Post by michael86 » Tue, 29. Mar 22, 22:41

Joubarbe
Thank you, that is what I was looking for.
I also found the XMD Mission Director Guide.

So, I tested it, and it doesn't work.
Moved the HQ on the Map from (15/5) to /1/5) and it seems to work there.
After I destroy it there and create a new one in (15/5), the HQ is there but empty and has no missions available. I used cycrow's cheat package for that.
I left the sector a few times and also waited for almost an hour.
What did I do wrong?

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”