Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: kwinse on May 09, 2014, 09:24:24 PM

Title: CRPL Core attribute suggestion: CONST_SEEDSDIGITALIS
Post by: kwinse on May 09, 2014, 09:24:24 PM
As it says in the wiki (http://knucklecracker.com/wiki/doku.php?id=crpl:docs:getunitattribute), CONST_SUPPORTSDIGITALIS doesn't make the core seed digitalis, only keep it alive. However, there is no corresponding seeding constant. It's relatively simple to emulate with CRPL, but perhaps it could be added to the game?

The only big problem I see is that setting SEEDS on without SUPPORTS wouldn't work so well. Perhaps SEEDS on supercedes SUPPORTS?
Title: Re: CRPL Core attribute suggestion: CONST_SEEDSDIGITALIS
Post by: Grayzzur on May 09, 2014, 10:29:04 PM
What's wrong with SetDigitalis(CurrentCoords 1)?

I think that's the right command.
Title: Re: CRPL Core attribute suggestion: CONST_SEEDSDIGITALIS
Post by: Crimson King on May 09, 2014, 11:40:23 PM
That does work but it can also be resource heavy because it checks the Digitalis every frame unless you build a delay or conditional into the script.
Title: Re: CRPL Core attribute suggestion: CONST_SEEDSDIGITALIS
Post by: knucracker on May 10, 2014, 08:51:21 AM
SetDigitalis(CurrentCoords 1) is the way I do it.  That does the same thing an emitter does (every frame it sets the digitalis underneath it).
Title: Re: CRPL Core attribute suggestion: CONST_SEEDSDIGITALIS
Post by: Flabort on May 10, 2014, 11:25:35 PM
Yes, but then you need to write a SeedDigitalis script and attach it to every core you spawn via script that you intend to seed it. ;)
It's a pretty simple process, but some people would just like to save a couple lines of code and cycles of processing power.

The whole reason the extra CONST is in demand is because optimizers.
Title: Re: CRPL Core attribute suggestion: CONST_SEEDSDIGITALIS
Post by: Clean0nion on May 11, 2014, 08:53:34 AM
Quote from: Flabort on May 10, 2014, 11:25:35 PM
Yes, but then you need to write a SeedDigitalis script and attach it to every core you spawn via script that you intend to seed it. ;)
It's a pretty simple process, but some people would just like to save a couple lines of code and cycles of processing power.

The whole reason the extra CONST is in demand is because optimizers.
You'd still have to apply the attribute for every unit. The CONST version takes 4 opcodes and Virgil's version takes 3.
Title: Re: CRPL Core attribute suggestion: CONST_SEEDSDIGITALIS
Post by: kwinse on May 11, 2014, 10:16:01 AM
4 opcodes if the script's already attached, yes. But how many does it take to attach the script to a unit (not counting creation if applicable since that'd be common to the CONST)?

But yeah I knew this suggestion wasn't strictly necessary. Glad to know it was at least considered.