Bug with SetDigitalisRaw (and confusing behavior for SetDigitalis)

Started by planetfall, March 07, 2014, 10:29:00 PM

Previous topic - Next topic

planetfall

If I set the digitalis to 0, the cell no longer becomes able to contain digitalis. It still shows up as growth area, but no digitalis will grow onto it. Calling x y 1 SetDigitalisGrowth on the cell afterwards doesn't fix the problem. I'm using game version 1.82. (EDIT: updated to 1.87 and bug is still present.)

...looking back at the old update logs, I see this is a "feature" for SetDigitalis, but apparently not for SetDigitalisRaw, which nonetheless has the same effect.

What, exactly, is the rationale behind this, then?
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

knucracker

The digitalis data structure is a little hard to interpret.  I used a single int in the digitalis array to encode different state information.  Internally a negative value in the digitalis array means that the cell is "growing".  The growth rate is 20000 per frame.  Growth means that the cell is charging up and on it's way to becoming a cell with digitalis in it.  Once the value climbs up to 0, the cell's value will suddenly get set to the max health from Digitalis, which is 1000000.

So positive values are the health of digitalis and negative values are the growth value.  That's how it works internally.
The SetDigitalisRaw call lets you set the raw digitalis cell value to some int.  The SetDigitalis call was supposed to hide these internal details.  You pass in a float 0-1 to determine the health (0 to 1000000 interally).  A negative value simple means to set the cell to -1000000.