 Hey friends, Blair here with another streamer tutorial. Tonight I'll be showing you how to use Streamerbot to make an animated D20 that can be used as an alert or redeem for your stream. Let's get into it. So the gist of what's happening here with this Streamerbot action is I'm taking a series of images of a 20-sided die and then I'm also using random number generation to get a number from 1 to 20 and I'm animating these images to make it look like the die is rolling and then based on the result of that random number generation I'm showing the final display of the die as well as playing a dice rolling sound. And then at the end of the action I also have some special shoutouts for rolling a natural 1 or a natural 20 and that's pretty much it. Okay, here's what the final action looks like in Streamerbot. It seems really complicated but it's really not. It's just long. I'm going to go through step by step and show you how to make it now. I'm going to add a new action, right click, click add, let's call it D20. I'm putting it into my command alerts group and the alerts queue and that'll create a new cleared action. Okay, the way I have my OBS and Streamerbot set up for alerts is that I have a single image source called Streamerbot image that I use and I show it, I hide it, I change the image source that is used for it and I reuse that same source inside of OBS to do all of my alerts and things like that. That way I don't have a ton of sources in OBS cluttering up my everything. So basically the first thing I want to do for this action is to clear that image. So I'm going to go to add action OBS set image source file and I'm going to choose my source Streamerbot fun, Streamerbot image. Unfortunately I can't just clear out the file name. So what I've done is I've made a transparent image one by one and I use that anytime I want to clear that image. So that's going to be my first action here. I want to play my sound and that's easy. Sounds play sound, choose the one and there we go. Now let's test. For testing purposes I set up a voice control command to trigger this action. If you want to learn how to do that I have another video on voice control. I'll put the link up there but this way I can just say D20 and it'll fire the action. You can tell already that it played the sound so we're good there. I'm going to move on to the next set of instructions or sub-actions that we want for this and that's going to be animating the spinning part of this animation. To do this rolling animation I basically have these five scrambled dice images and I want to essentially cycle through them about four times with a little bit of space in between to make that animated effect. So essentially I'm doing the same thing. I'm going to add action, OBS, set image source type, pick my correct source. I'll be copying this destination or this action for the next time so I don't have to go through each time but then I'm going to choose the first of those images. Click OK. Now I'm going to duplicate it four times, four and then just click into each one of these and edit, change to the next animation, OK, edit, change to number three, OK, edit, change to number four, OK, edit, change to number five, OK. And then what I want to do is duplicate all five of these three more times so I want to just do them in order, duplicate, duplicate, duplicate, duplicate and I can just keep going down the list basically and it'll essentially make it go through each five images four times for a total of 20 changes, duplicate. So there it's cycling through each of those but if I say D20 it happens but it's all way too fast so we need to add delay in between each of those. So I'm going to add action, delay and I'm going to do 100, this is milliseconds. So I'm going and then I'm going to duplicate this over and over and over and over. I need one, two, three, four, 19, 20 and I'm just going to drag them in between so that I get a tenth of a second in between each frame essentially and this just could this technique here setting the source of an image and then adding delay in between them could be used to do any kind of like really basic animation you want right inside of OBS and that's pretty fun. So now that I have the delay there if I say D20, D20, there we go. Now it actually does the shaky animation. You may have noticed a few things there are issues with is right now it's playing the sound until the sound is done and then it's doing the animation. So there's an issue with the streamer bot play sound where there's this check box finished playing before continuing and it defaults to being checked so I just have to uncheck that and now if I say D20 the animation and the sound should both play at the same time. The next issue you might have noticed that the image is still there. We don't want that so we want to clear it at the end of this action so we did that at the beginning we just need to duplicate that where we're using setting the image source file to a transparent image we want to duplicate it to the end. So now if I say D20 it should play the sound and then do the animation and then clear itself. Okay, time to add the random number generation to this action. I'm going to go to add action, get random number, choose between and go 1 and 20. It's going to save the value of that into this random number variable which we can then use in another action later. So I'm going to go to add action, OBS, set image source file the same we've been using this whole time, choose my source and then I'm going to paste this in. It's basically the path to my folder and then that random number and then .png. So you can see in my images I've actually named the result images 1.png, 2.png, 3.png, etc. So that now if I say D20 it will roll and at the very end you'll see the frame has the number but it doesn't show up for long enough so I want to extend this delay to about three seconds which is 3,000 milliseconds. Now if I say D20 it shows it for a little bit and then it disappears. Okay, the last piece is a little bit of fun where I actually instead of just showing the animation I also output the result to my chat in Twitch. So I'm basically just going to use that same result of that random number generation and go to add action, Twitch, send message to channel and then I'm going to say use the variable username and the variable random number to generate a message that says this person rolled this number. Okay, our final little piece of logic is going to be congratulating a user for rolling a natural 20 or shaming them for rolling a natural one and we can do that basically with a couple extra actions, one for each of those outcomes. Each of them just spits out a message to Twitch either congratulating or shaming the user. I'll show you right now why I have them as separate actions instead of including it in here. What I'm going to do is right after the message where we say so-and-so rolled this number I'm going to add an action, put a logic, go to if and we use that same random number variable and then I'm going to say if it equals 20 then do this particular action and there's my huzzah and then I'm going to add another one logic if if random number equals one I'm going to call that other action for shame and that's it. So here's an example of my chat window up if I say d20 you'll see the output spit out I got real unlucky and there's that custom message for a natural one. Thank you for watching my tutorial on how to make an animation with streamer bot. If you found it useful and make something for your own stream with it or for your videos I'd love to see it so leave me a comment or hit me up on my socials. Until next time, cheers.