 Hello guys crypto grounds here. Welcome back to another video now. This is going to be a little difference So I that today was supposed to be the Android build video for my idle game tutorial series But instead I have solved a big hallelujah issue So basically the problem was steamworks net had some problems with the callbacks for Making in our microtransactions or in-app purchases So I wanted to make my own mini series because it's probably like a two three three video series on how to set up steamworks properly that like the correct way and Setting up your microtransactions because there's absolutely no video out there. So I was like, you know what? I figure it out. I'm gonna do it my way. Okay, so this is episode one and today We're gonna be setting up a steamworks the steamworks SDK anyways if you enjoyed this video make sure you smash that like button subscribe to my channel if you're new check out my other videos and There should be a top there should be a corner right there in the top right corner Comment all your feedback questions compliments all that good stuff. You want to follow my patreon? It's in the links in the description below. Anyways, let's get on with it. So here I'm going to pull up I'm gonna pull up where we download the Where we download the SDK, okay, so remember this is for unity I'm using 2019.4.4 f1 and it currently works to this to this day Okay, so all you gotta do is search up Here, let's actually go to the website steamworks.net. So it's steamworks.github.io And I'll be sure to provide all of these links in the description or in the comments below Okay, so we have we have our first link right here and we go click on the installation and go to download Zip download. So this is the zip download now. You can go to the github or zip But I'm just gonna do it from zip instead. So we download this Zip file right here and we have a steamworks.net master folder. Okay, so now we go into this folder also Yeah, that's fine. Okay. So now we have a standalone Editor and Plugins, okay, so let's look for what's going on in here. So we have some other stuff in here that I don't think we need Plugins, I think yeah, so this is like the stuff we're looking for here Okay So this is the folder. Okay. Now. I think what we do here is that we unzip this and it becomes a package Okay, so this is really a unity package. So we do just open this archive unzip the file Okay, so Okay, so let's go back a step. Okay. So we have our folder here. All right So you can unzip it however you'd like but what I'm gonna do instead is I'm gonna open up my project folder in here And I'm gonna add it to my assets. So we just do open show and explore for our assets folder and Open this assets folder and we can just drag this steamworks.net master in here Okay, now I don't like how it's not a unity package, but it's that's fine. It'll work Okay, so now let it import and that should take a minute Okay, so now it's gonna give us some instructions here So import everything to assets which we've done launch unity projects. Yep. Yep So the included editor scripts will copy steam a ID text, okay to the root of your project. So let's go back a step and let's go to github Steam setup that's my project name and I think it's still importing right is it okay? I think it might have it through it somewhere So this supposed to be a file here somewhere. I Don't know where it went So it's called steam app ID. So let's just search it up steam app ID text Okay, so copy this file right here and just throw it actually we can open this one too. So let's open this This window probably should have done that. Oh well, okay? So now What we do here is we replace this with your game ID So what so before you do all this make sure you have your game all set up, right? And make sure you have your store setup all ready to go and you've paid for the hundred dollar fee So this is your game ID. Okay, so this is this video is really for people who have already set up their game So I would just copy my ID right here Obviously, I'm not gonna build it because I feel because that's just gonna mess up my own project a lot So you would replace this ID right here, right? Okay, so now once you save it you can copy this Text file and put it in the root of your project, which is just right here. So you can paste that in here Actually, we might need to do showing score Okay, there we go. So now just copy that text file and Paste it in your stream setup like that. Okay, so this file is gonna be very important when it comes to building your project So just be aware of what you're gonna do that that Okay, so now there's some steps that we got to do first. Okay, so there's an issue where for microtransactions when you make a callback which I Don't exactly know what they do They're really like out of my level But it's used to know when you when steam lets you know that you've made a successful purchase It kind of notifies you right it notifies your code that yes You have made a successful purchase or it just has a custom error, right? So it's basically steams. It's basically steams way of letting us know if something was successful Okay, so in this problem, there's just tons of errors like to Marshall management just stuff like this Okay, I've been working on this for over a week and I finally got it but Okay, so we have this right here and later on you'll see this this right here, right? So I'm gonna keep the link in the description below Or here. Let's add it to my link of my links right here And this right here so you can get more instructions. Okay, but I'm gonna show you how to do this properly So once you go to this page right here, which you click on right here Sorry if I'm bouncing around so make sure you just click on the this would be the third link in description Copy all this code. Okay. Go back to your scripts Unity create an empty folder or if you already have a scripts folder, that's fine So just I'm just gonna create a folder since I don't have one yet call it scripts okay, and We need to create a script in here Well, you can call this whatever you want, but I'm gonna call the steam callbacks IL to Cpp. Okay So let you need to create that for us and we're gonna open it right up and paste that code now If your computer is kind of crappy, this will be a little hard because this is a very long script and yeah, so Copy and paste that code into the script and everything should be okay. Oh, yeah one more thing we need to do is go up here to the top and I think we need to rename something No, that's fine. Never mind. We're good. We're good ignore what I was just saying So you just paste the script and we're good to go you can even keep this in the steamworks namespace to Don't know why it works, but it does. Okay, so now we're gonna get a crap ton of errors So this is completely expected. So make sure you pay attention now. This really depends on how or what version you are Okay, so now Let's ignore that for now. So you're gonna get stuff like new launch query Parameters T does not exist in a namespace. That's because this has extra stuff that our current one doesn't have So the simple solution to this is to completely get rid of this class right here, okay? So you just keep scrolling down and You just delete it. Okay, and save it and you should probably you'll probably have to do this a few more times Because you're here steam unified messages. So we're gonna have to Hold on it's still loading. I don't know where steam unified messages is. I think it's further down Let's just wait for unity to refresh. This is such a massive script. That's gonna take some time. I Can't even like open and close these or fold and unfold these because of how like big this is I don't know why it won't let me do it But I think that's just like one of the things but yeah, this does take a really long time to do So please be patient Even like maybe prepare for which one so steam unified messages. Okay, so I know that's online 17292 Broadcast, okay, so yeah, just start deleting stuff Okay, so we can get rid of that Search of steam unified Yep, right here Just get rid of all the classes of that where it throws an error Okay, because in most cases you won't need them if they don't exist in your Steamworks SDK then you're not gonna need them in your your callbacks script as well Now I don't feel like explaining how any of this works because personally I don't know either So it's very complex and it took me forever to even like figure out how to solve my own issue All right, this should be the last one We might have to delete this gate video URL result. That's my that's a guess No, okay, so now we have some errors like and consistent accessibility Okay, so basically this means Oh, is it still importing? So inconsistent accessibility parameter type CC or C call pays TV table blah blah blah is less accessible than method that so in that case We base so now This is where the tricky part CV of writer You can easily just do all enter and you can just make this class public, but for you guys what we can do is just Look for this class right here Right here. It's called it's an internal class, right? So now we just got to make this class a public, okay? So for me what I had to do is that native methods are another class It was called native methods had to be turned into a public class because it was originally internal looks like we have one more Let's see. What's this one CC or C call base? Yeah, right here. So now we just search for this one to look for the class Class right here. So now you just make this class public Save it Might it might throw us the native methods error. I am not completely sure but we'll see if it does No, it doesn't okay good Could not copy steam. Oh Placed is Yeah, okay, so see how I had to copy and paste it manually right here I guess that was some error going on right here, but we did we did this anyway So you can ignore this error right here. So basically it's just telling us to copy this file manually, which we did So we can just ignore it All right, so we have our SDK set up now. We need to set up a steam manager script. Okay, so now let's just create An empty call it steam manager And we're gonna create a script actually we already have a script called a steam manager So let's search for that steam manager. Oh, no, I think it's created. Yeah, we have to create that ourselves. Never mind Steam manager. Okay, so create that script create an ad And open it right up Okay, okay, so now we're gonna go back to the instructions here So now it says notes if you're using the github version, you might want to grab the steam manager mono behavior It is included in the unity package. Okay, so I guess we didn't use the unity package version But whatever so you click this I'm gonna put this this will be the fourth link and I'll be sure to label these two to help you guys out Copy paste all this code and paste it into your steam manager Scripts. Okay, so let's see. We have an error already Cannot resolve Huh, that's funny. This is something related Okay, so I see this is a bug on them, but you see this this is supposed to be a lowercase. Okay, so yeah You can even find these errors yourself too So if you understand what it's saying and if you know that exists what you did you can change the capitalization Honestly, we can change some of the syntax in here too because it's kind of messy Like that like that Okay, so I basically just turn this that whole method into an expression body like that And there's a lot of grays here. It says that we can just change these but we're not gonna do that Okay, so now let's scroll down to here. Okay, so now we have to replace our app ID here So right now it's app ID underscore T invalid So now we have to replace that with our app ID and we got a cast as an app ID underscore T Okay, so we changed this to our app ID, which I've showed you what that was earlier and mine's like You can just open this back up just copy and paste it to So yeah, just paste that number in here make sure app ID is there and you should be good to go now what I'm gonna do personally is that if you're building for like cartridge or Something like or just a different platform other than steam You want to add up a bull in here and you can just call this like steam active. Okay now This is a hard This might be hard for people who kind of just tend to forget these small things But you want to make sure this is checked as false and you can do this inside unity too, which is really nice Make sure it's checked that's false if you're building for example cartridge or itch.io because it can cause future issues Also, I'm gonna convert this to an expression body because that's really bothering me Okay So now with this bull right here, we can basically just throw this in the wake method right here and We can do if Steam is active we can do all this stuff in here. Okay Otherwise I need to indent all this syntax Okay, otherwise We are going to do game object dot destroy. I actually know Set active. I think it's set active false. Yeah, set active false. Is that what I do in my script? I kind of forgot But yeah, you can basically just set this to false Okay Alrighty, so I think that's it. Hopefully you followed along Okay, so now we have this and We have our thing set up. I'm going to show you how to build it Okay, so there's a lot that that goes into this and I have a video on building on Windows But I'm gonna go through the process here just because I feel like it's it would be necessary So yeah, make sure you check this for steam if you're building a steam Also another thing if you're gonna play this in your editor, make sure to uncheck this or else It will say in steam that you're playing your game if you have it like, you know if you Have it ready or downloaded, you know, you know what I mean okay, so Yeah, so make sure that's checked. I'm not gonna add any user interface. Okay, it's just gonna be a very quick build I don't want to add anything. I just want to get straight to the point but Now we have our steam manager. We need to grab a few files. Okay, so If we do I'm gonna go to my github. I think I have a folder on here Okay, so I have a folder called include for steam. Okay, so you can ignore all the discord stuff Okay, now you see this right here. This is all these are all the files You're going to need every time you build. Okay, so what I like to do in your in my project file, right? I had it open So let's go to steam ready or steam setup I like to create a folder where it says include For include for steam or something like that. Okay, and I'm just gonna copy my app ID Alrighty And we need to look for a few folders. Okay, so I'm gonna go back to my project just so I remember which ones they are and You need steam app API dot DLL steam API steam API Dot DLL You may not be able to find it like that. You just got to look for the right one down here Okay, so you see there's different ones here So we're gonna need a lib steam Which is this one right here? We're gonna need this one and I think we need Yeah, we need the 64. Okay, so that's this one right here. Okay, so basically just copy this one and this one here You might want to go to show and explore And it's gonna open up a bunch of places So here's our here's this one right here in our lib Street our lip steam API dot SO so copy these files into the include for steam folder and Let's see what else do we need? I think we're missing one more Yeah, oh wait, oh Right here. Yeah, okay Include for steam perfect. Okay So I can close all these other folders, so make sure you have your lib steam API It's makes you have all these folder these files right here, right? Okay Now what we're gonna do is We have to build this. Okay, so okay, so now what we need to do is search up steamworks SDK or SDK Yeah, right here. So now you go to the first link which should be partner dot steam games calm Okay, so now we're now we're on this page here. We can click on this download link right here And we don't need any of this honestly So now it'll download as another zip file And open that up Okay, so copy this SDK folder and somewhere safe now I'd like to put it in my steam my actual project folder so you can just call it steam right here Okay, and throw the SDK right in this folder and this should take a little bit. Okay So now we're gonna go to our SDK and we have a readme folder here. So this is just a basic like a Patch notes here. So you just kind of ignore that and really I don't ever go into these folders So you all I go to or all I ever touch is go to tools content builder and Content okay, so now your game content lives here. So I'm gonna create a folder called active active Build okay, so now this is where our game builds would go. All right, so I like to keep my Folder than a quick access here. Let's see. There's my axis built So I gotta do is just go to content builder and then run this build. However, there's more to that So now we got a right click on this run build and click edit Okay, and in here you will have to put in your account your steam account like your steam works account and password in here Okay excuse me but basically it calls these two scripts right here and So we don't need to really touch anything here except for the account login and you will do that Okay, and on your first try it will probably ask you for a steam verification code So make sure you are aware of that and next we're gonna go to our scripts folder Okay, so we have two files here our app build 1000 and our depot build 1001 okay, so now in here we put our game ID which we already have I keep closing this cuz I keep forgetting about it Okay, so we throw this in here and You can put your description here. Honestly, you can do whatever you want with it You can put like what version you can also edit this in steam works too, but I I don't really touch this cuz I just forget So now we want to put our depot ID and most cases. It's just an increment of one Okay, and you don't have to touch this ever again, but how how do you check for that? You go to app admin And click steam works admin and Go to builds Okay, so here. This is my Depot ID actually no, we're gonna go to depots first See I have mine right here if this is the ID for this, okay So I set mine to all languages windows and 64 bit only okay now from what I understand the The steam works at like the script that we just added earlier They don't work for 32 bit. Okay So I put mine at 64 rather than all architectures and for base app Okay, and you could add more depots now I've yet to figure out how to do it for Mac So yeah, make sure you do this and this is your depot ID here and that was what goes in here Okay, so make sure it matches and make sure you save make you change a language Make sure you choose your language here Okay, so we're gonna save this and now our next script is the depot build 1001 Okay, so we get to put our depot ID in here, which is what we did earlier the one okay, and now your content route is That's basically where it's gonna look for okay, so I'm gonna go to mine. I'm gonna show you what mine looks like Okay, so you see how I have mine right here I have my file right here. So basically you just want to copy this This path the spile path to the active build folder, okay So you can just copy and paste that into here. Obviously yours is gonna be different I don't it depends on where you put yours, but mine would be Let's see steam setup. I'd be get hub Steam setup Backslash steam Backslash SDK tools content builder content active builds already and We can close out of this one Okay, and that is all you need to do here. Okay, so when you're done with that and once you have build your project Which I will do that next After this you can click this run build. Okay, and I'm not gonna do that because I don't want to skirt my game So I'm gonna show you how to build it. So let's go to file build settings. Okay, so make sure you choose the 64-bit architecture Okay, so we have Okay, so we have switched to 64-bit architecture, so let's go to our player settings here Make sure you set up your company name. So I'm gonna do crypto grounds and Choose your product name in your version makes you increment this every time choose an icon You should probably know the drill by now. Have it run in the background too. That's also pretty helpful Resizable window everybody loves those. I mean some games you cannot have a resizable window, but in my case, I'm just gonna keep it Splash image. I don't mess with these settings, but that's for you to play with Okay, so all these settings can remain the same so make sure you choose a bundle identifier Which it looks like I've already done that for us, but that's just for Mac only but So I can just ignore this pretty much And I'm gonna choose the IL-2 CPP scripting back end Okay, and make sure you change the API compatibility level to .NET 4.x And We need to change the managed stripping level to high. Okay. Got a protector code and I for your test builds I tend to keep these on full Just so we can see where these errors are located and it gives us a lot of detail so that's up to you You can yeah You just keep them like this and then on your official game release you can probably just turn these script only or even none Okay, but this also affects your editor errors too. So be aware of that So extra settings we don't we don't need to mess with that and our settings should be good to go So let's close out of this Man, you need these frozen Okay, and we're gonna click that build button and I'm just gonna make a build folder here or something like that Builds now you conclude this outside of your project or inside your project. However you want So in here, we're just gonna create a 0.1 test. Okay, so this is where all of our files are gonna be So we're gonna select folder and it will build Also, I just wanted to give a shout out to this guy in principle for helping for him Not really helping me directly, but he was pretty much the reason why I got through Pretty for most of this and got all the links. So I want you to check out his channel and like his videos And yeah, thank you in principle for your helpful videos The best feeling is when it builds successfully for the first time anyway, so We have our game right here. So we should have six files We have a steam setup data game assembly DLL the actual app So if you don't put an icon it automatically defaults as a unity icon now I really don't recommend that you have a crash handler and unity player Okay, so all you need is these five because this is back up this folder But don't ship it with your game now I don't really know what the use is but I believe it's something related to debugging. So I So don't touch that. So basically copy all these folder or all these files go to your content builder right here Go to your content active build and paste all your files here Excuse me, sorry Okay, all right, so now we have these but we're missing some files Remember what we talked about earlier with the include for steam. Well now's the time where you copy all of these and Paste them in here. Okay, so now you have all of this All together. Okay, so now when you now whenever you're updating you delete these three right here and These three and replace it with the new version. Okay. It's the same thing every time But except you just delete that and delete these two. Okay Now we want to keep these Forever, okay, we don't want to get rid of them or else our game won't load properly and Now is the time where you can go to content builder and click that run Build button. Okay So I'm not gonna do it, but I'm gonna show you where it goes So basically you go back to here you go to steamworks app admin and go to steam pipe and go to builds Okay, so you see this is where the description was right? So you would have I think you'd have to set up a branch I don't know what it looks like at first, but you would have to set up this default branch right here something like that and You only need one branch honestly and what you do is that this would be It would look just without these two right? It would just have one empty version right here with your depot ID And your build ID and the date it was it was Created and you would select the most recent one you put so that would be at the top and selected the default branch Okay, and you click preview change and So I can't do it obviously, but I'll show you what the screen looks like so you go to preview change and You click that set build live now you can also add some additional comments if you'd like I do that once that is done You go to the publish section and this is where you are sure you want to update this to your public To the public right so you click for prepare for publishing Publish to steam you can also if you do view diff so you could see some like You could see some other changes in here Type in the magical keyword steamworks and hit that really publish button and it will publish to steam. Okay? Anyways, that was all I believe next video will be the actual micro transactions And I'm not gonna show you the example in the video I'm going to show you how to implement the system and the downfalls of doing this and also what's nice about it Is that it doesn't require you making a purchasing server, which I have no experience with Anyways, thank you guys for watching I hope you guys enjoyed this video and learned something new if you did make sure you smash that like button Subscribe to my channel if you're new and check out other videos on the top right corner comment all your feedback questions and Compliments all in the comments below and I'll don't forget to check out the links if you need some help I will be sure to provide these in the comments, too. Anyways, thank you guys for watching. I'll see you guys the next one