 Hello guys crypto grounds here welcome back to an idle another idle tutorial video This is episode 20 and today we're going to be doing Prestige currency or prestige stuff. So specifically We're going to do some Prestige upgrades because I feel like we're kind of lacking those so right now. I'm in my upgrade screen We are so we can keep this here However, I want to add a prestige section now again, we're adding more buttons again You probably shouldn't have these at the top because it kind of looks ugly, but we're gonna add another button anyways So anyways, we're just gonna copy this upgrades button and we can do Move that here We're gonna do prestige prestige Button So here we can just do prestige even though we have a prestige button there prestige All right, and then now we need a new main screen. So I'm just gonna copy the main screen that we already have Where's the settings button? Okay, I see And we're gonna call this prestige screen Okay, so if we toggle off the main screen, we are currently in our prestige screen So I'm going to get rid of this click button because we don't need that and we can get rid of full Resets and we can get rid of the prestige Honestly, because this is gonna be dedicated to upgrades only now This would be really basic one because I'm basically just making more upgrades, but I'm just doing this because Just to expand your game, I guess so this can be our first upgrade we can do Or do two we'll do two actually we'll do three. Okay, so this one will be click and then We'll add I like to just copy these ones because they're kind of in the position. We want to be anyways so this one will be our production and This one will be the gems effect. So this will be like gems are worth 10% more something like that. Okay So we're not gonna I we can have a by max But I'm not gonna do a by max for this video because I'm sure you guys know how to implement this by now and The progress bar sure we can keep We can add a progress bar for each one of these why not so I'm actually gonna yeah, we can keep these in here We're in progress bar progress bar progress bar Now I can also just start renaming stuff in here by max upgrade button and Progress bar now you don't have to do this, but I personally just want to keep it organized So this would be bg and this will be smooth now what I'm gonna do to kind of just I don't want to rename everything at once I'm just gonna Copy and paste this twice Drag this one here and drag this one here And I can get rid of the old ones So this will also so this will now become production and this one will become gems and We need to rename some stuff So this one will be Click is 50% more effective or 50% more powerful actually I like effective Effective or is better you can rename however you want to we're just making the upgrades Or I'm just making the upgrades and this one will be You gain 10% more coins per second, so basically all your production units are 10% better We have a sweet progress bar and then for gems we're gonna do this Let's see what's our current equation for gems boost Okay, so yeah, we'll we'll add on to this Okay, so gems are plus Zero one times faster Or not faster better Simple as that. Oh, we need the cost. We do need a cost though So cost will be a hundred gems and this one will be This one could be like ten gems Ten gems and remember the boost is based on your current gem So if you want a if you want all your gems to be spendable I can do that too or I can do that in a separate video Because I feel like that'd be kind of on off topic So if you want that, let me know in the comments below and This one will be five gems. Cool. We have our UI done Let's get rolling So I know I like to make separate scripts and we could make another one right now But I'm just gonna do this in the main script so you guys don't get lost Actually, you know what? Let's create a new script. So we're gonna copy this event manager and just delete this script We're gonna call this prestige manager. Now, you don't have to move all your old prestige stuff into here This will be just like the prestige upgrade. I'm gonna call this one prestige The script called prestige manager Create an ad Let you need do its thing and we can open it right up. Cool So we have a brand new script kind of organize some things a bit So what do we have here? We have three buttons three progress bars That should be pretty fairly easy Also, I'm gonna do something in the main script real quick just so we can use this progress bar So make sure paint pay attention because this will mess up. Oh wait. No, we already have methods. Never mind Okay, so where is our fill Big double fill Okay, what I'm gonna do. I'm moving this to the methods Gosh, I'm getting a lot of notifications. Why? Okay, I'm moving this to the methods one because we want to use this wherever we want to so I'm gonna make this a static private static method Actually, we want this to be public so we can use it And we'll go here. We're gonna do Methods dots big double fill methods big double fill Cool because we're gonna use this for our upgrades So let's have our what's doing UI first. So three costs. So we're gonna do public I'm gonna do an array this time. I'm gonna do good management this time We're gonna do cost text and And we're gonna do public void start Start P for prestige manager because we're gonna run this inside our tutorial game We're gonna set cost text is equal to new text Three actually, no, we don't want to do that. Right. I forgot I talked about this in a different video No, no, no, no, we need to import the the unity engine that you I namespace Unity engine dot you I namespace correct the Mundo Cool, so we can just pre-define this if you want to but if you want to add more text, you're going to do it in the editor And make sure you do it in here, too. So three so we have three texts. We have three progress bars We're gonna do Cost bars we're gonna change the type to image Cool, what else do we have? I think that's it unless we have a level. I don't remember. I don't think we do. Nope That's just it cool cool cool So I don't believe we need to start anything in here Also, just also if you've seen this black or this bar before like this to get rid of that You just press the insert key if you don't know how to do that already So let's have a we're gonna have a run method because we want to run this inside our main script That's just how I like to organize thing. I believe that's how we do it in here, too We have a run method. Oh, no, we do update Don't know what else they can there, but I like to run everything. I like my main script You don't have to you can do update, but I like to be on sync and have things update certain times So now for the cost hex We're also also before I forget I need to add a public game object actually notes canvas public canvas prestige Okay So we're gonna do if prestige that game object that's said active True. Oh, no, it's active self Active self which is true. We're gonna run the UI Okay In fact, we can do public void UI We can do Void UI in here Cool. So now for our cost text Now this is gonna be our future player Data stuff. It's gonna be here. We're gonna move this to the player data But we want to test this first to make sure it works. This is good to do before you actually add it to your save system So we're gonna do public big double Costs goes new big double and again, you can change the size of this if you want to Actually Okay So this is what I do in my script public void start Or just start whatever just at least it's not start because I'll be your start method After we load our data. We want to do this So we're gonna have this might sound kind of ridiculous to do But we can transfer this into a for loop if this makes sense. I'll kind of show you that so we're gonna have cost one Now you can label these however we want for for me, it's gonna be cost one cost two cost three Okay, so you name it. However, you think it should be named So we're gonna have cost one cost two cost three I'll show you why I'm doing this soon The reason why I'm actually doing this first fall is if we wanted to add a fourth class We can't just change this to four. We can't I mean we can change it in the game manager But she seems kind of weird to do that. So we'll just do it in here So we'll just do cost equals new big double three. So we'll just change the size every time we load the game So we can just actually shorten it to that Okay So then in here we can create a for loop and I equals zero and I or we can do var I is less than Cost text dot count minus or length that minus one I plus plus And then in here We can set cost text to we're gonna make a method for this We're gonna call it void assign Text and We're doing quite a bit of stuff, but we're gonna create another string We're gonna cut or not another string. We're gonna create a string array cost descriptions equals new and Actually, I like I'm just gonna pre-define this already. So what I can do is cost Desk equals new Equals, let's see. We can have let's test this. I don't know if this will work. Okay, just like that New array, okay, so we'll just do this. So basically we're creating a new array with predefined Names or descriptions. So I'm gonna copy all my previous descriptions that I wrote like click is 50% more effective Production and actually we can add a level to why not? Let's do that, too Okay, we have all of our descriptions. So this you can add on to it whenever you want to just as long as you Increase the length of the upgrades. So we're gonna set cost I dot text equal to cost description I Or also actually we should add levels So we're gonna add our levels to and we need to add three more public big double level one now I don't know. I don't know. I haven't really done the research to find a different way of doing this I just really haven't thought about it in my free time So if you're a better coder than me and you know a better way in doing this Please let me know so I can fix this in a future video and actually fix this For my games because it's kind of a problem Levels I Okay, so we need to actually fix this so we're not a dollar sign string So we're gonna do level Levels I Backslash n for new line And we're gonna do our description Another backslash and We're another variable for costs at index I We also want to add the cost and then the brief the name the type coins Cool that should be it so instead of having three lines for all of our tags We can just do this now. This might seem a little bit like redundant in a way, but hopefully this will seem Efficient the long run I guess Again, if you know a better way of doing this, please let me know It's actually like one of my biggest fears is having to like find the solution of this So we're gonna create another public void. We're gonna call this the array manager And we can run this inside our Assign text so we honestly don't need this we don't need a sign text so public void array manager So basically we're gonna make this We're gonna do this so cost Zero is going to equal no. Yeah, it's gonna equal cost one Okay Because remember we're saving this stuff. We're not saving the arrays. So Future play dare to stuff we can move that out Two three one two, and we're gonna do the same thing for levels level one to level three And we can change that to levels cool. So now it should sync properly What else can we do and we can honestly make these ints and int int Mmm, we need to make levels equals new int Size three. Okay. Don't forget that I just flipped this array. So make sure if this is false, then we're just gonna return it And if we're not seeing it, we're just gonna return it. What else do I need to do? I need to do the purchasing stuff Honestly, okay, let's do this So we have our cost bars our costs Bars at index I dot fill amount is gonna be equal to Methods because it's statics. We can use it anywhere. We want to even if it's a nine our main script or in this current script Big double fill Is going to equal So what's we need to add our main script in here to public idle tutorial game game We can do game game.data Dot gems comma, so that's our first variable We're gonna do costs at index I And we're gonna do our fill. So actually we can just move this in here And we need to add a ref because we are directly editing it You're at fill amounts. Ooh, what's wrong? You're not a ref. Okay, never mind. No ref. Okay. Don't know why but That should be it for this We I know we need to sign our costs somewhere. So let's do that real quick So cost so we actually don't need to save this. This is not saveable either So we're gonna set cost one equal to so we have let's see. Let's look at our cost five ten one hundred so five Let's just get started here five Ten what is it one hundred? Yes one hundred and we can set these to private So we access some outside of this class We're gonna set five equal to big double pal Level one. No, we're gonna do. Let's see. What's the cost mode? I think I'm gonna do one point twenty five Yeah, that sounds fair enough for me or one point five times now I can easily do that for the rest for gyms. However, I'm gonna make that higher I'm gonna make it two point five times. So basically it's more than doubling every time we purchase it because it's kind of an OP upgrade All right So let's apply our boost real quick before we forget to do that. So at the top we need to add So actually we are saving our levels so we can just Move these to the player data. Let's add I'm gonna do a region this time hashtag region. This will be our prestige hashtag and region Okay, so we can open close this whenever we don't want to see it which is nice We need to give better names than this. So this will be prestige You level one Sweet three this will be two now. We need to go back to our prestige manager and rename them So this will be I'm gonna add a var right here So I'm gonna do var game or var data equals game dot data So then I can do data cost Click upgrade one get rid of that And we'll do the same thing. We'll just change this two and three. Oh Wrong, that's the wrong level right. This is prestige you level one Three two Okay And we're going to do the same thing here except we need to do Game dot data one prestige level one And this will be level two level three now. This is synced to our save system. So now we need to do a buy Public void by and this will be int ID. So we're gonna switch ID So at case one Just gonna immediately break that. So we are going to add a public. We're gonna add a void We're gonna change this to buy upgrade Make this public void by because we want to do this just once So what kind of stuff do we need we need our? We need so we don't need levels because we have an array we don't need cost either So what we actually probably don't need this So we can just simply do if Game dot data This point where you need some more than twice we do var data equals game dot data data If data dot jams are greater than equal then cost at index ID Then you can subtract them cost ID and We can do levels so now This is the thing here We actually we are probably gonna need this switch statement after all because I don't want to change this levels because It's being synced right here, and this is only we're only doing this for our UI So we actually are gonna have to do this switch statement after all So let's just create a void by and we're gonna do int level and this is gonna be a ref So then we can just do level plus plus Invert that if statements and now Switch ID case one this is just gonna be by level or Data dot level prestige level one and that's it. Oh, what happened here? How to do that? Cool, that's it. So now I'm just gonna copy and paste that for the rest two three two and three here we go We have our whole entire by system right here pretty simple. We only need it in pro one variable And now what's the nice thing is that? We don't oh I'm almost made a mistake again So if data dot jams is greater than or equal than cost So make sure it's not less than because that wouldn't make that would cause a negative All right So now what I'm gonna do I'm gonna put this stuff in here so since we have our we need to actually add our public prestige manager prestige and then start We're gonna do prestige dot Start are now we could have done start prestige I think that's a more appropriate name for that. So let's change it start prestige And then in here Where do we run of our stuff? We're gonna do Prestige run cool That should be oh we have to apply the boost don't we yes we do okay So our first upgrade is click 50% more effective so that means every upgrade is gonna add plus or is gonna be 50% more effective so This is actually pretty powerful upgrade if you think about it. It's doing 50% every upgrade So if you have 50% it'll do 50% of what it currently is after that. It's not doing plus 50% It's gonna be times 50% if that makes sense so for click Let's see. Where is our click stuff Where is our click upgrade right here? Coins click value. So we're gonna find that Okay, so I'm gonna make a new method for coins click value Okay We're gonna do public Public big double total click Value And we're basically going to return We're gonna make a big double Or actually we can just do var var temp equals Data.coins click value And we can do temp times equals events data boost And then we can also do temp times equal now. Where's our gems? Where's our gems even applied for this is gems even like applying to this at all It honestly doesn't seem like it. So we're gonna add gems to it because I think that's fair We're gonna do data.gems and we're also going to do temp times equals So basically we're just multiplying it. So we're doing temp equals temp times that if that makes sense all right It's kind of like the add the plus equals thing Except multiplying. So now here we're going to do also we're going to return temp by the ways Here we need to do prestige Dot levels Now this one I can use the right the array because we're not going to change it. So this will be the first index So let's see. It's 50 percent. So we're going to do big double dot pow and we're going to do 1.5 for 50 percent To the power of our levels. So if we do this in the calculator We do zero the default is one 1.5 2.25 3.35 and if you go to 30 Yeah, it gets kind of crazy So that's why we have a really high cost mode. So if it's really cheap and we can buy those upgrades very easily The game is just going to go pretty fast So actually we can delete this pow Cool. So we have a total click value. So we can add this to our click right here That just shortens our code in general So instead of having like a super long line We can have just a lengthy method instead Which will be better once you have tons of stuff that are boosting stuff like mine for crypto clickers Is at least maybe a hundred lines because I got a lot of stuff going on in there And a lot of it is like if statements for like if i'm in a challenge, don't do this and stuff like that Um So we're going to replace all of our coins click value with this What else are we doing this? Oh Yeah, so this is fine. So basically our coins click value is technically our base value instead now So if we up so we're basically upgrading the base So we don't need to so don't replace everything here. Okay, don't replace that because we still need to upgrade because we can't just do Can't just do that that this doesn't work, right? So keep your coins click value for your upgrades All right I think we're good As long as the ui and the actual click method is applying this then we're good So now let's take a look at our per second So let's bring this to a method now Okay So we're going to go to our click. Where's our click? we're going to do public void total coins per second Cool. So we have this right now, but we're going to change this. We're going to do var Temp and before I continue this, let's search for our coins per second. Are we adding onto it? Yes, we are. So this is technically our base So that's kind of weird because our production upgrade doesn't really work that way because we're sending it equal to This every time, right? So that just kind of that's just like a broken concept So let's go back Because we're adding on to level already. So I feel like we should just get rid of this coins per second variable So we see we're adding it to our production, but that's already being changed Somewhere else. So we're just going to get rid of all this And honestly, let's go to the top. We can get rid of our coins per second And we'll keep our coins click value because this is our base so we can rename it if you want to but I'm just going to keep it as is Um, so temp is going to be equal to Say we need a big double So we got nothing. So we're just going to say it's equal to zero Big double. We're actually going to set it equal to this level. So that's our first thing So let's see and now This is a little weird, I guess My is per coin per second still existing Didn't I delete that? Oh, no, I didn't delete it up here Okay, so ignore all the red for now. We will we'll get there uh, so We can do this we're going to temp plus equals data dot product production one upgrade one level Okay And then we can do temp plus equals This right here. Okay And then we can do temp times equals because we're multiplying here data dot gem boost We're basically just doing this exact same thing as down here So we can just literally just copy this. Oh, so this is gems. This should be gems boost or gem boost Gem boost So make sure it's you're multiplying by gem boost and temp times equal Oh, so if you're multiplying by gems itself, that's like so let's see we're doing 0.05 per gem. That's like A lot more than it should be that's like 20 times more of a boost and yeah So make sure you pay close attention to that And we will add our event token boost And then let's switch these around And now I'm just going to copy and paste this here We're going to return Temp so how this works. Let's see. What are we doing in our upgrades? I think we're doing 10 so you're getting 10 more coins per second. So we're going to do 0.1 for 10% and we're going to do the same equation. It's not additive. It's going to be multiplicative We're going to return temp. Oh, this should not be a void. This should be a big double. Remember that And this can be made private This can be made private as well And now let's go fix all of our red so we can get rid of this because we have our upgrade one already That just makes no sense And now for here Replace this with that Now if our red here coins per second is just calling the method that is there. That's a lot better We can do a lot more managing with our methods here It's pretty nice to look at too Instead of looking at a lot of like random parentheses and making it look really confusing You can be like, okay, it's adding that then adding that then multiplying that to multiplying that a lot easier cool So last thing gems boost So we'll probably have to do the same thing here. So let's go to gem boost. Where is gem boost? Where is that? Where is it? Okay, I see that here So here just for the sakes of it just for the sake of it. We're going to go down here again We're going to do public void or we're going to do public big double Total gem boost We're going to do big double temp equals zero return Temp now so really use this call up, but we'll get there So we are going to make it equal one I think we're going to do temp plus one here. So basically we'll just set data.gems As the boost and then we'll do temp Times equals 0.05 plus Right here. We're going to do pressed each. Oh, so Make sure you do this. I forgot to change this index to zero to one. So make sure you change that And we're going to do 0.05 Plus the second level because we're doing oh, right So here We're going to multiply this by 0.01 because we are adding 0.01 per level. All right So now it's as we're saying we don't need these parentheses so you can just delete these So this will do You could do var here And this should work so we can get rid of uh, so we're basically just reducing that amount of variables We need to save which is nice. We don't even need to save some of these like the costs So we can get rid of that See what else could get rid of Okay, so here now we can just replace this with total gem boost total gem boost And replace these cool All right So this looks like we're multiplying some other stuff What are we doing here? So here we need so this is where it kind of gets a little messy So i'm going to make another variable another one because it seems like we like to kind of Do some extra stuff. I'm going to do public void or another big devil. So this is our last one our total boost So basically we're going to do a big double temp equals total gem boost Uh, this would be total boost not bossed And this can also be made private This can be made private too total gem boost and then we're going to multiply temp by event token And then we're just going to return total boost Cool It's gonna be made var No, we're going to return temp my apologies We're going to return temp Now a total boost we can replace these with that Replace these with that and then we're just going to have to leave our levels here Now we could do a total clip a total click boost or a total production boost but um We're just going to leave it as that and then we're going to take this right here because we're going to need it up here And so we have our total gem boost we're going to change that to total boost And replace this multiplication here with this right here Now if you want to add a production boost With this right here you can add it if you want to However, this is just slightly cleaned up not too much, but it'll do So yeah, you can do whatever you want for that all right So now gem boost we need to get Total gem boost and that's it We are good. Let's check if we have any errors anywhere. It doesn't look like it Cool now. I believe this is it It should save everything properly Yeah, let's give it a shot. So this is kind of a longer video than I expected, but hopefully this will go well Okay, so in here we need to drag our new manager And our prestige manager we need to drag the game manager and our prestige screen So now we have a bunch of stuff here So again in order to change the size you literally just go if you want more images you literally just type in four So our cost text is zero even though it should be three So we just changed that zero to a three and now we can drag three text So we'll do text one Text one text two and text three. This is my order. You can do it however you like, but make sure it matches your script. Okay Because remember I'm doing one two three Okay And now for our progress bars Now let's see. Do we do Okay, I forgot we have a smooth progress bar, right? Yeah, we have a smooth progress bar. So we got to go back to our main script and add that smooth progress bar Image cost bars Smooth So let's see So we're going to add. Okay. So this smooth number We're going to add this to our Our methods as well So we're going to do private static void. Actually, we're going to make this public because we still want to be relaxing, right? And now we can do methods dot smooth number Cool So let's copy this here because we're going to need to do the exact same thing So we're going to do methods that smooth number. So we need a temp for our Our gems. So our actual is going to be Game dot Data dot gems Okay, and now we're going to make a variable We can get rid of this comment right here public Big double Gems temp Again, this is only for the smooth. So if you don't want to do this, then you can just ignore this step All right And then now we need to add up another one of these. So we'll do gems temp in here and for our progress bars We will do smooth Perfect. This should be good now Okay, so we can go press teach manager go to bar smooth and there we go So now our first one will be the regular progress bar And then our smooth will be labeled smooth Okay, so now we do need to apply the buttons So I'm going to grab one two three Go to prestige manager drag it to the button components And we're going to set them all to buy upgrade So now uh, we need to make sure we do this properly. So we have one two and three Right, does that sound right or is it zero one two three? Is it zero one two? I believe it's zero one two So zero one two because I raise our zero index based which sucks Literally sucks. So if our click one will be zero Our production will be one and our gems will be two and let's cross our fingers. We don't get errors On start. Let's check every single script to make sure we are good to go Cool Should be good to go Make this bigger Okay So Okay, we still got to make the navigation for the prestige screen. So we're going to go toggle our Grades, where is that? Okay, so we need to make our change tabs or click shoot. Where is our screen? Ah shoots all the way in there. Okay, so we're going to do prestige dot prestige Even though it should be prestige group Okay So we're just going to leave that out as is We're going to add another one of these. Oh, we already did that prestige We're going to do prestige dot prestige. There we go. That should be good to go Do we have any other starts? Yes, we do We're going to do prestige dot prestige We should be good to go now We got our upgrades here All right, let's go to our prestige. Why is it not working? Did we forget to yes we forgot to change labels We'll do that in here, but we got to make sure we got to do that outside To prestige we have our prestige, but we only have one progress bar that's working. We don't have any gems Thanks Oh, we got negative gems not good not good. So make sure you change this button to prestige What's going on here? I thought this wouldn't work Let me down So I think it's something to do with the UI Well, what's why is it why is it going negative? Oh prestige Okay So if data dot gems is greater equal than cost So I think our issue is that we don't have any cost. It's all zero for some reason, but it's not updating So let's go back in here We're going to check out our costs. Let's see what they are So we have fought. Yeah, it looks like we have our correct costs Our levels are zero zero zero Okay, so it looks like it's correct the costs. Okay. Yeah, that's not good. Look at that Look at that. Yeah We're gonna go negative. Yikes. Okay And if this messed up your game, just make sure you just reset in the inspector or you can do a full reset Why is this not working? I don't know Okay, I see why stupid me forgot to tell you guys that We forgot to invert. I forgot that I inverse this So that's there's lots of confusion when you do this So it's actually if data gems is less than cost and we're just gonna return it So make sure this is less than Now the other thing is the progress bars are not working So let's check it out. So we have our cost bars. I Okay I think we really need to add a ref to this. I really think that's it I don't know. I don't know why I'm just thinking that's it So let's add a ref to all the proper stuff I'm gonna try it. I don't know why it's not working now. I know the other two were setting It was just the third one wasn't for some strange reason. Okay, it's still doing it Okay, so we can't buy anymore. That's good So what if we change upgrade? So it looks like none of the third UI is actually updating so if we change that Okay, I see it's because we're not changing the right stuff. We gotta change it all in here All right, let's try it Yeah, see that changes it We need to apply our notation as well So our upgrade isn't our third upgrade isn't even like trying to reach it. Don't know why but it's buying So if we like go here, actually we can't because we don't have enough gems. So let's go positive Okay, so let's see those work Let's see that works Okay, so it's being set to the first one that doesn't make any sense Okay So why is okay, so Oh Wait a minute, that doesn't make sense This is the right stuff. Why is it not working? Okay, so my guess is that we actually really don't have to do this minus one. That's my guess Hopefully Because I thought length was already minus one or I thought length So if length if we have an index or if we have an array size three I thought the length would be three not two I don't know. That's that's a little weird, but if that's the case then we're gonna get errors huh weird Well, we have our upgrade here That's really weird. I I don't know I'm I learned arrays originally from java. So java's a little different in this in the array situation here So yeah, that works. That's a pretty dang big boost. Look at that Look at that Wow Wow, wow, wow, wow, wow. Wow our click is much better Why is our clicks? Oh the click is so good because of this upgrade well then That means we're gonna have to nerf which I'm not going to do in this video Um, so let's apply the notations or click and then we will call it a day So basically we just do Game.data No, not game. Just game dot Notation method and that should work. Oh, we also need to apply the f2. So we want two decimals All right. Anyways, that is it for this video I hope you guys enjoyed this video if you did and you're new make sure you like my video and Subscribe and turn on the bell for future notifications. Anyway guys. Thank you for watching. Peace