This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
crpl:crpltutorial:interactive:advancedemitter [2014/10/01 19:02] – external edit 127.0.0.1 | 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 " | ||
==== Leaving stuff behind ==== | ==== Leaving stuff behind ==== | ||
- | The hardest part probably, but the most important for huge maps to prevent power zone spam. | + | The hardest part probably, but the most important for huge maps, is to prevent power zone (PZ) spam.\\ |
+ | This should be something the map maker should take care of himself and not be a problem you have to worry about. | ||
+ | Though doing things on the destruction of our custom emitter isn't that hard. | ||
+ | == 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:\\ | ||
+ | <code prpl> | ||
+ | Explaining in-depth what it does:\\ | ||
+ | __// | ||
+ | __// | ||
+ | __// | ||
+ | __// | ||
+ | < | ||
+ | |||
+ | == Leaving something else behind == | ||
+ | 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.\\ | ||
+ | Since we declared a variable called DeathAmt, lets release that much creeper upon death! | ||
+ | <code prpl>: | ||
+ | CurrentCoords < | ||
+ | < | ||
==== 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 ==== |