Hi there!
I'm totally new to X modding and I want to create mod that changes bombers attack scripts.
As I understood - it should be some standard flight behaviors for the ships that they use depending on situation.
To proceed I do really need to know the exact values of it. Could anyone help me to determine where is these behaviors are located?
I've already tried to seek through aiscripts/libraries/aiscripts.xsd/script_properties.
Thanks in advance!
[QUESTION] Change flight behaviors
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Re: [QUESTION] Change flight behaviors
That's all there is imho; check lines 73-102 (ish).
Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
Re: [QUESTION] Change flight behaviors
1. Extract the files required. If I remember, game data file 8 contains the game logic (Mission Director files, MD) and AI scripts.
2. Open one of the aiscripts and try to discern its logic. Aiscripts run sequentially down the file. Jumps are handled with “go to label”. Interrupt handlers (e.g. event object was attacked) stops the logic to execute the actions for that interrupt (e.g. fight or flee after was attacked event). When studying the files, ignore the patch nodes. They are version changes to the file - allowing updates to the files on the file without destroying the player’s game.
3. I recommend an IDE that pretty prints XML scripts. Eg. Allows collapse and expand of nodes.
4. Check docs for things that are unknown to you. These docs would be: aiscripts.xsd, common.xsd, scriptproperties.html. I open these as raw files. But they can be installed on a personal web server to view them properly.
5. If the XML script format confuses you, consider that it’s just syntax and not logic. You should be able to look through it (like with other languages) to see beyond the format. There are advantages in this format. The only disadvantage is that people complain about it. Programmers should be able to see past the syntax to the logic beyond.
6. Learn how to patch the xml files.
7. Downloading a mod to learn it to learn X4 modding cannot be overstated.
2. Open one of the aiscripts and try to discern its logic. Aiscripts run sequentially down the file. Jumps are handled with “go to label”. Interrupt handlers (e.g. event object was attacked) stops the logic to execute the actions for that interrupt (e.g. fight or flee after was attacked event). When studying the files, ignore the patch nodes. They are version changes to the file - allowing updates to the files on the file without destroying the player’s game.
3. I recommend an IDE that pretty prints XML scripts. Eg. Allows collapse and expand of nodes.
4. Check docs for things that are unknown to you. These docs would be: aiscripts.xsd, common.xsd, scriptproperties.html. I open these as raw files. But they can be installed on a personal web server to view them properly.
5. If the XML script format confuses you, consider that it’s just syntax and not logic. You should be able to look through it (like with other languages) to see beyond the format. There are advantages in this format. The only disadvantage is that people complain about it. Programmers should be able to see past the syntax to the logic beyond.
6. Learn how to patch the xml files.
7. Downloading a mod to learn it to learn X4 modding cannot be overstated.
Mods: RPG: Reputations and Professions, Social Standings and Citizenships, Crime has Consequences, Alternatives to Death. Missions/NPCs: Emergent Missions, NPC Reactions, Mod Parts Trader, High-sec Rooms are Locked, Hacking Outcomes, More Generic Missions, Waypoint Fields for Deployment. Others: Auto-cam, Friendly Fire Tweaks, Teleport From Transporter Room, Wear and Tear. QoL: Trade Analytics, Loot Mining, Ship Scanner, Signal Leak Hunter, Station Scanner, Surface Element Targeting, etc.
Re: [QUESTION] Change flight behaviors
Thank you, but it just enumeration. My question is about exact ai rules for each behavior.
As I investigated it may be stored directly in game engine.
Thanks a lot, kuertee, I've already use your mode as reference.
For now I'm trying to add another button to UI to make easier script calling. Like "Missile Attack" after "Coordinate Attack".
Re: [QUESTION] Change flight behaviors
Hardcoded indeed, no script would be fast enough to perform actions like dogfight.
Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786