[MOD/Script] LI Freight Distribution Network (FDN) - v7.2 21/11/2010

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

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

coyan2 wrote:I have watched and noticed that the production does not stop, its just like a warning that its about to stop.. No big deal really, I was just wondering, what if you had FDN Supply the hub with 2x or more of the ware that the stations where needing.. Maybe like if the station is part of a complex, the station will be ignored, or placed in the background, and have FDN just work with the hub.
like if there are 25 cattle ranches on the hub, then it will need X amount of e-cells to make all of them work, so keep the hub stocked with at least that many e-cells or something....

I mean. It works fine like this, but I always think there is something wrong with my wares when i see flashing yellow, so I try to find what im missing to add in another station, But find I have plenty of the item, its just not getting to the right station in the time that the station wants it......

all in all, I like the script, Just wasn't sure if this was a bug or not.. :)

Thanks
Coy..
Something I plan to address, Complexes are a pain that's why FDN runs a task on the actual station that is part of the hub, rather than the hub itself.

I have in mind logic which will analyse the ware usage as a whole but early days. I don't use complexes so the flashing triangle of doom doesn't bother me, but I'll get there.

LA
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

coyan2 wrote:I have watched and noticed that the production does not stop, its just like a warning that its about to stop.. No big deal really, I was just wondering, what if you had FDN Supply the hub with 2x or more of the ware that the stations where needing.. Maybe like if the station is part of a complex, the station will be ignored, or placed in the background, and have FDN just work with the hub.
like if there are 25 cattle ranches on the hub, then it will need X amount of e-cells to make all of them work, so keep the hub stocked with at least that many e-cells or something....

I mean. It works fine like this, but I always think there is something wrong with my wares when i see flashing yellow, so I try to find what im missing to add in another station, But find I have plenty of the item, its just not getting to the right station in the time that the station wants it......

all in all, I like the script, Just wasn't sure if this was a bug or not.. :)

Thanks
Coy..
The issue with Complexes is that the storage is a combination of the component Stations that make-up the Complex, however the production is still independent.

Example: a Complex has 3 Stations that require Energy.

The 3 Stations have different cycle times & require a different amount of Energy, so at anyone time the total required varies.

In a normal station the calculation is easy, (Required per Cycle * 2) – Current Stock.

But with a Complex if you use this its (required per cycle * 2) – current stock of the Complex

So currently for Complexes the task running on the individual Stations just passes 1 * required per cycle in time with the production cycle.

What you are seeing with the yellow triangle of doom is the time in-between different cycle times where the Complex registers it doesn’t have the required volume for the next cycle, but as the task monitor this the required amount is passed so the actual production doesn’t stop.

The following code will hopefully stop this:

$hub = the Complex
$stn = the target Station in the Complex
$ware = the ware required as primary resource

Code: Select all

$arrayStn = $hub-> get factories array from sector
$s = size of array $arrayStn
$total = 0

While $s > 0
= dec $s
$stnC = $arrayStn[$s]
  if $stnC uses ware $ware as primary resource
    $req = $stnC-> get numbers of resources per cycle for ware $ware
    $total = $total + $req
  end
end

$total = $total * 2
$cur = $hub-> get amount of $ware in cargo bay
$cyc = $stn-> get numbers of resources per cycle for ware $ware
$req = $total - $curr

if $req > $cyc
  $amt = $cyc * 2
else
  $amt = $cyc
end
coyan2, if I post the test script would you mind testing it?

I only have a few test Complexes and nothing really big to put FDN through its paces.

LA
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

stealthhammer wrote:Hmmm, so noone is having the AL problem I am?

I'll see if I can find an older version again on apricots site and try it when I get the chance. Has to be a simple script loading problem.
Let me know how you get on :oops:

LA
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Complex Tweak

Post by Logain Abler »

This solves the occasional yellow triangle issue on Complexes. It will be in the next update but if anyone would like to test I've upload the single script file.

Link

Code: Select all

   
if $compCheck == [TRUE]
  $arrayStn = $parent -> get factory array from sector
  $s1 = size of array $arrayStn
  $total = 0
      
  while $s1 > 0
    dec $s1 =
    $stnC = $arrayStn[$s1]
    if $stnC->uses ware $ware as primary resource
      $cycAmt = $stnC ->get number of resources per cycle for ware $ware
      $total = $total + $cycAmt
    end
  end
      
  $curr = $parent-> get amount of ware $ware in cargo bay
  $cyc = $stn-> get number of resources per cycle for ware $ware
  $amt = $total - $curr
      
  if $amt > 0
    if $amt > $cyc
      $req = $cyc * 2
    else
      $req = $cyc
    end
  else
    $req = 0
  end
      
else
  $cycAmt = $stn->get number of resources per cycle for ware $ware
  $curAmt = $stn->get amount of ware $ware in cargo bay
  $req = ( $cycAmt * 2 ) - $curAmt
end
LA
stealthhammer
Posts: 1461
Joined: Fri, 12. Sep 08, 04:27

Post by stealthhammer »

LA , tired it with 2.01 patch along with the latest 4.01a FDN and cheat package in and still got the readtext. however with the 4.00 I did not have the readtext error with it.

Also 4.00 was the oldest I could find, also think its the one you started using the menu hotkey with correct?
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

stealthhammer wrote:LA , tired it with 2.01 patch along with the latest 4.01a FDN and cheat package in and still got the readtext. however with the 4.00 I did not have the readtext error with it.

Also 4.00 was the oldest I could find, also think its the one you started using the menu hotkey with correct?
Yes there is a readtext hotkey error on 4.01 & 4.01a, it should still all work okay. It did for me as its only a text label rather than fuctional.

The next update fixes it.

There was a hotkey on v3.6 which opened a report.

LA
stealthhammer
Posts: 1461
Joined: Fri, 12. Sep 08, 04:27

Post by stealthhammer »

I'll try again, I did notice I still wasn't able to access the FDN menu in the commands. Yeah, I didn't play x3 or any game much when that one came out. College and work kinda took over my life rather then x3, sadly the credits can't work in RL tho one wishes they did. :P
coyan2
Posts: 13
Joined: Sat, 11. Feb 06, 13:28
x3tc

Post by coyan2 »

I'm sorry LA, I will get to testing it over the next couple of days, I will get it in game tonight, But how long I can hold out is anyone's guess. I work odd hours, and have been quite busy the last few days.. Thanks for addressing it so quickly, I'm just amazed at your skills.
And thank you for your time in this.. :)

coy
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

coyan2 wrote:I'm sorry LA, I will get to testing it over the next couple of days, I will get it in game tonight, But how long I can hold out is anyone's guess. I work odd hours, and have been quite busy the last few days.. Thanks for addressing it so quickly, I'm just amazed at your skills.
And thank you for your time in this.. :)

coy
No problem coy, let me know how it goes whenever you get the chance, we all have real life getting in the way :wink:
coyan2 wrote: I'm just amazed at your skills
More like blundering from fix to fix :lol: but thanks.

LA
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

stealthhammer wrote:LA , tired it with 2.01 patch along with the latest 4.01a FDN and cheat package in and still got the readtext. however with the 4.00 I did not have the readtext error with it.

Also 4.00 was the oldest I could find, also think its the one you started using the menu hotkey with correct?
Very strange!

Plugin.FDN4.Setup sets the commands which are linked to plugin.FDN4.Redirect, the setup script is called by the AL Plugin.

plugin.FDN4.Redirect calls the appropriate menu depending on which type of station made the call.

Do me a favour; could you zip up all the FDN4 script files (actually in the script folder, not the download) and email them to me, I’ll have a look.


LA
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

New feature on the next update

Post by Logain Abler »

Hi All,

Thought I'd post about the new Wares Report.

I built this to do 2 things, firstly so I could see at a glance the production/consumption ratio of wares under FDN management.
Secondly to see the NCP production/consumption of a ware within range of the FDN.

[ external image ]
The first screen shows the production & use of a ware by player owner stations.
It also calculates (roughtly) the average times and amount for production and usage.
It also calculates (roughly) what the production/consumption is per minute, great for working out if I have a supply issue.

[ external image ]
The second screen show the NCP side of things.

I also use it to look for gaps in ware trade. If I think there is a gap to exploit for a certain ware I add it to the Node then run the report. Saves a lot of time and wasted builds.

LA
stealthhammer
Posts: 1461
Joined: Fri, 12. Sep 08, 04:27

Post by stealthhammer »

I took the script for FDN out of the script folder of the game, only place I have them is in the FDN download folder/zip. Sorry LA, only thing I can think of that may help on that note is zip up the download script and having you check for differences.
StormMagi
Posts: 1335
Joined: Sat, 17. Mar 07, 03:53
x4

Post by StormMagi »

Well I am back at my apt LA with my old backup vid card so I will start troubleshooting in the next day or so and hopefully can go back to playing :)
MOD XR Show Skills

Flying spaceships since 1993.
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

stealthhammer wrote:I took the script for FDN out of the script folder of the game, only place I have them is in the FDN download folder/zip. Sorry LA, only thing I can think of that may help on that note is zip up the download script and having you check for differences.
Not a problem, I'll have a look over and try and get to the bottom if this.

LA
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

StormMagi wrote:Well I am back at my apt LA with my old backup vid card so I will start troubleshooting in the next day or so and hopefully can go back to playing :)
8)

LA
stealthhammer
Posts: 1461
Joined: Fri, 12. Sep 08, 04:27

Post by stealthhammer »

Here is the link, sorry for all the trouble LA.

http://www.filefront.com/14050473/FDNv4Scripts.zip//
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

stealthhammer wrote:Here is the link, sorry for all the trouble LA.

http://www.filefront.com/14050473/FDNv4Scripts.zip//
I’ve had a look at the scripts and they are all there with nothing glaringly wrong.
When I get in from work I’ll pm you a link to my v4.02 files.

Just a quick question, is this s new game, if not are you updating from the old 3.x version of FDN?

LA
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

stealthhammer wrote:Here is the link, sorry for all the trouble LA.

http://www.filefront.com/14050473/FDNv4Scripts.zip//
Stealthhammer,

I've pm'ed you a link to v4.02, hope this works for you.

LA
StormMagi
Posts: 1335
Joined: Sat, 17. Mar 07, 03:53
x4

Post by StormMagi »

ooo update soon? :D
MOD XR Show Skills

Flying spaceships since 1993.
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

StormMagi wrote:ooo update soon? :D
Just putting it through it paces :wink: so yes, soon.

LA

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