Level Complete Menu #2

12 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€95.97
List Price:  €134.37
You save:  €38.39
£79.80
List Price:  £111.73
You save:  £31.92
CA$139.82
List Price:  CA$195.75
You save:  CA$55.93
A$153.75
List Price:  A$215.26
You save:  A$61.51
S$134.64
List Price:  S$188.51
You save:  S$53.86
HK$778.36
List Price:  HK$1,089.74
You save:  HK$311.37
CHF 89.34
List Price:  CHF 125.09
You save:  CHF 35.74
NOK kr1,107.14
List Price:  NOK kr1,550.05
You save:  NOK kr442.90
DKK kr715.75
List Price:  DKK kr1,002.09
You save:  DKK kr286.33
NZ$171.37
List Price:  NZ$239.93
You save:  NZ$68.55
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳11,945.63
List Price:  ৳16,724.36
You save:  ৳4,778.73
₹8,442.99
List Price:  ₹11,820.52
You save:  ₹3,377.53
RM446.75
List Price:  RM625.47
You save:  RM178.72
₦169,271.38
List Price:  ₦236,986.70
You save:  ₦67,715.32
₨27,777.22
List Price:  ₨38,889.22
You save:  ₨11,112
฿3,446.26
List Price:  ฿4,824.91
You save:  ฿1,378.64
₺3,454.90
List Price:  ₺4,837
You save:  ₺1,382.10
B$580.04
List Price:  B$812.08
You save:  B$232.04
R1,811.35
List Price:  R2,535.96
You save:  R724.61
Лв187.69
List Price:  Лв262.77
You save:  Лв75.08
₩140,436.95
List Price:  ₩196,617.35
You save:  ₩56,180.40
₪370.16
List Price:  ₪518.24
You save:  ₪148.08
₱5,893.31
List Price:  ₱8,250.87
You save:  ₱2,357.56
¥15,475.45
List Price:  ¥21,666.25
You save:  ¥6,190.80
MX$2,042.64
List Price:  MX$2,859.78
You save:  MX$817.14
QR364.56
List Price:  QR510.41
You save:  QR145.84
P1,367.06
List Price:  P1,913.94
You save:  P546.88
KSh12,945.58
List Price:  KSh18,124.33
You save:  KSh5,178.75
E£4,964.52
List Price:  E£6,950.52
You save:  E£1,986
ብር12,237.67
List Price:  ብር17,133.23
You save:  ብር4,895.55
Kz91,290.87
List Price:  Kz127,810.87
You save:  Kz36,520
CLP$98,658.13
List Price:  CLP$138,125.33
You save:  CLP$39,467.20
CN¥724.22
List Price:  CN¥1,013.94
You save:  CN¥289.72
RD$6,024.63
List Price:  RD$8,434.73
You save:  RD$2,410.09
DA13,426.15
List Price:  DA18,797.15
You save:  DA5,371
FJ$227.57
List Price:  FJ$318.61
You save:  FJ$91.03
Q771.64
List Price:  Q1,080.33
You save:  Q308.69
GY$20,913.50
List Price:  GY$29,279.73
You save:  GY$8,366.23
ISK kr13,966.60
List Price:  ISK kr19,553.80
You save:  ISK kr5,587.20
DH1,005.63
List Price:  DH1,407.93
You save:  DH402.29
L1,821.98
List Price:  L2,550.85
You save:  L728.86
ден5,904.20
List Price:  ден8,266.12
You save:  ден2,361.91
MOP$801.48
List Price:  MOP$1,122.11
You save:  MOP$320.62
N$1,812.81
List Price:  N$2,538.01
You save:  N$725.20
C$3,678.31
List Price:  C$5,149.78
You save:  C$1,471.47
रु13,500.25
List Price:  रु18,900.90
You save:  रु5,400.64
S/379.05
List Price:  S/530.69
You save:  S/151.63
K402.47
List Price:  K563.48
You save:  K161
SAR375.40
List Price:  SAR525.58
You save:  SAR150.17
ZK2,764.29
List Price:  ZK3,870.12
You save:  ZK1,105.82
L477.77
List Price:  L668.90
You save:  L191.12
Kč2,432.37
List Price:  Kč3,405.42
You save:  Kč973.04
Ft39,496.05
List Price:  Ft55,296.05
You save:  Ft15,800
SEK kr1,103.50
List Price:  SEK kr1,544.95
You save:  SEK kr441.44
ARS$100,374.93
List Price:  ARS$140,528.92
You save:  ARS$40,153.99
Bs690.75
List Price:  Bs967.07
You save:  Bs276.32
COP$438,931.09
List Price:  COP$614,521.09
You save:  COP$175,589.99
₡50,918.63
List Price:  ₡71,288.12
You save:  ₡20,369.49
L2,526.16
List Price:  L3,536.73
You save:  L1,010.56
₲780,388.98
List Price:  ₲1,092,575.79
You save:  ₲312,186.81
$U4,261.82
List Price:  $U5,966.72
You save:  $U1,704.90
zł416.31
List Price:  zł582.85
You save:  zł166.54
Already have an account? Log In

Transcript

Welcome back guys, in the last video, we made it so that our level complete menu is showing on the screen when we overlap our level complete blueprint. In this one, we want to actually make that level complete menu interactive and to tally up a final score. So the first thing we need to do here is to open up our BP game mode gameplay here in your frameworks blueprint. And I want to add a new variable. And this one, we are going to call Time remaining multiplier. And I'm going to make this integer.

And then I'm going to compile here really quickly so that I can add a default value and I'm going to make this be 25. And you can fiddle with this value to your heart's content. This is essentially going to be how many points are we going to get for every second that is Left remaining when we complete our level. Okay, just going to Compile and Save that one more time. That's all we need to do in here for the time being. Now I'm going to jump on over to our UI folder and access our w BP level complete menu.

Now, something I did between videos that I noticed I had forgotten in the last video, is I had not set an outline setting for my score value at the very bottom here, so I made sure I went back and fix that up. Innocent Mistake. Okay, within here we want to bind some variables. The first one I'm going to select is our targets text, our target value. Now our target text, that first point value over there and you can select it down here in your hierarchy or you can select it right here. And over in the Details panel, we want to create a binding for this so click on this bind button.

Create binding that Gonna jump off on over to the Graph tab. I'm going to select our function here that we are starting to create hit f2. And I'm going to call this yet what do I want to call this, let's call this get target score, like so. And in order to do this, I'm going to right click Get our game mode. Which game mode do we want to talk to we want to talk to our game mode gameplay. Like so.

And out of our game mode gameplay, we want to extract our game points. We've got this variable called game points that is going to tally up as we shoot targets throughout our game. And then I can simply just plug this in To the return value and there's going to be a conversion node that is going to convert this integer variable into text like so. Make sure you hook up this wire as well. So there is our get target score function that is going to be bound to this value right here. Okay.

Next what we are going to do is select our time bonus right down here, our time value and then we're going to scroll on down till we find our text. There it is, we're going to create a binding for this. Once again, we are going to create some room I'm going to hit hit f2 on this function name, call it get time and I can't spell Time remaining score And I'm going to get our game mode get game mode. Which game mode do we want to talk to our gameplay game mode cast to BP game mode gameplay. And out of this, I am going to extract our game time limit, I probably could have named that variable better set a time limit current time maybe because it does increment down. Then what I'm going to do is I'm also going to extract out of our game mode gameplay, and I'm going to find our time remaining multiplier which I have just created within there.

And then I'm going to drag off our time limit here and type in the multiply number or you can simply just type in multiply, multiply like so and we want to do integer time. integer. So a little math here. So if we have, you know, 10 seconds remaining, we're going to multiply that by our time remaining multiplier, which is currently 25 giving us 250 bonus points right. Then we're going to plug this in here and a conversion node will come in and make sure that you hook in your execution wire like so. So there is that function, that HUD bundle HUD binding is now completed as well.

So one more to go here. Jumping back over to our Designer tab, we've got our final score, and we need to bind this as well. So create a binding for that guy. Hitting f2 on our function name, I will simply call this get final score. And we continue A little bit of a shortcut here, I'm just gonna jump on over to my get time remaining function in here. And I'm going to left click and highlight a bunch of these nodes.

How about that many right there, I'm going to hit Ctrl C, go back to my get final score function, going to do Ctrl V. Plug that into there. And while I do want to do this multiplication, I also want to add in our game points, so I'm going to extract off of our game mode gameplay and do get points, get game points. And so we're going to get our game points and we're going to add that to hitting plus integer plus integer. We're going to add that to our time bonus to get our final score. Make sure you hook that in as well. Compile and Save and now all those HUD bindings should be completed.

Okay, let's jump in and play really quickly and then we will worry about making our quit and our restart buttons functional on our level complete menu. So let's make sure that the score tally is working jumping in and playing. I've just set up a target spawner really quickly here to make it so that I've got some targets to shoot this is the incompleted end of my level right click play from here, you know overlap this trigger volume. Just a bunch of hundred point targets. Oh god 500 points. All right, here we go.

Levels completed. So I've gotten 500 points for targets. My time bonus ended up being quite hefty because I had a whole lot of time remaining. And you can see the map is done here, target points and time bonus to come up with our final score. All right, let's jump back into our level complete menu Widget Blueprint and let's jump into our Event Graph. And let's make our buttons actually functional.

So I'm going to left click drag out a marquee selection and delete out these existing event nodes. And I want something to happen when we click on our quit button over here. So in your mind blueprints panel, you're going to see you have access to talking to your quit button, select that. Let's do something when we click on it. And all we need to do is drag away or off of this and there is a function already built in called quit game. Simple enough, just going to left click drag around that tap that C key and simply call it quit game.

And then I am going to select our restart button widget and say on click for this guy, we will add an on click event. And off of this I'm going to drag out a wire and call upon a function called remove from a parent. What this one does is it actually removes our level complete menu from the screen. Then I'm going to right click and I'm going to get Player Controller. Man I'm gonna drag off of this and do a set inputs mode. And the input mode that I want to set is game only.

Remember we had made it so that when we got to our level complete blueprint, we were showing the level complete menu and we were making it so that you could only complete or only interact with that menu screen. Here we're saying when we restart we want to remove that menu screen and give the control back to our game, not the menu screen. In addition to that, we want to drag off of our Get Player Controller and we want to set show mouse cursor. And whereas before we were saying yes show the mouse cursor. Now we want to say do not show the mouse cursor because again we are restarting our game. And lastly we need to actually drag off of this and type in open level and the level we are going to restart here is going to be Level underscore o one, this is the actual function that is going to quote unquote restart the game, it's going to reopen that level.

So let's left click, drag around this, tap that C key, and I'm just going to call this restart game. Then let's Compile and Save and we're going to test out both of those options. I'm going to fly back over to where I have some targets to shoot. Right click, play from here, got a few targets, shoot, shoot, shoot, points scored. Here is my level completed area. You can see I do have access to a mouse cursor.

Now if I quit, I have quit out. I'm just gonna change my play option here to be a Yeah, you know what, I'll leave my play option here new editor window, that's fine. And then I'm gonna fly back over to the beginning of my target area here again, we're going to right click play from here and let's try out that restart option. Targets definitely got some work to do building out my level previewing it up, here we go. We start obviously this time restarts me at the very beginning and low but you can see my score is zeroed out. My health is back up to full and I restarted at that 120 seconds.

Alright guys, that is gonna do it all for this one. We are going to see you in the next one.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.