Download the PHP package mistralys/x4-core without Composer
On this page you can find all versions of the php package mistralys/x4-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mistralys/x4-core
More information about mistralys/x4-core
Files in mistralys/x4-core
Package x4-core
Short Description Database and utility classes used to access X4: Foundations game data in an OOP way.
License MIT
Informations about the package x4-core
X4 Database Core
Database and utility classes used to access X4: Foundations game data in an OOP way. It is designed to be used as a dependency in other projects (see X4 Tools, for example).
Version
Current Version: 1.0.1 Documentation: Project Manifest
Database features
- Faction database
- Ware database
- Ship database
- Station module database
- Blueprint database
- Translation tool
- DLC metadata
- Macro file index
- Automated database file generation from the game data
Requirements
- PHP 8.4 or higher.
- Composer.
Installation
Require the package in your Composer project:
Usage
Raw JSON data files
All extracted game data is stored in JSON files in the data folder.
- factions.json - Faction definitions
- wares.json - Ware definitions
- ships.json - Ship definitions
- modules.json - Station module definitions
- blueprints.json - Blueprints
- macro-index.json - Macro file index
- data-sources.json - Data sources (DLC metadata)
The faction classes
All factions available in the game can be accessed through the faction collection.
The faction collection
All factions are available through the FactionDefs collection class.
Faction getter methods
When working with the faction classes, dedicated getter methods exist to access factions instead of using the faction ID constants.
The ware classes
All items available in the game, from trade goods to ships, are available in the main ware collection.
The ware collection
All wares are available through the Wares collection class.
This fetches wares by ID:
The ware finder
The ware finder utility class allows selecting search criteria to filter the wares and retrieve specific wares. The following example uses the ware finder to retrieve all ship engines provided by the Boron DLC.
The ship classes
All ships available in the game can be accessed through the ship collection.
Accessing translations
The official translations are bundled with the package, and can be
accessed to translate text codes like {20101,20604} ("Manorina (Gas) Vanguard").
Development setup
Unpacking game data files
The mod requires the game's data files to be unpacked using the X4 Data Extractor tool. The tool acts as a library to access the extracted information. This includes the DLC metadata necessary to generate the correct mod file structure.
Please refer to the tool's instructions to unpack the game data files.
Configuration
- Unpack the data files (see above).
- Clone this repository.
- Copy
dev-config.php.disttodev-config.php. - Edit the file to set the correct paths.
Database update
To update the bundled database, use the build Composer command
to update the JSON files in the data folder.
X4 Tools and libraries
- X4 Game Notes - Docs - Howto, tips and general information about X4.
- X4 Core - Library - Access X4 game data in an OOP way.
- X4 Data Extractor - Tool & Library - Extract X4 game files.
- X4 Savegame Parser - Tool - Parse X4 savegames to extract information.
- X4 Cargo Size Mod - Mod - Mod to increase ship cargo sizes.
All versions of x4-core with dependencies
fortawesome/font-awesome Version ^5.15
mistralys/application-utils Version >=2.3.2
mistralys/application-utils-core Version >=2.3.12
mistralys/application-localization Version >=2.1.1
mistralys/x4-data-extractor Version >=2.0.0
symfony/css-selector Version >=v7.2.0
thomaspark/bootswatch Version ^v5.1.3
twbs/bootstrap Version ^v5.1.3
php Version >=8.4
ext-simplexml Version *
ext-json Version *
ext-mbstring Version *
ext-dom Version *
ext-curl Version *