[Discussion] Generic X3TC S&M questions III

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

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

Post Reply
User avatar
Hairless-Ape
Posts: 316
Joined: Wed, 6. Nov 02, 20:31
xr

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

Post by Hairless-Ape » Sun, 11. Aug 19, 15:38

The script is viewtopic.php?t=383317 by Sebbi08.
It is composed of 2 xml files, both in the /addon/scripts folder.
I think it replaces the normal Mayhem's Cmd.SatellitesMonitoring.Reap.Go command.

When I put them in there, the game seemed to pick them up fine. However, if I make even a simple version number change and reload a saved game, the script editor in-game still thinks it's at V1. If I use the in-game script editor, it does change it properly, and I find the game modifies the actual XML file when I quit. It just doesn't seem to pick up any changes I might make outside the game. I'm doing something wrong. Thanks for the help.

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

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

Post by X2-Illuminatus » Sun, 11. Aug 19, 15:57

How do you do these changes "outside the game"?

MSCI xml script files (in comparison to MD files) are not designed to be edited in anything but the in-game or a dedicated external Script Editor (like the one from mr.bear). The somewhat readable part at the top of a script file (if you open it in a plain xml or text editor) is just the text meant for the browser view of the script - doubleclicking on a script file in the "scripts" folder or any other folder where the x2script.xsl is present, opens the browser with a readable view of the script code. The actual code, however, is placed between the codearray-tags.
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!

User avatar
Hairless-Ape
Posts: 316
Joined: Wed, 6. Nov 02, 20:31
xr

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

Post by Hairless-Ape » Sun, 11. Aug 19, 22:09

The dedicated external script editor does present a nice Code editing window, devoid of any of the XML Tags present in the raw XML file, but the XML file itself is text and you can open it with a text editor and edit the lines between the codearray-tags as you say. It's just difficult. I did open the XML file in Visual studio AS a binary file to ensure there was no hidden binary information in the file, and sure enough, it's just plain XML text all the way through.

I edited the XML file with Notepad++, and yes, it was painful to look at..

My problem with X-Studio 1.8 at present, is that it doesn't seem to recognize all the commands in this script.
I.E. a call to "display info box: ...." shows up in the X-Studio window as "<Unrecognised Command>". There are several others that it doesn't recognize.
I used the XRCatTool to extract all the cat files to a new folder, but not quite sure how to reference it from within the editor. In X4, it has an "/md/md.xsd" file you can reference in an editor, but I don't see this for X3. The x2script.xsl is just for formatting xml in a readable way, and not for resolving library methods/functions.. at least not that I know of.

I'm fairly certain I changed a benign part of the script using Notepad++ and doing a file compare, I can see only that one simple change and the changed version number.. But it won't load it up the revised script when I load up X3. I'm mainly concerned about the mechanics of why it isn't reloading my script and what I need to do to force it to reload it.. The editor issue is one I would love to solve, but I don't actually think that will change the re-loading issue I'm having.

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

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

Post by Cycrow » Mon, 12. Aug 19, 11:12

For the version number, you must change it in both parts of the file. Its near the top in the readable part, and in the codearray.

The actual script itself needs to be changed in the codearray.

As for the unrecognized commands, these were new commands that have been added since X-Studio, you can add custom commands like the new missing ones. I seem to remember someone posting a file with these in

Crackajacka87
Posts: 9
Joined: Sat, 22. Jun 19, 14:50
x3ap

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

Post by Crackajacka87 » Sat, 24. Aug 19, 11:39

So I'm a complete noob here but I'm trying to look into ways to set races to actually invade other races and conquer sectors but looking through other scripts that has this feature initiated in I cant seem to find any script that shows how it is done or activated... Now I'm not going to directly copy these scripts as they were meant to work for their version of the game but to take inspiration and understanding of how to implement something familiar myself.

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

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

Post by Joubarbe » Sun, 25. Aug 19, 20:41

Uhhh, you know that's a big feature right? You don't write that in two lines of code... To make everything believable and gameplay-wise interesting will take dozens of scripts (Mayhem has 500). Why don't you download a script that does it for you?

Crackajacka87
Posts: 9
Joined: Sat, 22. Jun 19, 14:50
x3ap

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

Post by Crackajacka87 » Mon, 26. Aug 19, 18:00

Because of compatibility issues... I was hoping to add in a script or 2 with just the invasion mechanic but if it's too much for a beginner then maybe I should give up and chew down something a little more easier than jumping straight into the deep end lol

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

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

Post by Joubarbe » Mon, 26. Aug 19, 18:45

STO is propably the most known script on that subject. But it's only about you, as a player, taking over sectors.
I've started Mayhem 4 years ago with about the same project as you. "Just an invasion script" :)

If you have specific questions don't hesitate to create new threads. I think the easier way to make a generic invasion script would be to take existing ships (Military ones for instance) and make them go to a random sector and destroy all stations. But then you would have to rebuild everything in some way.

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

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

Post by Xaritscin » Sat, 12. Sep 20, 16:35

im considering to start modding my game or at least meddle around with the mod i downloaded to see if i can fix/add more stuff to it. but i have some questions:

1. what is the most up to date tool for modding X3? (including AP)

2. the mod i use has its files on the TC folder, so AP uses it as a base when loading but of course certain features are out like the Stock Exchange or the ships added in that expansion. if i were to re-enable that content i would have to edit the mod files in order to port them to the AP folder?

3. is it possible to mod the game to add extra stats to ships? i was considering making a mod that adds Armor as a possible third stat the same way Shield is added (bought as a ware, shows on the tooltip and does stuff).

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

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

Post by X2-Illuminatus » Sun, 13. Sep 20, 14:14

1. It depends on what you mean with modding:
  • If it's just installing scripts & mods, then the Plugin Manager.
  • If it's actually changing game files, then the X3 Editor 2 for extraction, repacking and editing of types and similar game files. Notepad++ for simple edits of txt and xml files is also worth installing.
  • For changing or creating ship / station models you will need a dedicated 3d model program like 3dsmax or Gmax.
  • For scripting (MSCI), next to the ingame script editor, there's an external script editor, X-Studio, by mrbear. For writing Mission Director scripts any xml editor which can read the director schemas will do.
2. If you're modding X3AP, you should always start with a clean X3TC installation as a base for X3AP. If you want to use an X3TC mod in X3AP, then you will have to adjust its files accordingly. That is unless X3AP already uses those files from X3TC.

3. I don't think so.
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 » 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: 22201
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: 24950
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: 22201
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.

Post Reply

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