[Discussion] Generic X3FL S&M Questions

The place to discuss scripting and game modifications for X³: Farnham's Legacy

Moderators: Moderators for English X Forum, Scripting / Modding Moderators, Moderators for the X3:FL Forums

Post Reply
Curious Max
Posts: 16
Joined: Wed, 28. Dec 16, 15:47
x4

Re: [Discussion] Generic X3FL S&M Questions

Post by Curious Max » Sat, 18. Feb 23, 12:16

Which commands will allow access to all HSAPs? By default, only a part of the HSAPs are available in the game.

User avatar
N8M4R3
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 392
Joined: Fri, 24. Nov 06, 15:48
x4

Re: [Discussion] Generic X3FL S&M Questions

Post by N8M4R3 » Tue, 11. Apr 23, 01:24

Curious Max wrote:
Sat, 18. Feb 23, 12:16
Which commands will allow access to all HSAPs? By default, only a part of the HSAPs are available in the game.

Code: Select all

%0set hsap discoverable: %1
Have a look from here and the next answers behind. There your question was already asked before
Neue Erweiterung für X3 verfügbar: Farnham's Legacy | +Optional: weitere Verbesserungen im inoffiziellen Patch v1.3.14 *** Modified*** :khaak: :thumb_up:
Diese Woche im Angebot: HUD-GUI-Mix (FL) | Text-DB 0001-L049 (FL) | Textkorrekturen & Verbesserungen (FL)
Weitere Veröffentlichungen hier: N8workX
Nützliches Tool für nicht mehr vorhandene Downloads: web.archive.org
Externes Archiv für MOD/SCR Ressourcen: xdownloads.co.uk | code.google.com/archive/p/x3tcscripts/

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

Re: [Discussion] Generic X3FL S&M Questions

Post by olsch » Sun, 14. May 23, 23:26

Hi,
I'm looking for a command to read the maximum cargo bay size of a ship. The commannd

Code: Select all

get cargo bay size
only returns the current volume and I could not find a way to get the max volume.
Thanks

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

Re: [Discussion] Generic X3FL S&M Questions

Post by olsch » Sun, 14. May 23, 23:47

Never mind. I figured it out:
You can get the extra cargo through

Code: Select all

get max upgrade for upgrade <cargo bay extension>

and then just add this value to the base cargo size.

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

Re: [Discussion] Generic X3FL S&M Questions

Post by olsch » Thu, 18. May 23, 23:37

Next Question:
How can I read out the price of a ship? I tried different commands, and none yield the correct value.
Example: Standard issue Argon Mercury. baseprice should be 190,501 Cr (Price for "S" version is 201,877 Cr - Trade MK1 - 1Mj shield)
This is consistent with the calculation described here.
So I tried the following script commands:

Code: Select all

$price = get average price of ware $shiptype --> returns 153220
$price = get max price of ware $shiptype --> returns 191525  (close, but not correct)
$price = get ship base price: shiptype= $shiptype waresize= null --> returns 164596
I also tried some other commands and trying to substitute $shiptype with a created instance of a ship but that usually returned 0

What am I doing wrong?

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

Re: [Discussion] Generic X3FL S&M Questions

Post by Cycrow » Sun, 11. Jun 23, 21:32

you can try the command

Code: Select all

RetVar= RefObj->get ship price: shiptype=[ShipType] waresize=[WareSizeConstant]
this is run on a shipyard. The difference between the base price and the shipyard price is that there is a price variation that adjusts the price (this is usually done based on stock level)

olsch
Posts: 60
Joined: Mon, 24. May 21, 19:37
x3ap

Re: [Discussion] Generic X3FL S&M Questions

Post by olsch » Sun, 11. Jun 23, 22:14

Cycrow wrote:
Sun, 11. Jun 23, 21:32
you can try the command

Code: Select all

RetVar= RefObj->get ship price: shiptype=[ShipType] waresize=[WareSizeConstant]
this is run on a shipyard. The difference between the base price and the shipyard price is that there is a price variation that adjusts the price (this is usually done based on stock level)
Thanks, this gives the desired result! Do you know why the other commands don't work as expected?

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

Re: [Discussion] Generic X3FL S&M Questions

Post by Cycrow » Sun, 11. Jun 23, 22:25

Its due to how the game calculates the price at stations. It uses a variation modifier based on the storage and stock level. This calculates a percentage to vary the price and applies it to the average price. This also applies to ships as they do have a stock level internally.

i may adjust the base price command to include this variation so it should match (as long as a script doesn't change the stock level at shipyards)

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Re: [Discussion] Generic X3FL S&M Questions

Post by FriendlyFirePhoenix » Fri, 30. Jun 23, 01:40

Question - is there a way to accurately compare the efficiency of a script in MSCI? I'm trying to optimise my scripts but it's sometimes hard to tell whether a change helps or hurts.

With other languages I'd simply take a timestamp at the beginning and end and compare execution time but that doesn't seem to work here. Unless I have waits in the script the start and end time comes out the same.

I'm currently trying this with a script that iterates through every ship in the galaxy so there's a fair bit for the CPU to chew on. I tried the following commands:
  • playing time
  • get game time ms
  • get real time
  • compare ms timer
If anyone could provide an example I would be most appreciative.
I made a couple of X3 mods | Colour By Race | True Relations

Random_Tank
Posts: 10
Joined: Sat, 13. Feb 16, 19:56
x3tc

Re: [Discussion] Generic X3FL S&M Questions

Post by Random_Tank » Mon, 13. Nov 23, 19:02

I’ve been customising gate connections, and I’ve managed to get the new gates working perfectly fine, but I can’t get the map to update with the new layout… I’m using map tool with an updated x3_universe.xml to generate a new 00749 bod file, and I’ve put it in a higher number cat folder inside objects/cut, but it still shows the default FL map… what am I doing wrong?

Realspace
Posts: 1342
Joined: Wed, 15. Nov 06, 10:21
x4

Re: [Discussion] Generic X3FL S&M Questions

Post by Realspace » Thu, 16. Nov 23, 08:58

Random_Tank wrote:
Mon, 13. Nov 23, 19:02
I’ve been customising gate connections, and I’ve managed to get the new gates working perfectly fine, but I can’t get the map to update with the new layout… I’m using map tool with an updated x3_universe.xml to generate a new 00749 bod file, and I’ve put it in a higher number cat folder inside objects/cut, but it still shows the default FL map… what am I doing wrong?
x3_universe.xml has to be added in /maps folder, not objects/cut (that's for the 749 as you write). Then check than there is no other mod in the hierarchy that takes control. Mods folder is the last one to be read. I go by memory (not having the game installed anymore) but being FL installed in an addons2 you have to add the cat there, not in main directory of the game.

Random_Tank
Posts: 10
Joined: Sat, 13. Feb 16, 19:56
x3tc

Re: [Discussion] Generic X3FL S&M Questions

Post by Random_Tank » Fri, 17. Nov 23, 01:49

Realspace wrote:
Thu, 16. Nov 23, 08:58
x3_universe.xml has to be added in /maps folder, not objects/cut (that's for the 749 as you write). Then check than there is no other mod in the hierarchy that takes control. Mods folder is the last one to be read. I go by memory (not having the game installed anymore) but being FL installed in an addons2 you have to add the cat there, not in main directory of the game.
Apologies, I should've explained that better; I have a x3_universe.pck file inside maps in the highest number cat file (09 for me), and then the 00749.bod file is inside objects/cut in the same cat file. The new connections and sectors I added all work when flying around (added sectors like red light back in, and new connecting gates like between legends home and light of heart), just the issue is that the map won't show the changed layout, it just shows the default one from vanilla X3FL (but it has the sectors added by the TC/AP plots mod displayed correctly).

Also, not sure if relevant, but where do I find the list of nameid's for sectors? I ported some sectors back from X3AP, and they work, but X3FL has the nameid's for the sectors in the x3_universe file, and AP obviously didn't do it this way (as those sectors just have the co-ordinates instead of a name) so where could I find the nameid's for the AP sectors? And will adding an existing ID mean the ship computer reads the name out or does that have to be done separately?

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

Re: [Discussion] Generic X3FL S&M Questions

Post by Ketraar » Fri, 17. Nov 23, 02:34

Sounds like you are using a mod as you mention the TC/AP mods, and that seems to add sectors too, so I would guess its that which is causing your issue since mod cat will have priority over others. What you want to do is to add your systems to the TC/AP mod bod file and place that in the mod cat to be the highest priority.

MFG

Ketraar
Image

Realspace
Posts: 1342
Joined: Wed, 15. Nov 06, 10:21
x4

Re: [Discussion] Generic X3FL S&M Questions

Post by Realspace » Fri, 17. Nov 23, 09:28

Then the issue is the 749.bod file, it is the only one making the layout, so maybe some other mod takes control. I repeat, did you put it in the addon2 folder, inside your cat, or plain? Bc if your mod is put in the /mods folder, then the structure has to contain the addon2 otherwise, as false patch in the main root, I suppose not, but check that part.
Names are to be found inside the T folder, the various 001-044 etc. Matching the code (page/line) with what is inside universe.xml at the start of each sector. So you need another editor, not the in-game galaxy editor. Or can open the xml directly, starting of each sector is easy to see.

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

Re: [Discussion] Generic X3FL S&M Questions

Post by Ketraar » Fri, 17. Nov 23, 10:18

Realspace wrote:
Fri, 17. Nov 23, 09:28
So you need another editor, not the in-game galaxy editor. Or can open the xml directly, starting of each sector is easy to see.
You can edit sector name ID in the ingame editor in X3FL.

X3FL_GE.png

MFG

Ketraar
You do not have the required permissions to view the files attached to this post.
Image

Random_Tank
Posts: 10
Joined: Sat, 13. Feb 16, 19:56
x3tc

Re: [Discussion] Generic X3FL S&M Questions

Post by Random_Tank » Fri, 17. Nov 23, 19:44

Realspace wrote:
Fri, 17. Nov 23, 09:28
Then the issue is the 749.bod file, it is the only one making the layout, so maybe some other mod takes control. I repeat, did you put it in the addon2 folder, inside your cat, or plain? Bc if your mod is put in the /mods folder, then the structure has to contain the addon2 otherwise, as false patch in the main root, I suppose not, but check that part.
Names are to be found inside the T folder, the various 001-044 etc. Matching the code (page/line) with what is inside universe.xml at the start of each sector. So you need another editor, not the in-game galaxy editor. Or can open the xml directly, starting of each sector is easy to see.
I have it in the addon2 inside the cat; the mod is installed as an archive via plugin manager, so it ends up being 09 cat (the highest number), and there is nothing in the mods folder, so nothing should've been overriding it (AFAIK).

Though one thing I realised from what you said is that the objects folder should not inside addon2, as with other mods I've made/are using it isn't (and these work!). So I moved it outside, the game no longer uses the vanilla FL map.... but instead I get no map at all (though I can stil navigate with the arrow keys, it's using my edited layout, just doesn't display it). This means it wasn't loading in the first place, but now it is, and makes me think there is an issue with the actual bod file and it's failing to load properly, but no idea what as it was generated by the maptools program.

I wonder if it's that I'm not using maptools correctly; I'm extracting all the pck files from maps, converting them to xml so maptools can read them (as it won't read pck), adding x3_universe first, then adding the all the other maps on top, so it's every sector in the game in one bod file, even including ones that are added later via the plots (like Aldrin 2 and Albion)... is this correct? And would some sectors not currently having names be an issue?

DragonOfWar
Posts: 16
Joined: Fri, 8. Dec 23, 23:04

Re: [Discussion] Generic X3FL S&M Questions

Post by DragonOfWar » Fri, 8. Dec 23, 23:21

Hello, I am new here and new to x3 modding, but really hope someone can help me :D

I made a script for taxation of player owned stations, but only within sectors owned by races with which player's rep is not good enough... All is good and working, but I want to know, is it possible to trace the amount of credits player transferring between his account and stations? How can i do it and reffer to this value within my own script? :gruebel:

DragonOfWar
Posts: 16
Joined: Fri, 8. Dec 23, 23:04

Re: [Discussion] Generic X3FL S&M Questions

Post by DragonOfWar » Tue, 19. Dec 23, 13:16

No one answered, but I found a workaround without targeting money transference at all, so the question is obsolete. :mrgreen:

Post Reply

Return to “X³: Farnham's Legacy - Scripts and Modding”