Some questions about ship definitions

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

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

Post Reply
Urgestein
Posts: 7
Joined: Thu, 2. Jun 22, 09:47
x4

Some questions about ship definitions

Post by Urgestein » Wed, 8. Jun 22, 14:40

Hello,

at first, I like to express my thanks to egosoft for creating such an awesome game, just discovered it a few weeks ago and I'm totally engaged.

So I am trying to build my own ship-loadout-designer. I know, there are plenty of these things, but because I am a professional programmer (mostly C#) I'm eager to create one by myself :) By reading in the forums and looking at the unpacked xml-files I think I learned many of how things are defined. But some questions remain (currently, more to come^^):

For all questions holds, am I looking into the correct files? Or did I oversee something?
  1. Just for proper talking; most of the "entities" consist of two xml-files (and some *.xmf which are not needed for my tasks, I think). The "macro" file and the "other" file. How do you (the modder community) name these "other" files?
  2. As I understand it correctly, the ship equipment slots are defined in these "other" files. For example (from the "ship_arg_l_destroyer_01.xml"):

    Code: Select all

    <connection name="con_turret_009" group="group_mid_down_left " tags="turret medium standard missile hittable ">
    How are the possible (in these case) weapons for this slot are determined? On the weapons "other" file, I found something like (in "turret_par_m_guided_02_mk1.xml":

    Code: Select all

    <connection name="con_guided_turret" tags="turret medium missile component hittable">
    Is it really just the tags?
  3. In the ship designer in game there are three different behaviors for selecting multiple equipments. Let's look at the "ship_arg_l_destroyer_01.xml".
    1. There are two weapons defined. In the ship designer we have two "slots" where we have to select the weapons "seperately" (even if there is no real "selection").

      Code: Select all

      <connection name="con_weapon_02" tags="weapon large standard arg_destroyer_01 ">
      <connection name="con_weapon_01" tags="weapon large standard arg_destroyer_01 ">
    2. There are three engines defined. In the ship designer we have only one selection which sets all three engines. Perhaps it's because of the "group"?

      Code: Select all

      <connection name="con_engine_01" group="group_back_up_mid " tags="engine large ">
      <connection name="con_engine_02" group="group_back_up_mid " tags="engine large ">
      <connection name="con_engine_03" group="group_back_up_mid " tags="engine large ">
    3. And there is the group "group_front_up_left" which consists of two turrets and one shield, but in the designer the turrets are just a "slider".

      Code: Select all

      <connection name="con_turret_010" group="group_front_up_left " tags="turret medium standard missile hittable ">
      <connection name="con_turret_002" group="group_front_up_left " tags="turret medium standard missile hittable ">
      <connection name="con_shieldgen_001" group="group_front_up_left " tags="medium shield hittable ">
    Are these different behaviors hardcoded into the ship designer or just derived from the different definitions of these equipments?
    I can image something about:
    1. No group but all are weapons, so display the separately.
    2. One group and all are engines, so combine them into one selection.
    3. One group with different equipment types, so combine the same ones.
On the whole I am unsure about these "connection" tags, as some of them seem to define equipment-slots (in the ship-xml), some of the seem to define more graphical things (also on the ship-xml, but not shown here). And in the turret-xml they define some sort of "properties"!? But there is no "type" or something to determine which "connection" tag is to obey for a specific information. Perhaps someone can elaborate a little bit on this?

Thanks in advance for your help.
Last edited by Urgestein on Thu, 9. Jun 22, 13:52, edited 2 times in total.

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Some questions about ship definitions

Post by DeadAirRT » Wed, 8. Jun 22, 15:19

Urgestein wrote:
Wed, 8. Jun 22, 14:40
Hello,

at first, I like to express my thanks to egosoft for creating such an awesome game, just discovered it a few weeks ago and I'm totally engaged.

So I am trying to build my own ship-loadout-designer. I know, there are plenty of these things, but because I am a professional programmer (mostly C#) I'm eager to create one by myself :) By reading in the forums and looking at the unpacked xml-files I think I learned many of how things are defined. But some questions remain (currently, more to come^^):

For all questions holds, am I looking into the correct files? Or did I oversee something?
  1. Just for proper talking; most of the "entities" consist of two xml-files (and some *.xmf which are not needed for my tasks, I think). The "macro" file and the "other" file. How do you (the modder community) name these "other" files?
  2. As I understand it correctly, the ship equipment slots are defined in these "other" files. For example (from the "ship_arg_l_destroyer_01.xml"):

    Code: Select all

    <connection name="con_turret_009" group="group_mid_down_left " tags="turret medium standard missile hittable ">
    How are the possible (in these case) weapons for this slot are determined? On the weapons "other" file, I found something like (in "turret_par_m_guided_02_mk1.xml":

    Code: Select all

    <connection name="con_guided_turret" tags="turret medium missile component hittable">
    Is it really just the tags?
  3. In the ship designer in game there are three different behaviors for selecting multiple equipments. Let's look at the "ship_arg_l_destroyer_01.xml".
    1. There are two weapons defined. In the ship designer we have two "slots" where we have to select the weapons "seperately" (even if there is no real "selection").

      Code: Select all

      <connection name="con_weapon_02" tags="weapon large standard arg_destroyer_01 ">
      <connection name="con_weapon_01" tags="weapon large standard arg_destroyer_01 ">
    2. There are three engines defined. In the ship designer we have only one selection which sets all three engines. Perhaps it's because of the "group"?

      Code: Select all

      <connection name="con_engine_01" group="group_back_up_mid " tags="engine large ">
      <connection name="con_engine_02" group="group_back_up_mid " tags="engine large ">
      <connection name="con_engine_03" group="group_back_up_mid " tags="engine large ">
    3. And there is the group "group_front_up_left" which consists of two turrets and one shield, but in the designer the turrets are just a "slider".

      Code: Select all

      <connection name="con_turret_010" group="group_front_up_left " tags="turret medium standard missile hittable ">
      <connection name="con_turret_002" group="group_front_up_left " tags="turret medium standard missile hittable ">
      <connection name="con_shieldgen_001" group="group_front_up_left " tags="medium shield hittable ">
    Are these different behaviors hardcoded into the ship designer or just derived from the different definitions of these equipments?
    I can image something about:
    1. No group but all are weapons, so display the separately.
    2. One group and all are engines, so combine them into one selection.
    3. One group with different equipment types, so combine the same ones.
On the whole I am unsure about these "connection" tags, as some of them seem to define equipment-slots (in the ship-xml), some of the seem to define more graphical things (also on the ship-xml, but not shown here). And in the turret-xml they define some sort of "properties"!? But there is no "type" or something to determine which "connection" tag is to obey for a specific information. Perhaps someone can elaborate a little bit on this?

Thanks in advance for your help.
1) it's the ship connection file. Usually best to follow egosoft naming and having it the same as ship macro file without _macro.
2) Correct. It describes where an available connection is. It's based on the tags, the one you linked is for a medium hittable turret of either standard or missile variety.
3) a)If you mod in additional weapons that have the correct tags, they would be selected individually.
b/c)groups only allow one selection type per turret/engine/shield slot

Connection points are used for basically everything. You literally have to define where the hull itself connects on the ship object and there are more complex ones with many connections just for the "ship". The important connections actually have to match the 3d data object itself but for the others, name isn't as important but the game will only recognize certain naming conventions.

Urgestein
Posts: 7
Joined: Thu, 2. Jun 22, 09:47
x4

Re: Some questions about ship definitions

Post by Urgestein » Wed, 8. Jun 22, 19:00

DeadAirRT wrote:
Wed, 8. Jun 22, 15:19
Thanks

...more questions to come...

Urgestein
Posts: 7
Joined: Thu, 2. Jun 22, 09:47
x4

Re: Some questions about ship definitions

Post by Urgestein » Thu, 9. Jun 22, 13:52

I'll post my next question here again, because it's related...

How do I (or my xml reader/interpreter) know which of the tags are "and"-related and which are "or"-related?

Again, I use the "ship_arg_destroyer_01.xml" as an example.

Code: Select all

<connection name="con_turret_laser_l_003" group="group_front_mid_mid " tags="turret large standard missile ">
Here the tags are (if I'm not mistaken): "turret AND large AND (standard OR missile)". Because, if i do all "ANDs", no equipment will be found, if I do all "ORs", also the "turret small mining" will be found...

Thanks

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Some questions about ship definitions

Post by DeadAirRT » Thu, 9. Jun 22, 16:22

Urgestein wrote:
Thu, 9. Jun 22, 13:52
I'll post my next question here again, because it's related...

How do I (or my xml reader/interpreter) know which of the tags are "and"-related and which are "or"-related?

Again, I use the "ship_arg_destroyer_01.xml" as an example.

Code: Select all

<connection name="con_turret_laser_l_003" group="group_front_mid_mid " tags="turret large standard missile ">
Here the tags are (if I'm not mistaken): "turret AND large AND (standard OR missile)". Because, if i do all "ANDs", no equipment will be found, if I do all "ORs", also the "turret small mining" will be found...

Thanks
That is a good question and I'm not entirely sure. I believe certain pre defined tags are and's but there isn't any documentation to verify it

Urgestein
Posts: 7
Joined: Thu, 2. Jun 22, 09:47
x4

Re: Some questions about ship definitions

Post by Urgestein » Thu, 9. Jun 22, 19:19

DeadAirRT wrote:
Thu, 9. Jun 22, 16:22
That is a good question and I'm not entirely sure. I believe certain pre defined tags are and's but there isn't any documentation to verify it
Well, then... For the moment I just hardcode the "ANDs" and "ORs".

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

Re: Some questions about ship definitions

Post by euclid » Fri, 10. Jun 22, 18:12

The list is just a collection of tags (AND if you like). Conditional actions are then possible via hastag or via indexof.

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

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Some questions about ship definitions

Post by DeadAirRT » Fri, 10. Jun 22, 18:28

euclid wrote:
Fri, 10. Jun 22, 18:12
The list is just a collection of tags (AND if you like). Conditional actions are then possible via hastag or via indexof.

Cheers Euclid
That works only in md, not in ship connections file

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1847
Joined: Mon, 23. Nov 15, 18:02

Re: Some questions about ship definitions

Post by j.harshaw » Wed, 29. Jun 22, 18:06

Helps to think of them in terms of slots and connectors that go into those slots.

A slot that is "round green narrow deep" can accommodate anything that has any of those tags. A round thing will fit, as will a green thing, as will a round green thing; but not a square green thing. A round thing needn't be green, but it shouldn't specify a contradicting tag.

Slots can accommodate things that have tags that match any of their tags.
Connectors can only fit slots that have all of their tags.
So I guess you could say slots: or; connector: and.

Sorry, if that's unclear. Back of my head's still whirling around trying to translate the concept into words. It's almost too hot for thought today.

Caveat: I don't work directly with asset creation, so don't know if this is absolute. It does apply as far as I know, though.

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Some questions about ship definitions

Post by DeadAirRT » Wed, 29. Jun 22, 18:30

j.harshaw wrote:
Wed, 29. Jun 22, 18:06
Helps to think of them in terms of slots and connectors that go into those slots.

A slot that is "round green narrow deep" can accommodate anything that has any of those tags. A round thing will fit, as will a green thing, as will a round green thing; but not a square green thing. A round thing needn't be green, but it shouldn't specify a contradicting tag.

Slots can accommodate things that have tags that match any of their tags.
Connectors can only fit slots that have all of their tags.
So I guess you could say slots: or; connector: and.

Sorry, if that's unclear. Back of my head's still whirling around trying to translate the concept into words. It's almost too hot for thought today.

Caveat: I don't work directly with asset creation, so don't know if this is absolute. It does apply as far as I know, though.
That is extremely helpful. Thank you!

Urgestein
Posts: 7
Joined: Thu, 2. Jun 22, 09:47
x4

Re: Some questions about ship definitions

Post by Urgestein » Fri, 8. Jul 22, 17:17

Sorry, for my late response, I don't receive any notifications that here are more answers :gruebel:

Thanks for the further explanations, I try to implement these into my considerations.
I think (hope), I understand the principle...

Post Reply

Return to “X4: Foundations - Scripts and Modding”