[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
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!

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 » Sat, 5. Jun 21, 16:57

Mokunen wrote:
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?
The value is the ID of the Hotkey being called

you could either have a separate hotkey script that then calls your command script with either null, or the tracking aim.
or you could simply check the datatype of the value.
either

Code: Select all

if is datatype [ $target.station ] == DATATYPE_INT
  $target.station = get player tracking aim
end
or

Code: Select all

if not $target.station -> exists
  $target.station = get player tracking aim
end
Just remember, that the tracking aim can also be null if you have nothing targetted

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

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

Post by Mokunen » Sun, 6. Jun 21, 12:23

X2-Illuminatus wrote:
Sat, 5. Jun 21, 15:34
If I had to guess, I would say it's an internal number representing the position of the hotkey in the control profiles file.
Cycrow wrote:
Sat, 5. Jun 21, 16:57
The value is the ID of the Hotkey being called

you could either have a separate hotkey script that then calls your command script with either null, or the tracking aim.
or you could simply check the datatype of the value.
Ah, so it's the hotkey :D that makes sense, thanks to you both! And yes, in the meanwhile I was checking the datatype (but as != DATATYPE_STATION) while I worked on the rest of the script, but I was worried it might be a flimsy correction. Good too know it will be safe.
Cycrow wrote:
Sat, 5. Jun 21, 16:57
Just remember, that the tracking aim can also be null if you have nothing targetted
I actually ran into that later when I introduced a menu to let the player choose the target station if their tracking aim was invalid when called as a hotkey: the player escaping out of the menu also returns null, so I had to check datatype a second time and assume the script should be terminated there if it was still not a station datatype.

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 » Sun, 6. Jun 21, 12:31

if you are expecting an object, then using the $obj -> is exists, command will generally be better than checking datatypes

if the object needs to be a certain class, like a station, then using $obj -> is of class [STATION]

this is because if the object is destroyed, the datatype will still be the same, but the object no longer exists

checking the datatype is better for when you looking for INT's or STRING's, or if the variable could be of different types, that you will need to handle separately

X-Fighter
Posts: 6
Joined: Wed, 6. Nov 02, 20:31
x4

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

Post by X-Fighter » Fri, 9. Jul 21, 00:53

Is there any way to sell damaged (or any) ships to shipyards programmatically?

I could not find any existing mod or script or example of how to actually sell ships within a script.

I figured that since the player can pick and sell ships, there has to be a way to do that with a script as well.

I'm hesitant to reverse engineer the price of the ship myself based on it's components and reputation and whatnot and then just destroy the ship and hand me the money because that feels just wrong.

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 » Fri, 9. Jul 21, 16:01

in TC/AP the only way is to compute the price yourself.

script commands for those only exist in FL

X-Fighter
Posts: 6
Joined: Wed, 6. Nov 02, 20:31
x4

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

Post by X-Fighter » Fri, 9. Jul 21, 17:43

Cycrow wrote:
Fri, 9. Jul 21, 16:01
in TC/AP the only way is to compute the price yourself.

script commands for those only exist in FL
Too bad I'm 100h deep into my first X3LU game and there is probably no chance to use FL as a basis for LU

michael86
Posts: 29
Joined: Tue, 8. Jun 21, 17:52
x3ap

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

Post by michael86 » Mon, 28. Mar 22, 03:10

In MD files, can I combine <check_any> and <check_all>?
for example a <check_any> inside a <check_all> node or two <check_all> within a <check_any> node?

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 » Mon, 28. Mar 22, 12:18

In general yes, but will depend greatly what is being checked

Code: Select all

<check_all>
  <check_any>
    <check_value value="this.value1" exact="1"/>
    <check_value value="this.value2" exact="1"/>
  </check_any>
  <check_value value="this.value3" exact="1"/>
</check_all>
So either of value1 or value2 being 1 needs to be true AND value 3 always has to be true.

Code: Select all

<check_any>
  <check_all>
    <check_value value="this.value1" exact="1"/>
    <check_value value="this.value2" exact="1"/>
  </check_all>
  <check_value value="this.value3" exact="1"/>
</check_any>
Here either value1 AND value2 are 1 OR value3 is 1 to trigger conditions.

While possible, this needs to be thought out carefully, more so if events are used in combination. Hope this made sense.

MFG

Ketraar
Image

michael86
Posts: 29
Joined: Tue, 8. Jun 21, 17:52
x3ap

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

Post by michael86 » Mon, 28. Mar 22, 18:57

Thank you.
Your first example would be equal to if ((a || b) && (c)) and the second to if ((a && b) || (c)), correct?
Then I assume, that here will work too.

Code: Select all

<check_all>
  <check_all>
    <check_value value="this.value1" exact="1"/>
    <check_value value="this.value2" exact="1"/>
  </check_all>
  <check_any>
    <check_all>
      <check_value value="this.value3" exact="1"/>
      <check_value value="this.value4" exact="1"/>
    </check_all>
    <check_all>
      <check_value value="this.value5" exact="1"/>
      <check_value value="this.value6" exact="1"/>
    </check_all>
  </check_any>
</check_all>

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 » Mon, 28. Mar 22, 19:35

Sure but you would not need to add an additional chack_all within the check_all, its already given.

Code: Select all

<check_all>
    <check_value value="this.value1" exact="1"/>
    <check_value value="this.value2" exact="1"/>
  <check_any>
    <check_all>
      <check_value value="this.value3" exact="1"/>
      <check_value value="this.value4" exact="1"/>
    </check_all>
    <check_all>
      <check_value value="this.value5" exact="1"/>
      <check_value value="this.value6" exact="1"/>
    </check_all>
  </check_any>
</check_all>
It would then look like this without the redundant check_all.

MFG

Ketraar
Image

Post Reply

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