Shinoow / AbyssalCraft-Integration

Integration module for AbyssalCraft
6 stars 6 forks source link

Infusion ritual adding doesn't change sacrifice items #26

Closed noahschoem closed 5 years ago

noahschoem commented 5 years ago

Intro:

The attached Zentweaker script attempts to add three infusion recipes; however, these infusion recipes do not replace the sacrifice item with the intended output.

Description:

See attached Zenscript. In summary, two of the infusion recipes are supposed to take in cobblestone in the center (stone in the other recipe) and create either Darkstone cobble, Darkstone stone, or Shoggoth Biomass. There are no errors reported when the script loads, and the ritual can be performed as expected in game; however, the infusion rituals complete with cobblestone (/stone) in the center pedestal instead of the intended output.

Attached script here is a .txt due to Github's upload restrictions; it's still just a Zenscript: ritual-adds-simplified.zs.txt

Crash report:

No crash.


Affected versions ("latest" is NOT a version):

Latest log file for when the issue was present:

https://paste.ee/p/c8sFl

noahschoem commented 5 years ago

Some additional information: here's an abridged dump of the output of /acritual file (linked below). The last three entries correspond to the custom added recipes in ritual-adds-simplified above. Note that from /acritual, the dark_cobble and dark_stone recipes appear to output cobblestone and stone, but the shog_bio recipe claims it outputs shoggoth biomass. However, my own testing indicates shog_bio still just outputs cobblestone.

acritual.txt

Shinoow commented 5 years ago

The rituals are failing because of a rounding error due to the required energy being a too small number. As the energy draining during a ritual is spread out through the duration, small enough numbers are broken down into fractions that doesn't properly resolve back into the number (1 PE is drained, but the amount that the ritual altar has collected from draining 0.005 200 times might be 1.005 or 0.995, or some other number that's essentially 1, but offset just enough that it doesn't evaluate to 1). I'll need to conduct some more testing on my own, but for the moment numbers below 100 don't function properly for the required energy. I should probably change the ritual dump to output the registry name of the item rather than the unlocalized (as the tile.stone and tile.cobblestone there aren't the vanilla ones). Also, I would prefer if you uploaded your scripts and other text files to pastebin instead of uploading the files, as then I wouldn't have to download them in order to view them.

noahschoem commented 5 years ago

Can confirm; I just set the infusion rituals to take 100 PE and the rituals output darkstone cobble / stone / biomass as intended. I tried a few other values below 100 PE (namely 90, 91, 95, 99) and none of those worked.

Until PE values below 100 are supported, it might be nice to update the wiki with a notice that recipes take a minimum of 100 PE.

Shinoow commented 5 years ago

Fixed in https://github.com/Shinoow/AbyssalCraft/commit/aad93c2a1495adfb663d1cb5069c2bc0721baa85