How to let a plant grow on subs or How to show different images/videos/texts with every alert

With Lumia Stream and Overlays, you can already do crazy things without much effort. But how about growing a plant? Just because of subs you get?

Of course we are talking about a plant graphic. We haven’t mastered terraforming yet.

In this guide we would like to introduce you to a more advanced method of refining your alerts.

The first thing you need is of course a graphic of a plant. We simply extracted the leaves with an image editor and created several images with a transparent background.

Now we create our overlay. Of course, as always, you can also use your existing overlay.

To do this, we go to Overlays in the left sidebar. Click on Add New Overlay, give the overlay a name and set your resolution and click Add New Overlay again.

Your overlay editor opens. Now select an Image layer. Go to the right sidebar and give the image the name leaf1.

A unique name is particularly important here, as you will see in the course of this.

Click on Image Settings and then on Change Image. Upload your plant images all at once, then you only need to select them.
Now select the first image. Place it on your canvas as you wish and adjust the size.

Now create the remaining image layers as described above and place the leaves in the correct positions.
Name your leaves image layers consecutively, like the first one: leaf2, leaf3, leaf4, and leaf5.

When you have placed and named everything, hide the layers by clicking on the little eye in the left sidebar for each layer.

Save the overlay and close the editor.

Now go back to the Lumia Stream app and click on Variables in the left sidebar.
Click on Add Variable and name it leaf_counter. In Value we enter a 0 and tick the Counter checkbox.
Click on Refresh.

This completes our preparations and we can now teach our alert to “grow” the plant.

Go to AlertsTwitchSubscriber
Open the Advanced tab and click on Lumia Actions.
Here we select Update Variable in the dropdown. In the Variable field, select your plant variable. In this example leaf_counter. And in Value enter +1.
Click on Add Action and Done.

Now we click on Manage Overlay Actions.
In the dropdown we select Set Layer Visibility, in Overlay our target overlay and under Layer we now do something crazy. We do not select a layer, but enter leaf{{leaf_counter}} by hand.
This way we achieve that the appropriate layer is always shown for the variable.
Make sure the checkbox is ticked and says Set to on
Click on Save and Done.

And with this, we have already managed to make our plant grow interactively with the subs.

But…

The plant must also disappear again to be ready for the next subrun.

So we go to CommandsChat Commands → click Add Command.
Give your command a name like plantreset6. Untick the Commands Page checkbox. Set your Type to No light change and you probably only want to allow mods and yourself access.

Now open the Lumia Actions tab. In the dropdown select Update Variable, under Variable our leaf_counter variable and under Value we enter =0.
Click on Save.

Now go to the Overlay Actions tab. Here we have to make all our layers invisible again. To do this, select Set Layer Visibility in the dropdown, under Overlay we select the correct overlay and under Layer we click on our leaf1 layer.
This time we make sure that the checkbox is not ticked.
Click on Add Action and repeat the procedure with all leaf layers.

If you now click on Test or enter the command !plantreset6 in your chat, your plant disappears again and the counter resets to 0.
Now your plant is ready to react to subs again.

If you want this to happen automatically, go back to your Twitch Sub alert. Open Advanced, click Lumia Actions and select chatbot in the dropdown. For Message enter !plantreset{{leaf_counter}} and tick the Send as yourself box (This is important as Lumia Stream ignores Chat Bot commands).

Now your plant is fully grown after 5 subs and resets to zero at the 6th sub. This means that it will start growing again on the 7th sub.