9.0 Beta modding information

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

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

Shuulo (EGO)
EGOSOFT
EGOSOFT
Posts: 33
Joined: Fri, 1. Apr 22, 17:56

9.0 Beta modding information

Post by Shuulo (EGO) »

With there release of public beta of 9.0 update we want to share some info regarding modding to ease the transition to new version for modders.
Please read carefully the list of breaking changes that come with the update (note that the list may expand during public beta)

Pay attention to the first change – Collisions need to be re-exported for all assets that have them, otherwise mod will crash your game. Don't forget to download new tools for that!
Edit: Lc4hunter added below some important info as well:
You only need to reexport your models and convert them with the new XUConverter that you get with the new modding tools which you can download from the bonus content area.
You DONT have to recreate the collisions. Just export it again and use the new converter.


Edit: Note that mod versioning feature does not function fully atm, we will let community know when it will be enabled
Spoiler
Show
To help with mod updates testing we recommend recently added feature in Steam Workshop for X4 mods – versioning. the guide how to use them here.
In addition to the breaking changes, there are some new cool mechanics in 9.0 that may interest some of the modders, here is a short summary:

Shield disruption
– some weapons now can stop regeneration of some heavy (mostly L and XL) shields, this is indicated in their stats.
Shields can now have disruptionstability value and bullets/missiles (as well as explosion effects) can have shielddisruption parameter. If these values are equal or bullet's shielddisruption is higher than shield's disruptionstability then this will force the start of regen delay on the shield. I shield has no disruptionstability value than it behaves as before, with regen delays starting from any shot. NOTE: shielddisruption is not cumulative from different sources.

Travel stability – ships can now have traveldrivestability parameter that indicates how much disruption (damage) they can sustain before they will be forced out of the travel mode. It is naturally higher on larger ships. NOTE: traveldrivestability can be broken from different sources e.g. when few ships attack a single target.
Every incoming damage either starts a 10s timer of checking if TDS is lost, or adds to the total if such a timer is already running. Within those 10s, travel drives cancel if the damage exceeds the TDS of the ship. If the timer runs out before the TDS was brought to zero, TDS instantly restores.
Different weapons can modify how much of their damage impact TDS, with Ions impacting it more and flaks less (as lucky shots can deal damage to multiple surface elements)
Lc4Hunter
XWiki Moderator
XWiki Moderator
Posts: 2225
Joined: Sun, 2. Apr 06, 16:15
x4

Re: 9.0 Beta modding information

Post by Lc4Hunter »

You only need to reexport your models and convert them with the new XUConverter that you get with the new modding tools which you can download from the bonus content area.
You DONT have to recreate the collisions. Just export it again and use the new converter.

You also run both exporters in parallel. Just install the exporter at a different location but point at the same directories you already use for data and assets.
Make a copy of the converter shortcut you already have, give it a fitting name (like P1 Converter LOCAL 9.0) and change the linked exe the new one ( for example "C:\Program Files\EGOSOFT\Egosoft Blender Mod Tools 9.0\Converter\XUConverter.exe" "D:\Proggis\X4_Modding\X4-Egososoft-Blender-Converter\p1[assets]" "D:\Proggis\X4_Modding\X4-Egososoft-Blender-Converter\p1[data]").

In case you want export something for 9.0 upwards, start the new one. In case you want to convert something for smaller then 9.0, use the old one.
I could already verify this works fine :)
User avatar
chew-ie
Posts: 7250
Joined: Mon, 5. May 08, 00:05
x4

Re: 9.0 Beta modding information

Post by chew-ie »

Appreciate the heads-up Shuulo & Lc4Hunter! :thumb_up:
Image
Spoiler
Show
BurnIt: Boron and leaks don't go well together...
Königinnenreich von Boron: Sprich mit deinem Flossenführer
Nila Ti: Folgt mir, ihr Kavalkade von neugierigen Kreaturen!
Tammancktall: Es ist eine Ehre für sie mich kennenzulernen...
CBJ: Thanks for the savegame. We will add it to our "crazy saves" collection [..]

:idea: Feature request: paint jobs on custom starts
CODE_DEN
Posts: 16
Joined: Thu, 23. Jun 22, 11:43
x4

Re: 9.0 Beta modding information

Post by CODE_DEN »

Thank you for the information! It's a good thing that I only made capital ships for GBO, so I won’t have to redo the models. But I’ll have to fix a lot of scripts :cry:

P.S. The new AI for capital ships behaves better, but now the Xenon are broken, and the new threat in the game has become the "Behemoth." It calmly destroys Xenon sectors all by itself! Yesterday during testing, we had fun watching a Behemoth take down an "I" and three "K"s — they didn’t even scratch its hull. :mrgreen:
Buzz2005
Posts: 2332
Joined: Sat, 26. Feb 05, 01:47
x4

Re: 9.0 Beta modding information

Post by Buzz2005 »

CODE_DEN wrote: Thu, 12. Mar 26, 07:36 Thank you for the information! It's a good thing that I only made capital ships for GBO, so I won’t have to redo the models. But I’ll have to fix a lot of scripts :cry:

P.S. The new AI for capital ships behaves better, but now the Xenon are broken, and the new threat in the game has become the "Behemoth." It calmly destroys Xenon sectors all by itself! Yesterday during testing, we had fun watching a Behemoth take down an "I" and three "K"s — they didn’t even scratch its hull. :mrgreen:
a bug, enemies dont shoot back at lone ships, only fleets
Fixed ships getting spawned away from ship configuration menu at resupply ships from automatically getting deployables.
User avatar
ChemODun
Posts: 598
Joined: Mon, 12. Feb 07, 21:58
x4

Re: 9.0 Beta modding information

Post by ChemODun »

Changes in aiscripts.xsd (Version 8.00 HF3 → 9.00 B01)

Enhanced Existing Commands

Movement Commands
  • move_to: Added avoidtargetturretrange attribute
    • Will try to avoid the destination's turret range as much as possible
    • Currently only works if the target is a station, and only for the last target point
    • Optional, defaults to false
Changes in common.xsd (Version 8.00 HF3 → 9.00 B01)

Added Simple Types
  • spacelistnozone: Containing space (sector, cluster, or galaxy) or a list of containing spaces
Removed Simple Types
  • numfreeactorslots: Type removed entirely
Added Attribute Groups
  • findclusterfilters: Group for filtering cluster types in searches
    • normalcluster: Include normal clusters (not presentation/venturer/exploration)
    • presentationcluster: Include presentation clusters
    • venturercluster: Include venturer clusters
    • explorationcluster: Include exploration clusters
Removed Attribute Groups
  • findext_cluster: Attribute group removed
Station Type Changes
  • Added recyclingfacility and factionheadquarters to station type lookups
  • Re-added tradingstation and piratebase as valid station types
Added Event Commands
  • event_object_stance_activated: Event for when an object has activated a stance (object = object activating the stance, param = stance ID)
Removed Event Commands
  • event_area_discovered: Event removed
Added Condition Commands
  • count_highway_entry_gates: Count matching highway entry gates
  • count_highway_exit_gates: Count matching highway exit gates
Added Action Commands
  • add_build_to_recycle_station: Add a build task to recycle a station
  • find_resource_area: Finds a resource area at the specified location
  • create_resource_area: Creates a resource area in the specified sector
  • find_asteroid_with_yield_in_sector: Find asteroid with non-zero yield in sector near specified position
  • find_recyclable_with_yield_in_sector: Find recyclable with non-zero yield in sector near specified position
  • get_god_production_construction_plan: Get construction plan from matching prefab production entry in god.xml
  • request_docking_at_dock: Request docking procedure for ship at a specific dock
  • set_space_environment_seed: Set environment seed for a space (affects celestial bodies appearance)
  • stop_script_influences: Stop any influences from influencelists applied with allowstop flag
  • set_player_undocking_locked: Locks or unlocks the player's ability to undock
  • subtract_build_resources: Subtract required resources to build an object/perform a build task
  • set_detector_disabled: Set the detector to be disabled or not
  • teleport_player_to_spacesuit: Teleport the player into their spacesuit
  • add_mad_score: Adds the attacker's MAD Weight to the target's MAD Score
Removed Action Commands
  • get_highest_resource_yield: Command removed
  • find_asteroid_in_cluster: Command removed (replaced by find_asteroid_with_yield_in_sector)
Enhanced Existing Commands

Find/Count Commands with Cluster Filters
Multiple find and count commands now support findclusterfilters attribute group:
  • count_clusters, count_gates, count_objects, count_sectors, count_ships, count_stations, count_highways, count_zones
  • find_cluster, find_object_component, find_object, find_sector, find_ship, find_ship_by_true_owner, find_station, find_station_by_true_owner, find_gate, find_highway_entry_gate, find_highway_exit_gate, find_highway, find_zone
Station Construction Enhancements
  • add_build_to_expand_station: Added stage element to specify construction sequence stage index
  • create_station: Added stage element and originalproduct attribute
Resource-Related Enhancements
  • find_closest_resource: Added minrating attribute and resourcearea result value
  • find_resource: Added minrating attribute, resourcearea result value, and various other result attributes (useundiscovered, ignoredangerousregions, wares, zone, sector, position)
  • deplete_yield: Added resourcearea attribute
Docking Enhancements
  • request_docking: Added showroom attribute to allow using showroom docks
  • find_closest_dockingbay: Added showroom attribute
  • match_dock: Added walkable, locked, and showroom attributes
Order/Trading Enhancements
  • create_order: Added priority attribute for priority orders
  • add_tradeware and remove_tradeware: Now support single ware or list of wares
  • set_trade_restrictions: Added transmute attribute for resource transmutation restrictions
Combat Enhancements
  • apply_attackstrength: Added shielddisruption attribute
  • get_attackstrength: Added shielddisruption result attributes and enemycount attribute
Faction Queries
  • get_factions_by_relation and get_factions_by_tag: Added activeonly attribute to include only active factions
Construction Plans
  • get_construction_plan and get_station_definition: Added ware attribute for specification ware
  • get_god_station_construction_plan: Changed space attribute from required to optional
Sorting Enhancements
  • sort_group and sort_list: Added multiple new sorting options including sortbydistanceto, sortbygatedistancefrom, sortbygatedistanceto, and improved sortbyvalue functionality
Room/Dock Filters
  • find attribute group: Added locked attribute for rooms/datavaults/signalleaks, hasfixedconstruction and hasstagedconstruction attributes
Influence System
  • apply_influencelist: Added allowstop attribute and made object attribute required
Type Changes
  • Multiple space attributes changed type from spacelist to support the new filtering
  • find_ship_by_true_owner and find_station_by_true_owner: Changed space attribute type to spacelistnozone
  • Various ware-related attributes now support expressions instead of single values
Documentation Updates
Multiple commands received updated or clarified documentation for existing attributes.

Changes in md.xsd (Version 8.00 HF3 → 9.00 B01)

Added Simple Types
  • loadingscreenmodelookup: Loading screen mode for next module change
    • normal: Standard loading screen
    • timelines: Timeline loading screen
    • timelines_reverse: Reverse timeline loading screen
Enhanced Mission Details

Mission Attributes
  • missiondetails attribute group:
    • Added onlinemissiongamestart attribute: Online mission Gamestart ID string (used by Personal Ventures)
    • Added scaneffect attribute: Optional effect definition (from libraries/effects.xml) to be used for the set long range scan target (has no effect if scantarget is not set)
Briefing Interaction
  • button element in briefing interaction:
    • Documentation updated: "Custom briefing button to signal the mission cue upon click"
    • Added remove attribute: Remove the defined briefing interaction button (only valid when updating an existing briefing interaction, defaults to false)
    • Changed text attribute: Now optional (was required), defines briefing interaction button text
Enhanced Existing Commands

Game Control Commands
  • quit_to_game: Added loadingscreen attribute to specify loading screen mode (defaults to normal)
  • quit_to_load_latest_save: Added loadingscreen attribute to specify loading screen mode (defaults to normal)
Mission Commands
  • accept_offer: Documentation updated to clarify it "creates the accept event for the mission offer cue which is waiting for 'event_offer_accepted'"
Added Action Commands
  • register_online_reward_trigger: To be used in personal ventures only. Registers a reward trigger on the online server which will be evaluated on reward calculation once the venture has been completed
    • trigger attribute (required): Name of the reward trigger
    • Should be performed before the mission is completed, and not more than once per trigger
Multiply entropy by absolute zero

Freedom in space
Malchar
Posts: 400
Joined: Wed, 7. Apr 21, 00:56
x4

Re: 9.0 Beta modding information

Post by Malchar »

A liitle question with collision and model.
Are V9 models compatible with the V8 game.

To be clear ; if I released a ship model for the V8 and update it for the V9, will it run fine for peoples still using the v8, or will we have to upload two differents versions ?
Shuulo (EGO)
EGOSOFT
EGOSOFT
Posts: 33
Joined: Fri, 1. Apr 22, 17:56

Re: 9.0 Beta modding information

Post by Shuulo (EGO) »

Malchar wrote: Sat, 14. Mar 26, 10:53 A liitle question with collision and model.
Are V9 models compatible with the V8 game.

To be clear ; if I released a ship model for the V8 and update it for the V9, will it run fine for peoples still using the v8, or will we have to upload two differents versions ?
No, if model was exported with new tools, it will crash old game version.
Please use mod versioning (info in forst post) to have different models for different game versions
Realspace
Posts: 1834
Joined: Wed, 15. Nov 06, 10:21
x4

Re: 9.0 Beta modding information

Post by Realspace »

Are new mesh models for ships only? Specifically, will I have to redo/convert planets and background boxes too?
Thanks

btw, interesting new functions!
apply_influencelist is cool, means we can finally apply influences dynamically (e.g. only on visible ships and remove when out of sight)?
So that the save is not bloated with <influences> :mrgreen:
TAOIT
Posts: 92
Joined: Sat, 13. Feb 10, 15:30
x4

Re: 9.0 Beta modding information

Post by TAOIT »

Lc4Hunter wrote: Wed, 11. Mar 26, 19:02 You only need to reexport your models and convert them with the new XUConverter that you get with the new modding tools which you can download from the bonus content area.
You DONT have to recreate the collisions. Just export it again and use the new converter.

You also run both exporters in parallel. Just install the exporter at a different location but point at the same directories you already use for data and assets.
Make a copy of the converter shortcut you already have, give it a fitting name (like P1 Converter LOCAL 9.0) and change the linked exe the new one ( for example "C:\Program Files\EGOSOFT\Egosoft Blender Mod Tools 9.0\Converter\XUConverter.exe" "D:\Proggis\X4_Modding\X4-Egososoft-Blender-Converter\p1[assets]" "D:\Proggis\X4_Modding\X4-Egososoft-Blender-Converter\p1[data]").

In case you want export something for 9.0 upwards, start the new one. In case you want to convert something for smaller then 9.0, use the old one.
I could already verify this works fine :)
Hi, I followed the whole procedure, that is, I created a .dae with xrconverter of one of my ships that doesn't exist in x4 and then I ran xuconverter on the .dae, the problem is that the .dae file is copied into the p1data folder and the .data folder is recreated with files completely different from the original, so no xml file. When I replace the .data files in the game using the old xml of the ship, it doesn't crash but "creates" a ship without a hull with only the secondary components. What's going on? I hope I was clear, I'm translating with Google, thanks.
User avatar
ChemODun
Posts: 598
Joined: Mon, 12. Feb 07, 21:58
x4

Re: 9.0 Beta modding information

Post by ChemODun »

Try to ask on Discord channel - x4_modding
Multiply entropy by absolute zero

Freedom in space

Return to “X4: Foundations - Scripts and Modding”