Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Breaking Changes

TypeVersionSummary

3.00

Scripts3.0 Beta 5Changes to $dockingbay.todockpos and $dockingbay.launchpos
Before the change, positions are relative to $dockingbay.parent.
After the change, positions are relative to $dockingbay as specified in the documentation.
Global3.0 Beta 2Support for entity flag "skillsvisible" dropped
Entity skills are always visible; that flag was a leftover from XR. We removed support for the script property .skillsvisible, the attribute "skillsvisible" of <set_entity_traits> and <set_npc_template_traits>, and the parameter "skillsvisible" of Lua function GetComponentData().
Scripts3.0 Beta 5Changes to $dockingbay.todockpos and $dockingbay.launchpos
Before the change, positions are relative to $dockingbay.parent.
After the change, positions are relative to $dockingbay as specified in the documentation.
Scripts3.0 Beta 2Changes to <event_object_changed_owner> and added <event_object_changed_true_owner>.
Before 3.0 Beta 2 there was just a single <event_object_changed_owner> condition. This condition was triggered in multiple cases when an owner change occurred. However, the exact cases were inconsistent and also the event could have been triggered w/o an effective owner change having been applied.
3.0 Beta 2 fixes these inconsistencies and ensures that the event is only fired, if the "effective" component owner of the object changed. To handle cases where the script actually needs to be informed if the "true" owner of a component was changed (i.e. not taking the cover faction into account) a new <event_object_changed_true_owner> was introduced.
If in your scripts you make use of the <event_object_changed_owner> condition you need to verify that you indeed want to work with the "effective" component owner or whether your script code actually should work with the true owner of an object and update your code accordingly.
On top of that the 3rd parameter of <event_object_changed_owner> (trueprevious) was dropped as the event is no longer triggered upon a change of the true owner alone (i.e. only if the change of the true owner has also an effect on the "effective" component owner).
Global3.0 Beta 1MissionBoard support dropped
MissionBoards was a dummy asset type which was only used during early development and never meant to be shipped in the released version. If any mod tried to make use of this asset type, undefined behaviour would occur. Therefore we cleaned things up in 3.0 Beta 1 including deprecating/removing any related UI/script function.
Job/God3.0 Beta 1By default, job/god entries now only spawn objects in space added by the extension in which they are defined
To better support extensions which add to the base game map, a job/god entry now defaults to only spawning objects in areas of the map that are added by the extension in which that entry is defined. You can override this behaviour by adding a matchextension="false" attribute to the job/god entry definition. This allows the entry to spawn objects anywhere that matches the entry's other criteria.
Scripts3.0 Beta 1Script action <add_actor_to_room/> attribute 'room' renamed to 'object'
Due to engine changes, script action <add_actor_to_room/> has had the attribute 'room' changed to 'object', which is more accurate. Most likely requires a 'position' if a slot is not provided.
Scripts3.0 Beta 1Script action <set_doors_locked/> attribute 'group' changed
The 'group' attribute of <set_doors_locked/> can no longer be a list. It must be a single tag value. Previously, a list containing one tag was accepted, which was redundant.
Scripts3.0 Beta 1Script conditions <event_hack_*/> and <event_controlpanel_hack_*/> removed
These events were never triggered, with the exception of <event_hack_started/> on the player entity for instant control panel hacks. Use <event_player_hacked_object> instead.
Scripts3.0 Beta 1Script actions <set_hack_target/> and <abort_hack/> removed
These actions had no effect and were removed.
Scripts3.0 Beta 1<setup_conversation_minigame/> script action removed
The script action was a leftover from the XR era and was never supported in X4 and couldn't be used in a meaningful way. It was therefore decided to better drop it altogether as it's not expected having been used by any mods.
Scripts3.0 Beta 1<add_player_choice_*> confidence attribute removed
The default confidence of player options is another leftover from the XR era and had no effect in X4.
Scripts3.0 Beta 1<hack_via_control_panel/> script action removed
Unused script action <hack_via_control_panel/> was removed.
UI core3.0 Beta 1Lua: GetMiniGameCursorPosition() removed
GetMiniGameCursorPosition() was a left over from the XR era and never supposed to be shipped with X4. The function practically always returned 0 and hence we don't expect the removal of this obsolete function causing any actual mod to break.
UI core3.0 Beta 1FFI: GetLocalizedInteractiveNotificationKey can return icon placeholders
In 3.0 Beta 1 we added support to display icons for keyboard bindings, if an icon is available for the specified keys. This results in GetLocalizedInteractiveNotificationKey() potentially returning a different text now if such an icon is assigned to the mapped key/button.
UI extensions3.0 Beta 1FFI: UIWeaponMod returned by GetInstalledWeaponMod() now includes property SurfaceElementFactor
In 3.0 Beta 1 we added support for a new weapon mod property "SurfaceElementFactor" to allow weapons to deal increased damage to surface elements such as Shield Generators, Turrets or Engines.
Scripts3.0 Beta 1$ware.illegal updated
$ware.illegal used to return true if the specified ware has the 'illegal' tag which is no longer used.
It now returns true if $ware is illegal to any faction in the game.
Scripts3.0 Beta 1MD script RML_Flight_Along_Path removed
The MD script RML_Flight_Along_Path was not referened and was removed.
Scripts3.0 Beta 1parameters of <event_venture_mission_completed/> changed
old params: param = venture details, param2 = ships involved, param3 = duration
new params: param = venture detail list: [mission name, mission type], param2 = list of ships involved, param3 = duration
Scripts3.0 Beta 1

<set_object_wing_name/> removed,
<set_object_fleet_name/> added

The common action <set_object_wing_name/> has been replaced with <set_object_fleet_name/>
Scripts3.0 Beta 1

$controllable.wing.* removed,
$controllable.fleet.* added

$controllable.wing.name, $controllable.wing.iscommander, and $controllable.wing.commander have been replaced with $controllable.fleet.name, $controllable.fleet.iscommander, and $controllable.fleet.commander

2.60

Scripts2.60 Beta 1'checkoperational' filter behaviour changed

Actions and conditions which use the 'checkoperational' filter now behave differently. Instead of changing how 'class' and 'exactclass' behave, checkoperational == true adds an additional filter for the components being of state operational, equivalent to state="componentstate.operational". This is implicitly enabled in action elements (e.g. <find_.../>) or condition elements (e.g. <count_...>), meaning that find_ship will only find operational ships. Using such actions/conditions with checkoperational="false" will include non-operational components such as wrecked and constructions. Existing uses may find that results now exclude non-operational components.

Sub nodes such as match_child will have checkoperational default to false. Existing uses may find that results now include non-operational components.

Scripts2.60 Beta 1$container.supplyresources behavior changed

The script keyword $container.supplyresources now includes reserved wares.

2.20

UI core2.20 Beta 3/4Lua: GetControllerInfo() returned mouseSteering/mouseCursor values are undefined.

2.20 Beta 3 introduced the new direct mouse steering mode. The mode was however not integrated as a first level mode and hence GetControllerInfo() returned the "gamepad" mode while direct mouse steering was active.
In 2.20 Beta 4 we improved the situation slightly so that a call to GetControllerInfo() will return either "mouseCursor" or "mouseSteering" in any of the 3 mouse modes.

It's a pending change to ensure that the returned mode is more reasonable in an upcoming patch. So be aware that another breaking change might be introduced at some point.

Scripts2.20 Beta 3Attribute for build related conditions e.g. <event_build_finished/> renamed from 'buildmodule' to 'buildprocessor'
The underlying behaviour remains the same in that it involves the buildprocessor, not the buildmodule. The attribute name has simply been corrected.

2.00

Scripts2.00 Beta 1<event_build_finished/> param2 now returns null instead of a construction sequence
The construction sequence which was finished should now be accessed via the buildtask provided via param3.
Scripts2.00 Beta 1param.boarding.{...} strength parameters removed
The 'recruitstrength', 'veteranstrength' and 'elitestrength' script parameters were no longer required for balancing the boarding gameplay, and were removed.
Scripts2.00 Beta 1$defensible.boardee/$defensible.boarder and <set_object_boarder/>/<remove_object_boarder/> removed
Due to changes to boarding in X4, the boarding connections accessed by these script properties and actions became redundent and thus, removed. Any connections set by these actions in a savegame will not survive loading.
UI extensions2.00 Beta 1FFI: GetUpgradeSlotCurrentComponent()/GetUpgradeSlotGroup() works on non-operationals
Before 2.0 Beta 1 using GetUpgradeSlotCurrentComponent() or GetUpgradeSlotGroup() only performed on operational objects (i.e. not wrecked objects or objects under construction). Since this is inconsistent with the rest of the UI functions, this was considered a bug and fixed in 2.0 Beta 1. If you require the old behavior, use the FFI function: IsComponentOperational() to check the passed object's state before making the call.
UI extensions2.00 Beta 1FFI: SetFormationShape() no longer indicates an error upon certain error cases

Before 2.0 Beta 1 a call to SetFormationShape() indicated an error state to the caller in certain cases where setting a formation shape (potentially) failed. Due to a design flaw in the handling of formations, this however doesn't do any good, since the function by itself doesn't really set the formation shape in all cases. On top of that the call can fail at random. Hence, at the moment an indication of an error case that setting a formation potentially fails is no good to the caller and he has no means to distinguish that case from a real error case.
Therefore, in 2.0 Beta 1 we drop the error indication in case of an attempt to set the formation fails. We are currently working on a better solution to the underlying problem and hope to have it ready as part of a following beta.

Scripts2.00 Beta 1<create_formation/> now requires the attributes: 'leader' and 'follower'. Attribute 'object' is now deprecated.
This now enforces a leader and at least one follower in order to create or change a formation.  Former implementation made it possible to create formations without any followers which led to issues.
Scripts2.00 Beta 1<event_player_changed_target/> now fires and returns null if the player deselects a target.
For prior behavior, check for event.param being non-null.
AI Scripts2.00 Beta 1

<shoot/>/<shoot_at/> attribute changes.

Changed: Attribute "primary" is now optional and defines whether weapons from the ship's active primary weapon group will be fired. Defaults to true.
New attribute: "secondary" is an optional attribute that defines whether weapons from the ship's active secondary weapon group will be fired. Defaults to true.
New attribute: "missiles" is an optional attribute that defines whether only missile launchers will be used. If false, only guns will be fired. Defaults to false.

Corrects now-obsolete assumption that primary weapon groups only contain guns and secondary weapon groups only contain missile launchers.

UI extensions2.00 Beta 1FFI: GetBuildTask()/GetNumBuildTasks() got a new "buildmoduleid" parameter. 
Added possibility to query build tasks of a certain buildmodule.
UI extensions2.00 Beta 1Lua: GetLibraryEntry() retrieved a new "buildresources" field.
Added list of resources a buildmodule needs to build.
UI extensions2.00 Beta 1Lua: CalculateTotalHullFraction() was removed. 
Unused, derelict function from XR - use GetComponentData(..., "hullpercent") instead.
UI extensions2.00 Beta 1FFI: RequestDockAtReason()/UndockPlayerShip() changed their return values. 
Changed return value type to const char* to better identify failure reasons in Lua script.

1.50

UI extensions1.50 Beta 3Lua: GetComponentData() changed behavior of "docksizes" propertly. 
The "docksizes" property no longer includes internal ship storage docks.
All1.50 Beta 2Meaning of "Shipyard" was corrected throughout Lua/MD/AI scripts, so that Wharfs are not Shipyards (unlike in XR).

Shipyards (formerly also known as Capital Shipyards) can build capital ships, while Wharfs only build non-capital ships. To check whether a station is a Shipyard or a Wharf, check whether the station "can build ships".

Lua: Adjusted GetComponentData() and HasShipyard(), added HasWharf()
Lua / GetComponentData() properties: Removed "iscapitalshipyard", fixed "isshipyard", added "canbuildships", "iswharf", "isequipmentdock"
Scripts: Fixed property .isshipyard, added .iswharf (.canbuildships existed already)

UI extensions1.50 Beta 2FFI: UpgradeGroupInfo datatype was changed. 
Added new "operational" field to retrieve information about number of operational upgrades in a group.
UI extensions1.50 Beta 1FFI: SetGuidance() removed useinfopoint argument.

In X Rebirth "info points" existed (which were mainly used as interaction points to scan stations/access information about modules). These were removed in X4 but this left-over property here was missed to be removed in-time for release. It was therefore removed now in order to move towards a stable/clean UI API.

The new function declaration is: void SetGuidance(UniverseID componentid, UIPosRot offset)

UI extensions1.50 Beta 1FFI: CancelConstruction() changed its return value. 
CancelConstruction() now returns if the cancellation was successful. 

1.32

UI extensions1.32Lua: GetComponentData() removed the "nextdestname" property.
Instead of "nextdestname", use the properties "destination" or "destinationsector" to retrieve a destination component, then retrieve its "name" property.

1.20

UI extensions1.20FFI: GetAAOption() got a new "useconfig" parameter. 
The AA setting was changed to check the new setting with the user. In order to restore the old setting GetAAOption() gets the option to retrieve the config settings.