Api Reference?

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

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

Post Reply
User avatar
Hairless-Ape
Posts: 321
Joined: Wed, 6. Nov 02, 20:31
xr

Api Reference?

Post by Hairless-Ape » Thu, 6. Jun 19, 19:28

Hi,

Does anyone know if there is an API reference for scripting X4?

There are numerous methods shown in the Schema, such as "add_blueprints", or "destroy_group". I don't know where to find a reference though for various parameters and usage for these methods. Do you all get usage information from other examples only, or is there a reference somewhere?

Thanks much.

nickolaiproblem
Posts: 246
Joined: Mon, 5. Nov 18, 23:12
x4

Re: Api Reference?

Post by nickolaiproblem » Fri, 7. Jun 19, 12:22

Hairless-Ape wrote:
Thu, 6. Jun 19, 19:28
Hi,

Does anyone know if there is an API reference for scripting X4?

There are numerous methods shown in the Schema, such as "add_blueprints", or "destroy_group". I don't know where to find a reference though for various parameters and usage for these methods. Do you all get usage information from other examples only, or is there a reference somewhere?

Thanks much.
I wouldn't know but the x4 discord might https://discord.gg/J8u6Kdc

LegionOfOne
Posts: 122
Joined: Sun, 16. Dec 18, 13:16
x4

Re: Api Reference?

Post by LegionOfOne » Fri, 7. Jun 19, 18:28

Look in libraries\common.xsd and libraries\scriptproperties.xml, they contain many of the reference elements.
If I remember correctly they are in 06.cat/dat or 07.cat/dat.

For instance, add_blueprints is in common.xsd and looks like this :

Code: Select all

      <xs:element name="add_blueprints">
        <xs:annotation>
          <xs:documentation>
            Add blueprints to player's blueprint library
          </xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:attribute name="wares" type="expression" use="optional">
            <xs:annotation>
              <xs:documentation>
                Ware or list of wares for which to add blueprints (can be combined with macros and object in a single call)
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="macros" type="expression" use="optional">
            <xs:annotation>
              <xs:documentation>
                Macro or list of macros for which to add blueprints (can be combined with wares and object in a single call)
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="object" type="expression" use="optional">
            <xs:annotation>
              <xs:documentation>
                Object (station or ship) for which to add blueprints (can be combined with wares and macros in a single call)
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="method" type="expression" use="optional">
            <xs:annotation>
              <xs:documentation>
                Production method for blueprint(s) (will be the same for all added blueprints, uses default method if not supplied)
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="cycle" type="expression" use="optional">
            <xs:annotation>
              <xs:documentation>
                Cycle efficiency for blueprint(s) (will be the same for all added blueprints, uses 1.0 if not supplied)
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="resource" type="expression" use="optional">
            <xs:annotation>
              <xs:documentation>
                Resource efficiency for blueprint(s) (will be the same for all added blueprints, uses 1.0 if not supplied)
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="product" type="expression" use="optional">
            <xs:annotation>
              <xs:documentation>
                Product efficiency for blueprint(s) (will be the same for all added blueprints, uses 1.0 if not supplied)
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="modules" type="booleanexpression" use="optional">
            <xs:annotation>
              <xs:documentation>
                Include blueprints for modules (used only with object attribute, default is true)
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="flags" type="loadoutflagbitmask" use="optional">
            <xs:annotation>
              <xs:documentation>
                Include blueprints for equipment in specific loadout elements (used only with object attribute, default is all loadout elements)
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:complexType>
      </xs:element>

User avatar
Hairless-Ape
Posts: 321
Joined: Wed, 6. Nov 02, 20:31
xr

Re: Api Reference?

Post by Hairless-Ape » Sat, 8. Jun 19, 05:08

Thank you, that helps a lot.

Post Reply

Return to “X4: Foundations - Scripts and Modding”