More R&D tweaks and fixes#39367
Conversation
|
The man who saved vg |
This thing is at least 11 years old, at this point I almost want to call it a feature/change rather than a bug given it didn't negatively impact gameplay. Rather, is this not technically feature loss as you can no longer queue items you don't have the materials for? |
|
It is a featureloss, by technicality. But it's also thanks old coders and legacy bug. |
|
It is a new dawn of scientists being able to tell at a glance if they can actually print something instead of trying it and then failing to do it. |
|
make the buttons greyed out instead |
|
fuck it just make a whole new interface you have Permission |
Inorien
left a comment
There was a problem hiding this comment.
@boy2mantwicethefam pls confirm this
| break | ||
| update_buffer_size() | ||
| else if(has_bluespace_bin() && is_material) //Now extract per fabricator | ||
| var/list/other_fabricators = bluespace_fabricators - src |
There was a problem hiding this comment.
pls correct me if im wrong but does this not imply that installing a bluespace bin and there aren't enough materials locally means that:
- it will only attempt to pull material from other fabricators
- it will either break and return 1, or not break, print a warning and then return 1 anyway, producing the item for any spend
sorry its 10pm and im tired but this smells weird
There was a problem hiding this comment.
Yeah it's not removing the fabricator's own resources if there aren't enough materials, good catch
The early break is so that it doesn't parse needlessly through the rest of the bluespace fabricators once it has pulled enough materials from them.
The return is redundant, I am removing it. I'm keeping the warning though.
Changed defines from decimal values to whole number values because frankly there's no difference. May even fix a rare bug in which clients interacting with the R&D console crash but probably not.


Changed the "dat" variable that contains all the HTML data from a list to a string, which may also fix that rare bug but maybe not. No in-game difference.
Fixed an ancient bug where items in the Protolathe and Circuit Imprinter menus would show the "x5/x10/x20" buttons when there was 0 of their material costs in storage (such as if you had 500 iron and 0 glass for an item that required both). This coincidentally restored a functionality that used to be broken where the item cannot be clicked until you have the materials for it. And I added color-coding for whether materials are available.
Fixed a bug where a "Name" design would appear in the list of R&D database designs
Acquiring materials via bluespace matter bins will now cover the cost instead of seeing if there are enough materials in other fabricators to print the item on its own, meaning that if a design costs 1000 metal but you have 500 metal in your machine and 700 metal in bluespace it will now take 500 metal from your machine and 500 metal from the bluespace-connected fabricator instead of saying that there's not enough materials. This should also fix it if the 700 metal in bluespace is split between multiple machines, such as 350 in one and 350 in another
Optimized the protolathe/imprinter design menus by reducing the amount of times the designs have been checked from somewhere over 6000 times at max research (it was going through over 500 known designs for each item category which is up to 13 times if you had Nanotrasen research) to less than 2000 (going through every design once and filtering the ones that don't belong on the protolathe/imprinter, removing them from the list with each one that has been added to a category), and subsequently undid those optimizations with the addition of a lot of checks to make the pretty colors work.
Added a global list of bluespace-connected fabricators to be referenced instead of going through the global machine list, making it a much shorter list.
R&D consoles now have a dummy "bluespace" materials datum that is used for making the protolathe/imprinter design menus by going through the bluespace machine list and adding up all the available resources.
A fabricator that's flagged to ignore material/chemical costs will now allow multiple queue buttons again instead of just custom.
Renamed check_mat() (counts how many times a material cost is covered by dividing the amount in storage with the design's material cost) to material_print_amount() because it was too similar to check_mats() (checks how much material there is in storage, with support for chemistry reagents)
Fixed an edge case bug (except for flatpack fabricators, I'm not fixing that yet) where if an item didn't have enough materials but it acquired some materials through bluespace matter bin connection then some of those materials would be transferred over to the fabricator that required the materials because the code was transferring them to the machine but since there wasn't enough of a material to be transferred from other bluespace machines it would just leave those materials transferred.
Changed a round() to a floor() for a similar effect.
Changed build_part_loop() from calling new procs of itself to a while() loop for the same effect but less ugly.
🆑