Digitalis Growth: How to notate?

Started by Levi, January 21, 2015, 07:00:45 AM

Previous topic - Next topic

Levi

So, I've got my fake emitters supporting existing digitalis growth now (which most script versions I've seen of them don't), and that was pretty simple; setting attributes is dead easy.  But they don't start growth where none exists, yet.

Here's what I attempted, which doesn't work.

....

#Checks if there is creeper - and if there is, sets the unit to grow digitalis where it is.

CurrentCoords GetCreeper 0 gt if
SetDigitalisGrowth CurrentX CurrentY 1
endif

delay <-30

....

Is there a right way round I should be doing that?

J

CRPL is a stack-based language, so you put the commands after the arguments like this:


CurrentCoords GetCreeper 0 gt if
CurrentX CurrentY 1 SetDigitalisGrowth
endif

delay <-30


If you want to use parentheses, they move the command before '(' to ')', so you can put commands before the arguments.


if ( CurrentCoords GetCreeper gt(0) )
SetDigitalisGrowth ( CurrentX CurrentY 1 )
endif

delay <-30


For the game both codes are exactly the same.

Levi

#2
Stack-based, Yoda's speech patterns are.


...Hmm.  Compiles, still doesn't trigger full-on growth.  Need to sort this more.

J

The script currently only places digigrowth at the current location (the single cell in the center of the core). If you want it to seed digitalis, add the line 'CurrentCoords 1 SetDigitalis' so the digi can start to grow. In the editor you can choose to let the core support digi (to keep it alive and let it grow to other cells with digigrowth).

Levi