[Discussion] Generic X3TC S&M questions III

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
Xaritscin
Posts: 7
Joined: Fri, 11. Sep 20, 03:19

Re: [Discussion] Generic X3TC S&M questions III

Post by Xaritscin » Mon, 14. Sep 20, 04:35

i see, well in this case im trying to find a way to port Xtended to Albion Prelude, as in, moving all the Cats, folders and scripts into the Addon folder rather than modifying the root folder. already learned how to extract the Cats, use X3 Editor and X Studio but im getting a bit lost on how the modding structure operates:

1. regarding Fake Patching:

does the game have a way to figure out which files replace others in the hierarchy? for example i have 3 Cats i have renamed to Cat 5, 6 and 7; Cat 6 has a "types" folder which containes all the pack files with the vital changes like ships, weapons, shields, bullets, etc... at the same time Cat 7 also has a "types" folder but it only contains a few of the same files (with different changes i suppose). if i understand this right the last Cat is considered the uppermost in the hierarchy so, does the game understand that only those files inside Cat 7 types override the ones in Cat 6 or how does it work?

2. regarding TShips:

i organized a list on notepad to catalogue the entities on TShips for vanilla AP and the mods im going to merge based on name and ID. editing the contents seem to be relatively easy on X3 Editor but when looking directly to the file using text editor it seems there's no apparent organization to the code lines. for example i was reading the top part which is supposed to be all the registered entities under Argon but right after the TS variations im seeing stuff like Drones in the lines. is there a tool for visualizing the content of that file and actually add more lines to it at the same time?

and also, does TShips affect the navigation controls of the entities? when reading the Xtended mod thread someone reported a ship was bugging out on terms of navigation (ship rolled when ordered to turn), i want to fix stuff like that too but dont know where to look at it

3. regarding Custom Weapon Compatibility:

i looked for some tutorials about making new weapons and i kind of get it but im left wondering something, for those cases when a mod adds new weapons is there an additional file that has to be changed for ships to use it? for example Xtended added several weapons to flesh out racial weapon doctrines and they probably edited both the TC and the mod specific ships so they can use the weaponry. if i were to port the mod to Albion Prelude in order to enable the AP ships along with adding stuff from Cadius Xtra Ships Pack i would have to edit additional files related to those ships so they can use the new weaponry? (this pertains both to main weapons, turrets and missiles)

4. regarding the launcher:

i noticed mods can edit stuff in the launcher, where can i edit that? like showing the name of my mod or fixing errors on the launcher text after installing a mod

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22197
Joined: Sun, 14. Nov 04, 23:26
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by Cycrow » Mon, 14. Sep 20, 13:56

Xaritscin wrote:
Mon, 14. Sep 20, 04:35
1. regarding Fake Patching:

does the game have a way to figure out which files replace others in the hierarchy? for example i have 3 Cats i have renamed to Cat 5, 6 and 7; Cat 6 has a "types" folder which containes all the pack files with the vital changes like ships, weapons, shields, bullets, etc... at the same time Cat 7 also has a "types" folder but it only contains a few of the same files (with different changes i suppose). if i understand this right the last Cat is considered the uppermost in the hierarchy so, does the game understand that only those files inside Cat 7 types override the ones in Cat 6 or how does it work?
The game will load each file from the latest cat file. So if you have file1 and file2 in 6, and file2 in 7, then it will load file1 from 6 and file2 from 7.
Effectically any files in the later cat files will overright those in the previous, but they only need to contain the files that have changed, not all of them.

Xaritscin wrote:
Mon, 14. Sep 20, 04:35
2. regarding TShips:

i organized a list on notepad to catalogue the entities on TShips for vanilla AP and the mods im going to merge based on name and ID. editing the contents seem to be relatively easy on X3 Editor but when looking directly to the file using text editor it seems there's no apparent organization to the code lines. for example i was reading the top part which is supposed to be all the registered entities under Argon but right after the TS variations im seeing stuff like Drones in the lines. is there a tool for visualizing the content of that file and actually add more lines to it at the same time?
The tool to add lines is also the X3 Editor, that will read the TShips file, display its contents and allow you to make changing, including adding new entries.
if you want to copy entries from one file to another, then this gets abit more complicated. Generally you want to add any entries at the end of the file.
The file isn't organised by race, new ships are always added at the end of the file, so the order is simply based on when they were added.
The game references the ships in the fiel based on their position, so any scripts that directly reference ships will no longer work correctly if you add those ships in a different place.
Xaritscin wrote:
Mon, 14. Sep 20, 04:35
and also, does TShips affect the navigation controls of the entities? when reading the Xtended mod thread someone reported a ship was bugging out on terms of navigation (ship rolled when ordered to turn), i want to fix stuff like that too but dont know where to look at it
TShips does specify things like speed, turning speed, etc. Which can effect the movement. But the actual ship movement is not connected to TShips.
Xaritscin wrote:
Mon, 14. Sep 20, 04:35
3. regarding Custom Weapon Compatibility:

i looked for some tutorials about making new weapons and i kind of get it but im left wondering something, for those cases when a mod adds new weapons is there an additional file that has to be changed for ships to use it? for example Xtended added several weapons to flesh out racial weapon doctrines and they probably edited both the TC and the mod specific ships so they can use the weaponry. if i were to port the mod to Albion Prelude in order to enable the AP ships along with adding stuff from Cadius Xtra Ships Pack i would have to edit additional files related to those ships so they can use the new weaponry? (this pertains both to main weapons, turrets and missiles)
The ship comparability is in 2 separate files, TShips for the main guns, and TCockpits for each of the turrets. This is based on a bitmask of the weapons. So you can only have 32 individual weapon groups, but any number of weapons can be added per group. Comparability is done per group
Xaritscin wrote:
Mon, 14. Sep 20, 04:35
4. regarding the launcher:

i noticed mods can edit stuff in the launcher, where can i edit that? like showing the name of my mod or fixing errors on the launcher text after installing a mod
all the text in the game, including the launcher is read from the text files, mainly 0001 and the launcher from 0002. Editing the launcher one will allow you to change all the text

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by X2-Illuminatus » Mon, 14. Sep 20, 21:18

Xaritscin wrote:
Mon, 14. Sep 20, 04:35
i see, well in this case im trying to find a way to port Xtended to Albion Prelude
There is already an experimental X3AP version for the X-Tended mod, see the post by Killjaeden here.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Xaritscin
Posts: 7
Joined: Fri, 11. Sep 20, 03:19

Re: [Discussion] Generic X3TC S&M questions III

Post by Xaritscin » Tue, 15. Sep 20, 04:03

X2-Illuminatus wrote:
Mon, 14. Sep 20, 21:18
Xaritscin wrote:
Mon, 14. Sep 20, 04:35
i see, well in this case im trying to find a way to port Xtended to Albion Prelude
There is already an experimental X3AP version for the X-Tended mod, see the post by Killjaeden here.
i know, i tried the mod first, but that was a prototype and no one is working on the mod anymore AFAIK. i want to make a fork of it that works directly on Albion Prelude instead of requiring to edit the TC folder. im also planning on expanding beyond just porting it but need to get this done first

terodil
Posts: 149
Joined: Sat, 12. Aug 17, 22:13
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by terodil » Tue, 15. Dec 20, 23:28

Hi! I have a little question regarding the X3 script garbage collector. Is there anything I need to consider when working with (nested) arrays? In my current script I have quite a few of them and I don't want to risk savegame bloat with multiple invocations of the same script. So...

1. is a script finishing enough to clean up all the memory it claimed for variables/arrays?
2. reassigning pointers to arrays ($array = [0, 1, 2, 3]; ... ; $array = [5, 6, 7]): does the old array end up in the garbage bin, or is it doomed to forever wander the astral plane?
3. do I need to/can I push it there with assignments like $array = null?
3. do I (additionally?) need to resize arrays to 0 to be sure everything is gone?
4. how does the above translate into a situation with nested arrays? Do I need to walk through every 'level' before removing the higher one, or is simply removing the top sufficient?
5. anything else?

Thanks a lot,
T.
My X3 mods: Ship Autoclaimer - Ship Services - Friendlier War Sectors - in development: Logistics Centre

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22197
Joined: Sun, 14. Nov 04, 23:26
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by Cycrow » Wed, 16. Dec 20, 11:28

terodil wrote:
Tue, 15. Dec 20, 23:28
Hi! I have a little question regarding the X3 script garbage collector. Is there anything I need to consider when working with (nested) arrays? In my current script I have quite a few of them and I don't want to risk savegame bloat with multiple invocations of the same script. So...

1. is a script finishing enough to clean up all the memory it claimed for variables/arrays?
Mostly yes, but bare in mind that if you pass arrays to other scripts and they hold onto them, they wont be cleared. Also if you assign them to local/global variables, they will also remain in memory until those variables are cleared
terodil wrote:
Tue, 15. Dec 20, 23:28
2. reassigning pointers to arrays ($array = [0, 1, 2, 3]; ... ; $array = [5, 6, 7]): does the old array end up in the garbage bin, or is it doomed to forever wander the astral plane?
As long as $array holds the only reference to that array, then when its reassigned to a new array, the old one will be cleared from memory
terodil wrote:
Tue, 15. Dec 20, 23:28
3. do I need to/can I push it there with assignments like $array = null?
you can do, but generally it wont make any difference
terodil wrote:
Tue, 15. Dec 20, 23:28
3. do I (additionally?) need to resize arrays to 0 to be sure everything is gone?
clearing the array can help in some cases, if your array also contains references to other array, it can help prevent cyclical references
if there are not cyclical references, then generally you wont need to
terodil wrote:
Tue, 15. Dec 20, 23:28
4. how does the above translate into a situation with nested arrays? Do I need to walk through every 'level' before removing the higher one, or is simply removing the top sufficient?
5. anything else?
same as above

terodil
Posts: 149
Joined: Sat, 12. Aug 17, 22:13
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by terodil » Wed, 16. Dec 20, 11:59

Thank you very much for your answers, Cycrow.

Coincidentally I just finished running a few tests on my own. After creating gigantic numbers of enormous nested arrays and leaving them dangling in space in various positions, I can confirm that none of them came back to bite me in the ..., however I cleaned them up (or didn't). That's a huge relief, I was getting a bit scared there for a second. :)
My X3 mods: Ship Autoclaimer - Ship Services - Friendlier War Sectors - in development: Logistics Centre

User avatar
JSDD
Posts: 1378
Joined: Fri, 21. Mar 14, 20:51
x3tc

Re: [Discussion] Generic X3TC S&M questions III

Post by JSDD » Tue, 9. Mar 21, 01:40

Question:

thats a scene-node of the heavy centaur ...

Code: Select all

P 6; B ships\animprops\m6radarspike1; N Bships\animprops\m6radarspike1; b  // idx 12
{ 0xa002;  -6141; 5255; -20521;  0.050000; 0.000000; 0.000000; 1.000000;  0.0;0.0;0.0;0.0;0.0;  3330; 1; } // 0
{ 0x8012;  0.498596; -0.308929; 0.951085; 0.000018;  0.0;0.0;0.0;0.0;0.0;  3332; 2; } // 1
{ 0x8012;  0.498596; -0.308929; 0.951085; 0.000018;  0.0;0.0;0.0;0.0;0.0;  -1; -1; } // 2
do all the 3 lines in brackets take effect? i suppose, only the last line ...

Code: Select all

{ 0x8012;  0.498596; -0.308929; 0.951085; 0.000018;  0.0;0.0;0.0;0.0;0.0;  -1; -1; } // 2
... takes effect or "overrides" the other 2 lines before, am i right. does anyone know something more about them ?? maybe animation infos??

i know that the 2nd 3rd and 4th floating-point number are the position and the next 4 number are the orientation/rotation ...

thanks for any suggestions/answers in advance!!
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.


Mission Director Beispiele

Xaritscin
Posts: 7
Joined: Fri, 11. Sep 20, 03:19

Re: [Discussion] Generic X3TC S&M questions III

Post by Xaritscin » Fri, 2. Apr 21, 07:36

been out of the loop for a while due to RL stuff and im getting the itch to mess out with X3 again, however, it seems the initial plans i had for my modded game are unfeasible. so i'd like to ask, what would be the best starting point for someone looking to make an overhaul/conversion mod? or to be more clear about my goals:

i want to make a mod for AP that improves/rebalances the base mechanics in the game like the economy, NPC generation, etc. to create a much better simulation gameplay. i dont want to make a Tycoon/4X in the lines or LU/Mayhem, just add some more realism to the way the base game handles certain things while also opening new space for the player to be part of the simulation, including new ways to obtain the ships and new ways to build up your corporation. all this is in a completely new and expanded map, in a manner similar to XTended.

Vheissu
Posts: 105
Joined: Wed, 15. Apr 20, 17:35
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by Vheissu » Thu, 15. Apr 21, 12:20

Hi, 3 questions!

I'm experimenting with respawn timers in X3 Editor and am trying to figure out how the respawn timer variable works. I see the number scales in a logical way (2 or 3 digits for Xenon and **** fighters in their home territory, 4 digits for TS, high number for capital ships), but what does it equate to? In-game hours? If I add 1000 to a respawn timer, how long is that?

The randomly placed pirate/xeno spawns all seem to have sector coordinates of -1,-1. They appear in seemingly random sectors though. What controls this?

Is there a wiki or other documentation for the job variables in X3 Editor? The Editor's help file is great for the basics, but it doesn't cover more specific details. The above questions are really hard to google, because "respawn timer" just returns a million results for spawn timers in World of Warcraft and Everquest :wink:

Thanks

Edit: Also, many, many thanks to whoever made the editor! The plain code .cat files are NOT easy to read hahaha.
Last edited by Vheissu on Thu, 15. Apr 21, 12:32, edited 2 times in total.

Vheissu
Posts: 105
Joined: Wed, 15. Apr 20, 17:35
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by Vheissu » Thu, 15. Apr 21, 12:25

Woops, doublepost

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11740
Joined: Fri, 21. May 04, 17:15
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by Ketraar » Thu, 15. Apr 21, 12:42

Vheissu wrote:
Thu, 15. Apr 21, 12:20
If I add 1000 to a respawn timer, how long is that?
Its seconds, so 3600 is one ingame hour.
Vheissu wrote:
Thu, 15. Apr 21, 12:20
The randomly placed pirate/xeno spawns all seem to have sector coordinates of -1,-1. They appear in seemingly random sectors though. What controls this?
no coordinates makes it random based on the sector flag(s) that are defined above, so owner's sector will spread the jobs only to sectors of that defined race, you can tick any flag to add more or less filters to that randomness. If you want them to spawn in a specific sector just replace it with coordinates.

MFG

Ketraar
Image

Vheissu
Posts: 105
Joined: Wed, 15. Apr 20, 17:35
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by Vheissu » Thu, 15. Apr 21, 12:49

Ketraar wrote:
Thu, 15. Apr 21, 12:42
Vheissu wrote:
Thu, 15. Apr 21, 12:20
If I add 1000 to a respawn timer, how long is that?
Its seconds, so 3600 is one ingame hour.
Vheissu wrote:
Thu, 15. Apr 21, 12:20
The randomly placed pirate/xeno spawns all seem to have sector coordinates of -1,-1. They appear in seemingly random sectors though. What controls this?
no coordinates makes it random based on the sector flag(s) that are defined above, so owner's sector will spread the jobs only to sectors of that defined race, you can tick any flag to add more or less filters to that randomness. If you want them to spawn in a specific sector just replace it with coordinates.

MFG

Ketraar
Awesome, thank you! That is a very user friendly way to control spawn coordinates.

User avatar
nponoBegHuk
Posts: 474
Joined: Thu, 6. Mar 08, 19:55
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by nponoBegHuk » Wed, 26. May 21, 14:20

Hi. This question is regarding X3: Terran conflict.

Is it possible for a script to obtain information on which plots are already completed or progress on the ones that are not yet completed? I assume mission director can do that but I would like for a script to also write plot progress to a file using "write to log file" command. Any ideas on how that can be done?
Fast sector selection on the Universe Map | Rock locations for Mobile/OOS mining | Botting for max speed Hyperion | Complete list of ship sources | Capturing smaller ships

My current ship collection:
11 out of 11 *retired* ships found
17 out of 17 *unique* ships found
9 out of 9 *limited* ships found
16 out of 16 *rare* ships found

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11740
Joined: Fri, 21. May 04, 17:15
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by Ketraar » Wed, 26. May 21, 14:41

Dont think its possible as its set up now. Even the MD passes on info between files to know which plots are done, I'm not aware of a way to have the SE read that without adjusting the Plot files. Adding something to the Plot files (especially the one that handles them) should be possible though.

An alternative way to do it would be to find something unique that ties in to the plots, so say at the end of a plot you are given a unique ship, that would be easy enough to track, the issue here would be to find something that is reliably unique for each.

MFG

Ketraar
Image

Mokunen
Posts: 31
Joined: Fri, 24. May 13, 01:42
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by Mokunen » Mon, 31. May 21, 20:33

I have a question regarding modding ettiquette:

I'm reworking (well, nearly a complete rewrite by now) "Capture Stations" by Nividium, originally just for personal use but it's come to the point where I feel it's actually polished enough that I could eventually publish it for the community to use. However, Nividium didn't specify any permissions in their mod's thread, and they also don't seem to be in the permission index thread. I don't think I can ask them directly either, as the date of their last login was nine years ago.

Should I assume that this means I should not publish anything that is derivative of Nividium's works?

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by X2-Illuminatus » Mon, 31. May 21, 22:07

I suggest you release your reworked / updated script, mention Nividium as the creator of the original script and link back to the original script topic.

Even if he hasn't been online in a while, best to also write him a PM about your updated version.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Mokunen
Posts: 31
Joined: Fri, 24. May 13, 01:42
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by Mokunen » Thu, 3. Jun 21, 03:29

X2-Illuminatus wrote:
Mon, 31. May 21, 22:07
I suggest you release your reworked / updated script, mention Nividium as the creator of the original script and link back to the original script topic.

Even if he hasn't been online in a while, best to also write him a PM about your updated version.
Thank you, I will do that!

Meanwhile I ran into some confusing behaviour while trying to make my main script be able to run both from a hotkey and an autopilot command. As a command, the script lets you choose (via sector map interface) the target station which is then passed as the single argument to the script, "target.station". I imagined that when running from a hotkey instead of a command, this argument would be null, and so I could catch that and make the script use the player's aim/target. Instead, it's getting a very specific value (1732) that doesn't seem to change regardless of what ship or sector I'm in, or what I'm targeting, or what is in my cargohold... where is this ghost argument value coming from?

Heusmann
Posts: 2
Joined: Sat, 13. Oct 18, 11:54

Re: [Discussion] Generic X3TC S&M questions III

Post by Heusmann » Sat, 5. Jun 21, 12:39

Hello, recently I have been messing around with changing wares and equipment sold in docks.
However, I've ran into a problem. I wanted to increase the capacity of Nividium in the NMMC HQ but I can't find where that information would be stored.

So, just to reiterate, I am asking how to change the capacity of NPC docks, not player owned stations.

Thanks in advance!

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Re: [Discussion] Generic X3TC S&M questions III

Post by X2-Illuminatus » Sat, 5. Jun 21, 15:34

There's no way to increase that size if you're playing X3TC afaik. In X3AP the addon\types\globals file should have a storage modifier for NPC docks. Use VFS of the X3 Editor 2 to get the latest version of that file.
Mokunen wrote:
Thu, 3. Jun 21, 03:29
Meanwhile I ran into some confusing behaviour while trying to make my main script be able to run both from a hotkey and an autopilot command. As a command, the script lets you choose (via sector map interface) the target station which is then passed as the single argument to the script, "target.station". I imagined that when running from a hotkey instead of a command, this argument would be null, and so I could catch that and make the script use the player's aim/target. Instead, it's getting a very specific value (1732) that doesn't seem to change regardless of what ship or sector I'm in, or what I'm targeting, or what is in my cargohold... where is this ghost argument value coming from?
If I had to guess, I would say it's an internal number representing the position of the hotkey in the control profiles file.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”