--- title: faction - X4 schema type summary: faction: X4 attribute schema type: base types, constraints and value alternatives. section: reference kind: guide status: reference updated: 2026-10-27 tags: ["XSD","schema","types"] sources: ["https://wiki.egosoft.com/X4%20Foundations%20Wiki/Modding%20Support/","https://www.w3.org/TR/xmlschema11-2/"] --- ## Meaning faction: X4 attribute schema type: base types, constraints and value alternatives. An XSD type constrains XML, rather than declaring a Lua return or the payload type of event.param. A valid schema value does not prove a successful game effect. ## Schema structure `libraries/common.xsd` | Property | Value | | --- | --- | | Construction | `restriction` | | Base type | [`factionexprlookup`](wiki:schema-factionexprlookup-6ea384ee) | restriction narrows a base type; union accepts one of its branches; list describes whitespace-separated items. Enumeration values in one restriction are alternatives. Pattern syntax is XML Schema regex, not Lua patterns or JavaScript RegExp. Constraints inherited from the base type still apply. ## Example and result Use the attribute pages below for contextual examples. A generic executable example is not inferred from a type name alone. ## Used by | Element | Attribute | Schema | | --- | --- | --- | | [`add_build_to_construct_ship`](wiki:api-md-add-build-to-construct-ship-ea0eff82) | `faction` | `libraries/common.xsd` | | [`add_licence`](wiki:api-md-add-licence-e412a472) | `faction` | `libraries/common.xsd` | | [`add_licence`](wiki:api-md-add-licence-e412a472) | `licencefaction` | `libraries/common.xsd` | | [`add_player_discount`](wiki:api-md-add-player-discount-6074b9f2) | `faction` | `libraries/common.xsd` | | [`create_lockbox`](wiki:api-md-create-lockbox-b0c24714) | `owner` | `libraries/common.xsd` | | [`create_object`](wiki:api-md-create-object-c1cb2a4c) | `owner` | `libraries/common.xsd` | | [`create_station`](wiki:api-md-create-station-1e683e8a) | `owner` | `libraries/common.xsd` | | [`event_object_changed_true_owner`](wiki:api-mdevent-event-object-changed-true-owner-d4bd10fc) | `owner` | `libraries/common.xsd` | | [`event_object_changed_true_owner`](wiki:api-mdevent-event-object-changed-true-owner-d4bd10fc) | `previous` | `libraries/common.xsd` | | [`owner`](wiki:api-md-owner-85a24084) | `licencefaction` | `libraries/common.xsd` | | [`remove_licence`](wiki:api-md-remove-licence-0a14eb5f) | `faction` | `libraries/common.xsd` | | [`remove_licence`](wiki:api-md-remove-licence-0a14eb5f) | `licencefaction` | `libraries/common.xsd` | | [`remove_player_discount`](wiki:api-md-remove-player-discount-39d14cb8) | `faction` | `libraries/common.xsd` | | [`reserve_build_plot`](wiki:api-md-reserve-build-plot-18a4f14d) | `owner` | `libraries/common.xsd` | | [`set_faction_identity`](wiki:api-md-set-faction-identity-6f1e176a) | `faction` | `libraries/common.xsd` | | [`set_faction_relation`](wiki:api-md-set-faction-relation-7593a020) | `faction` | `libraries/common.xsd` | | [`set_faction_relation`](wiki:api-md-set-faction-relation-7593a020) | `otherfaction` | `libraries/common.xsd` | | [`set_faction_relation_locked`](wiki:api-md-set-faction-relation-locked-5aa95c0c) | `faction` | `libraries/common.xsd` | [All schema types](wiki:schema-types) ยท [Lua / MD value types](wiki:types)