[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
User avatar
radon
Posts: 9
Joined: Tue, 1. Feb 22, 17:42

Re: [Discussion] Generic X3FL S&M Questions

Post by radon » Mon, 21. Feb 22, 06:00

Hi, can anybody tell me if it's possible to/how I can change the maximum/minimum account values for the 'auto money transfer to player account' command via a script? I can use start task/set script command to assign that command and a station manager, but I'm not sure how to change the max/min numbers for AMTPA.

Thanks. :)

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

Re: [Discussion] Generic X3FL S&M Questions

Post by X2-Illuminatus » Mon, 21. Feb 22, 21:05

Should be stored in a local variable on that station, 'transfer.values' iirc.
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: 22224
Joined: Sun, 14. Nov 04, 23:26
x4

Re: [Discussion] Generic X3FL S&M Questions

Post by Cycrow » Mon, 21. Feb 22, 22:39

if you are running the script manually, then you can just pass the values as the arguments, the first is the Minimum value and the 2nd is the Maximum value.

User avatar
radon
Posts: 9
Joined: Tue, 1. Feb 22, 17:42

Re: [Discussion] Generic X3FL S&M Questions

Post by radon » Tue, 22. Feb 22, 05:55

Thank you! Changing transfer.values works perfectly, I'm not sure about how to use arguments in this case though (although since I can use transfer.values this doesn't really matter), if I have two scripts like this-

//aa.radon.amtpa.1
$station = get global variable: name= 'radon.station.current'
set global variable: name= 'radon.amtpa.check' value=1
$station -> start task 11 with script aa.radon.amtpa.2 and prio 0: arg1=x arg2=y arg3=null arg4=null arg5=null
return null

//aa.radon.amtpa.2
$amtpa.check = get global variable: name= 'radon.amtpa.check'
while $amtpa.check == 1 ...
  $amtpa.check = get global variable: name= 'radon.amtpa.check'
  set script command: COMMAND_STATION_MONEYTRANSFER
  @ = wait 120000 ms
end
return null

-and I set x and y (if that's right), what else do I need to do? Sorry, I'm know I'm a bit slow.

Edit: actually I've just realised this doesn't work to assign either commands, they fill the station slots but don't actually have an effect

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

Re: [Discussion] Generic X3FL S&M Questions

Post by Cycrow » Tue, 22. Feb 22, 11:33

No, that wouldn't work, as you are just running your own command script which isn't actually doing anything. You need to run the transfer script instead

Code: Select all

$scriptname = $station -> get command script: command=COMMAND_STATION_MONEYTRANSFER
$i = 11
while $i <= 20
  do if $station -> is named script $scriptname on stack of task=$i
     $station -> start task $i with script '!lib.interrupt' ...
  inc $i
end

$task = $station -> get next available task: 11
$station -> start named script: task=$task, script=$scriptname, prio=1, arg1={Minimum}, arg2={Maximum}, ...
set the {Minimum} and {Maximum} values to the ones you want to use.

The first part basically checks if the command is already running and stops it so you can start it again


NOTE: i wrote this from memory so the commands might not be exactly the same

User avatar
radon
Posts: 9
Joined: Tue, 1. Feb 22, 17:42

Re: [Discussion] Generic X3FL S&M Questions

Post by radon » Wed, 23. Feb 22, 03:41

Does this look right? I can't seem to get it to work

Code: Select all

$station = get global variable: name= 'radon.station.current'
$scriptname = $station -> get command script: command=COMMAND_STATION_MONEYTRANSFER
$i = 11 ...
while $i <= 20 ...
  do if $station -> is named script $scriptname on stack of task= $i
     $station -> start task $i with script !lib.interrupt and prio=1 : arg1=null arg2=null arg3=null arg4=null arg5=null
  inc $i =
end
$task = $station -> get next available task: starting= 11
$station -> start named script: task=$task, scriptname=$scriptname prio=1, 100, 200, null, null, null

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

Re: [Discussion] Generic X3FL S&M Questions

Post by Cycrow » Wed, 23. Feb 22, 20:31

ok, looks like the get next available task wont work, as it wont find a task number below 30

Code: Select all

$scriptname = $station -> get command script: command=COMMAND_STATION_MONEYTRANSFER
$i = 10
$found.task = -1
while $i < 20
  if $station -> is named script $scriptname on stack of task=$i
     $station -> start task $i with script '!lib.interrupt' ...
     $found.task = $i
     break
  else if not $station -> is task $i in use
     $found.task = $i
  end
  inc $i
end

do if $found.task >= 10 AND $found.task <= 19
  $station -> start named script: task=$found.task, script=$scriptname, prio=1, arg1={Minimum}, arg2={Maximum}, ...
this will do the same thing manually

just note if all slots are filled then it wont do anything, but there currently isn't enough commands to fill all the slots anyway

User avatar
radon
Posts: 9
Joined: Tue, 1. Feb 22, 17:42

Re: [Discussion] Generic X3FL S&M Questions

Post by radon » Thu, 24. Feb 22, 10:52

ah that works now, thanks that's great :)

Hwitvlf
Posts: 484
Joined: Tue, 13. Apr 21, 21:36

Re: [Discussion] Generic X3FL S&M Questions

Post by Hwitvlf » Thu, 1. Dec 22, 20:54

How hard would it be make a mod to change the default setting for laser towers for "Show as enemy if enemy to me"? Or to add a toggle for this to the Global Commands menu? I have some modding experience with other games, but have no clue about FL so any hints on where to start would be welcome.

I've seen a lot of posts through the years where laser towers cause problems for people when they start vaporizing all ships from a faction because a hostile freighter flew by. It's a pain to flip this setting for each Tower and some people don't seem to know the setting exists.
Thanks :)

eksha
Posts: 2
Joined: Sun, 29. Jan 23, 18:36

Re: [Discussion] Generic X3FL S&M Questions

Post by eksha » Mon, 30. Jan 23, 23:05

How can I change the mineral scanner range? Looking at the extracted globals.txt, it has two values that match the 10km radius - SG_SCANNER_RANGE_SHIP and SG_SCANNER_RANGE_STATION (both are set to 5000000, 5000000 / 500 = 10000m), but I just wanted to ask as there's a good chance people have figured it out ages ago and I don't need to start my trial and error session. Apologies if I use the wrong thread :)

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

Re: [Discussion] Generic X3FL S&M Questions

Post by Realspace » Tue, 31. Jan 23, 08:25

If I don't remember wrongly it is hardcoded at 40km. I increased it in my mod, take a look at the global.pck. But I remember that no matter how high I put it the limit was 40km, which is quite enough even for big sectors

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

Re: [Discussion] Generic X3FL S&M Questions

Post by Curious Max » Thu, 9. Feb 23, 05:54

How to prohibit the disappearance of stations?

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

Re: [Discussion] Generic X3FL S&M Questions

Post by N8M4R3 » Sat, 11. Feb 23, 16:37

Curious Max wrote:
Thu, 9. Feb 23, 05:54
How to prohibit the disappearance of stations?
By ...
  • Trading with stations which are not get supplied or where wares don't get bought from by the npc economy
  • docking a ship on such stations
  • adding a god factory removal exclusion
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/

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

Re: [Discussion] Generic X3FL S&M Questions

Post by Curious Max » Sat, 11. Feb 23, 17:12

N8M4R3 wrote:
Sat, 11. Feb 23, 16:37
Curious Max wrote:
Thu, 9. Feb 23, 05:54
How to prohibit the disappearance of stations?
By ...
  • Trading with stations which are not get supplied or where wares don't get bought from by the npc economy
  • docking a ship on such stations
  • adding a god factory removal exclusion
I need a script that will disable this feature. Or how do I change the existing script responsible for dismantling stations?

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

Re: [Discussion] Generic X3FL S&M Questions

Post by N8M4R3 » Sat, 11. Feb 23, 17:41

Curious Max wrote:
Sat, 11. Feb 23, 17:12
I need a script that will disable this feature. Or how do I change the existing script responsible for dismantling stations?
There's still an existing one "setup.x3fl.pck" where are still removal exclusions are set. There you can add more exclusions for other races which weren't set by now. That's still one of my ideas to test and release such a modified script but I haven't found any free time to have a look at it.
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/

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: 398
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?

Post Reply

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