This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| crpl:crpltutorial:interactive:advancedemitter [2015/03/20 14:01] – [Leaving stuff behind] Finished subject TheDutcher | crpl:crpltutorial:interactive:advancedemitter [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ~~DISCUSSION: | ||
| < | < | ||
| ====== Creating a custom emitter ====== | ====== Creating a custom emitter ====== | ||
| Line 24: | Line 23: | ||
| We want the script to be very portable, so instead of coding the values into the script, we'll use input variables. These will be Amt, Delay, AmtIncrease, | We want the script to be very portable, so instead of coding the values into the script, we'll use input variables. These will be Amt, Delay, AmtIncrease, | ||
| - | < | + | < |
| $Delay:15 | $Delay:15 | ||
| $AmtIncrease: | $AmtIncrease: | ||
| Line 30: | Line 29: | ||
| $DeathMode: | $DeathMode: | ||
| $DeathAmt:" | $DeathAmt:" | ||
| - | And as it is an emitter, simple code to make it emit creeper. | + | And as it is an emitter, simple code to make it emit Creeper. |
| - | < | + | < |
| + | # but only emit so much so that the creeper level is at least as much as ' | ||
| + | CurrentCoords <-Amt SetCreeperNoLower | ||
| + | # Wait the specified amount of ticks before doing anything | ||
| <-Delay Delay</ | <-Delay Delay</ | ||
| Line 37: | Line 39: | ||
| You probably need a good popup text to make sure people think it's a normal emitter. Simply add these 2 lines and you're done. | You probably need a good popup text to make sure people think it's a normal emitter. Simply add these 2 lines and you're done. | ||
| - | < | + | < |
| " concat " | " concat " | ||
| Line 48: | Line 50: | ||
| == Set PZ creation on death == | == Set PZ creation on death == | ||
| If you would like to force a PZ to appear or perhaps not to appear, that is done easily with the following snippet:\\ | If you would like to force a PZ to appear or perhaps not to appear, that is done easily with the following snippet:\\ | ||
| - | < | + | < |
| Explaining in-depth what it does:\\ | Explaining in-depth what it does:\\ | ||
| __// | __// | ||
| Line 59: | Line 61: | ||
| In case you're not satisfied with just a simple PZ, you can do whatever you'd like on the unit's death by defining a function called '' | In case you're not satisfied with just a simple PZ, you can do whatever you'd like on the unit's death by defining a function called '' | ||
| This function is automatically called the moment the unit is destroyed.\\ | This function is automatically called the moment the unit is destroyed.\\ | ||
| - | Example time! | + | Since we declared a variable called DeathAmt, lets release that much creeper upon death! |
| - | < | + | < |
| - | # choose 5 random units and fire spores at them. | + | CurrentCoords |
| - | :destroyed | + | < |
| - | CurrentCoords | + | |
| - | 5 0 do | + | |
| - | CurrentCoords RandUnitCoords 1 20 CreateSpore | + | |
| - | loop</ | + | |
| ==== Progressive output ==== | ==== Progressive output ==== | ||
| - | === Negative increment === | + | == Negative increment == |
| + | |||
| + | FIXME | ||
| + | < | ||
| + | > I would assume increasing the creeper emission amount e.g.< | ||
| + | if(<-Amt <-AmtMax neq) | ||
| + | < | ||
| + | endif </ | ||
| + | </ | ||
| ==== Digitalis support ==== | ==== Digitalis support ==== | ||
| + | Simply add this code to the file to add Digitalis support | ||
| + | < | ||
| + | if(CurrentCoords GetDigitalis eq0 CurrentCoords GetDigitalisGrowth 1 eq eq) | ||
| + | CurrentCoords 1 SetDigitalis | ||
| + | endif | ||
| + | </ | ||
| + | If there is any DigitalisGrowth //(The white Digitalis-like stuff that shows where it will grow)// under the core, Digitalis will grow. | ||
| ==== Phantom/ | ==== Phantom/ | ||
| ==== Flip emitter ==== | ==== Flip emitter ==== | ||