Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: GoodMorning on July 24, 2016, 08:12:03 AM

Title: SetDigitalis clearing (Understood)
Post by: GoodMorning on July 24, 2016, 08:12:03 AM
Hello again,

I'm working on a script which grows a Digi bloom around a Core.
That much works, but when the Core is destroyed, I cause the bloom to wither (removal of DigitalisGrowth).
Then, when another bloom grows over the site, the Digi never activates.

So, for a given cell:

Coords 1 SetDigitalisGrowth
<Digi activates>

<:destroy>
Coords 0 SetDigitalis
Coords 0 SetDigitalisGrowth

<original Core is destroyed>

Then, a new Core attempts the same. However, it never activates.

Does anyone know why? If so, would you (singular or plural) please clarify my understanding?
Title: Re: SetDigitalis clearing.
Post by: Builder17 on July 24, 2016, 09:43:40 AM
https://knucklecracker.com/forums/index.php?topic=15655

https://knucklecracker.com/forums/index.php?topic=16362

It's hard to explain.
Title: Re: SetDigitalis clearing.
Post by: GoodMorning on July 24, 2016, 11:00:42 AM
Thanks. This might be worth mentioning on the wiki, although I'm not sure how to put it.
Title: Re: SetDigitalis clearing (Understood)
Post by: Builder17 on July 24, 2016, 02:26:24 PM
Just use your forum account username and password to log into wiki. Editing part isn't hard. :)

Maybe you could try to prevent this bug in some way?  ???
Title: Re: SetDigitalis clearing (Understood)
Post by: GoodMorning on July 24, 2016, 08:37:33 PM
I shall do that after testing, so that it is correct. I'm not sure how to phrase the content of those posts yet, though.

My best guess as the the problem:
Digi+ means that it exists. Digi- means that it is ungrown, starting at raw = -1000000. Digi=0 is a sentinel value which causes the growth code to push it up to 100% health, the raw number going from 0 to 1000000.

So, setting it to a negative is a useable workaround, it seems. This may be intentional, as setting to 0 could prevent regrowth, until something else arrives.


I'm not about to out such speculation on the wiki, though the workaround discussed looks like it would need documenting.
Title: Re: SetDigitalis clearing (Understood)
Post by: GoodMorning on July 25, 2016, 08:46:47 AM
Wiki modified to note the zero quirk.

Would someone else please take a look to make sure I got it right?