[Train GUI] Circuit condition progress bar
Moderator: ickputzdirwech
Re: [Train GUI] Circuit condition progress bar
First let me say that I understand why the developers chose not to implement this, because there is significant ambiguity about what the range should be in various situations.
However, in the specific case of DrParanoia's example I think the range is reasonably clear. I would define that specific case as one where the operator is >= or > and the second operand is a positive constant, X. In this case, I think it's reasonable to assume the range is 0 to X (Or X+1 for >). In case the signal is actually less then zero, it would need handling for that, probably by simply treating it as zero for this purpose.
Nonetheless this still involves guesswork, and might raise questions about why other, less clear, cases aren't also handled. So I can see the argument for leaving it out rather than implementing a less-than-perfect solution like the above.
However, in the specific case of DrParanoia's example I think the range is reasonably clear. I would define that specific case as one where the operator is >= or > and the second operand is a positive constant, X. In this case, I think it's reasonable to assume the range is 0 to X (Or X+1 for >). In case the signal is actually less then zero, it would need handling for that, probably by simply treating it as zero for this purpose.
Nonetheless this still involves guesswork, and might raise questions about why other, less clear, cases aren't also handled. So I can see the argument for leaving it out rather than implementing a less-than-perfect solution like the above.
-
- Inserter
- Posts: 37
- Joined: Tue Mar 19, 2019 6:25 pm
- Contact:
Re: [Train GUI] Circuit condition progress bar
I look for the exact same behaviour (like the highlighted Item count in your quote) but for the Circuit network parameter. And I actually wait for the boxes to be filled by the unloading train (8 boxes equal to 19200 total ore), also I don't use a comparitor for this, I simply have all the boxes connected directly to the station and I have the "Circuit condition: <Iron ore> >= 19200" set on the train.
Basically this means, that if the train arrives and the boxes are already full, the train moves on, but I also expect for the progress bar on the "Circuit condition: <Iron ore> >= 19200" rule to display to what extent the boxes are filled if the condition is not yet met.
- Ranakastrasz
- Smart Inserter
- Posts: 2167
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: [Train GUI] Circuit condition progress bar
Here is the list of existing conditions, from the wiki.
Time passed
Inventory full – All inventories of the train are full.
Inventory empty – Same as above, but empty.
Item count – The train (all cargoes summed) contains a specific amount of a certain item.
Circuit condition – The train stop is connectable to the Circuit network, so the signals can used for wait conditions.
Inactivity – No items were added or removed for the specified amount of seconds.
Fluid count – The train (all fluid wagons summed) contains a specific amount of a certain fluid.
Passenger present - At least one player is inside any part of the train.
Passenger not present -
The rule I am using is, the difference between starting value and desired value to trip the condition.
-Time passed. From zero to <Time set>. So 30 seconds would say 50% at 15 seconds.
-Inventory full (or 96% I think?) goes from starting fraction filled to entirely filled. So from 0 slots to 40 slots used, at 20 would be 50%. But if you started with 8 of those slots filled, it would still start at 0%, reach 50% at 24 slots filled, and hit 100% at 40 slots filled.
-Inventory empty. Same as above. 0% at starting value, 50% after half unloading whatever was there, and 100% when it is empty.
-Item Count. Same as Inventory full, or empty, depending on if it is more or less. If it goes in the wrong direction however, just recalculate from the new point after it starts approaching the goal again. So if you set it for 1000 coal, it starts with 550 coal, and 50 is removed, it goes from 0% to 0%. But adding back 50 would give you a full 10% progress.
-Circuit Condition. As Item count. Whatever the comparison, use the difference between current and resultant. This means you can, as a player, setup a progress bar however you want by sending it a conditional with 0-100, with continuation at 100+.
-Inactivity. Just as Time Passed, but resets every time something happens.
-Fluid count. As Item Count.
-Passenger Present/not Present. This is a boolean, so just have an empty/filled box, or a checkbox, or something. This one is literally a boolean and you can't do anything about it. Although replacing it with a Passenger count, with zero being not present, >= 1 being Passenger Present, and allowing a set number of reuquired passengers. Doubt it would add much, but would combine the two easily. Or have "Player Entity" as a cargo type or something.
It can all follow a simple ruleset, be consistent, and still support circuit conditions.
Time passed
Inventory full – All inventories of the train are full.
Inventory empty – Same as above, but empty.
Item count – The train (all cargoes summed) contains a specific amount of a certain item.
Circuit condition – The train stop is connectable to the Circuit network, so the signals can used for wait conditions.
Inactivity – No items were added or removed for the specified amount of seconds.
Fluid count – The train (all fluid wagons summed) contains a specific amount of a certain fluid.
Passenger present - At least one player is inside any part of the train.
Passenger not present -
The rule I am using is, the difference between starting value and desired value to trip the condition.
-Time passed. From zero to <Time set>. So 30 seconds would say 50% at 15 seconds.
-Inventory full (or 96% I think?) goes from starting fraction filled to entirely filled. So from 0 slots to 40 slots used, at 20 would be 50%. But if you started with 8 of those slots filled, it would still start at 0%, reach 50% at 24 slots filled, and hit 100% at 40 slots filled.
-Inventory empty. Same as above. 0% at starting value, 50% after half unloading whatever was there, and 100% when it is empty.
-Item Count. Same as Inventory full, or empty, depending on if it is more or less. If it goes in the wrong direction however, just recalculate from the new point after it starts approaching the goal again. So if you set it for 1000 coal, it starts with 550 coal, and 50 is removed, it goes from 0% to 0%. But adding back 50 would give you a full 10% progress.
-Circuit Condition. As Item count. Whatever the comparison, use the difference between current and resultant. This means you can, as a player, setup a progress bar however you want by sending it a conditional with 0-100, with continuation at 100+.
-Inactivity. Just as Time Passed, but resets every time something happens.
-Fluid count. As Item Count.
-Passenger Present/not Present. This is a boolean, so just have an empty/filled box, or a checkbox, or something. This one is literally a boolean and you can't do anything about it. Although replacing it with a Passenger count, with zero being not present, >= 1 being Passenger Present, and allowing a set number of reuquired passengers. Doubt it would add much, but would combine the two easily. Or have "Player Entity" as a cargo type or something.
It can all follow a simple ruleset, be consistent, and still support circuit conditions.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
-
- Inserter
- Posts: 37
- Joined: Tue Mar 19, 2019 6:25 pm
- Contact:
Re: [Train GUI] Circuit condition progress bar
Okay, I will try to explain what I mean with an image. Please look at the following situation:
So, the question is: Why there is a progress bar for Iron plates and there is no (or even can't be) a progress bar for Copper plates? I perceive it as a bug
So, the question is: Why there is a progress bar for Iron plates and there is no (or even can't be) a progress bar for Copper plates? I perceive it as a bug
Last edited by DrParanoia on Sat Mar 23, 2019 10:34 am, edited 2 times in total.
Re: [Train GUI] Circuit condition progress bar
The copper progress bar is correctly showing 0 of 1K loaded in the cargo wagon.
-
- Inserter
- Posts: 37
- Joined: Tue Mar 19, 2019 6:25 pm
- Contact:
Re: [Train GUI] Circuit condition progress bar
There is no copper in the cargo wagon. Add a stack of copper and see what happens.DrParanoia wrote: ↑Thu Mar 21, 2019 9:45 pmPlease explain. Why showing copper as 0 is correct while the iron is showing 50% progress? Conditions are exactly the same.
Re: [Train GUI] Circuit condition progress bar
Actually, DrParanoia has a point: The station has two inputs. It can read from the train (ID + inventory) and from everything connected by wire, so the station should see 500 iron and 500 copper plates. Nevertheless, the setup shouldn't work because the station will see the two inputs combined. So if the box is empty and a train with 1k copper + 1k iron plates arrives, the train should leave immediately because the station can't know that everything is on the train and nothing in the box. For this, train contents and box contents would have to be isolated -- and that would require some kind of combinator setup again that sends a virtual signal to the station once the box contains >= 1k copper plates.Trebor wrote: ↑Thu Mar 21, 2019 9:49 pmThere is no copper in the cargo wagon. Add a stack of copper and see what happens.DrParanoia wrote: ↑Thu Mar 21, 2019 9:45 pmPlease explain. Why showing copper as 0 is correct while the iron is showing 50% progress? Conditions are exactly the same.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
-
- Inserter
- Posts: 37
- Joined: Tue Mar 19, 2019 6:25 pm
- Contact:
Re: [Train GUI] Circuit condition progress bar
Please look at the image carefully.
1) The Iron plates are read from the cargo. Condition is "Cargo: <Iron plates> => 1000"; cargo wagon has 500 plates; 500/1000 = 0.5 = 50% progress;
2) The coper plates signal is read from the circuit. Condition is "Circuit signal: <Copper plates> => 1000"; chest has has 500 plates = 500 copper plates circuit signal; 500/1000 = 0.5 = 50% progress, but the progress is not displayed; If you put 1000 copper plates inside that chest though, the progress instantly jumps to 100%;
1) The Iron plates are read from the cargo. Condition is "Cargo: <Iron plates> => 1000"; cargo wagon has 500 plates; 500/1000 = 0.5 = 50% progress;
2) The coper plates signal is read from the circuit. Condition is "Circuit signal: <Copper plates> => 1000"; chest has has 500 plates = 500 copper plates circuit signal; 500/1000 = 0.5 = 50% progress, but the progress is not displayed; If you put 1000 copper plates inside that chest though, the progress instantly jumps to 100%;
Re: [Train GUI] Circuit condition progress bar
Show us what the train-stop is set to. Also, if that's correct, try placing a power pole in the box/trainstop circuit. Lets have a look at what's being sent on the network.
-jim lee
-jim lee
-
- Inserter
- Posts: 37
- Joined: Tue Mar 19, 2019 6:25 pm
- Contact:
Re: [Train GUI] Circuit condition progress bar
Here is the updated image. I've also added some more conditions to the train to illustrate the problem better.