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
€93.07
List Price:  €130.30
You save:  €37.23
£79.62
List Price:  £111.47
You save:  £31.85
CA$136.60
List Price:  CA$191.24
You save:  CA$54.64
A$151.87
List Price:  A$212.63
You save:  A$60.75
S$135.20
List Price:  S$189.29
You save:  S$54.08
HK$781.33
List Price:  HK$1,093.90
You save:  HK$312.56
CHF 90.72
List Price:  CHF 127.01
You save:  CHF 36.29
NOK kr1,092.46
List Price:  NOK kr1,529.50
You save:  NOK kr437.03
DKK kr694.20
List Price:  DKK kr971.90
You save:  DKK kr277.70
NZ$167.15
List Price:  NZ$234.02
You save:  NZ$66.86
د.إ367.25
List Price:  د.إ514.16
You save:  د.إ146.91
৳10,946.16
List Price:  ৳15,325.07
You save:  ৳4,378.90
₹8,342.71
List Price:  ₹11,680.13
You save:  ₹3,337.42
RM473.95
List Price:  RM663.55
You save:  RM189.60
₦123,487.65
List Price:  ₦172,887.65
You save:  ₦49,400
₨27,847.21
List Price:  ₨38,987.21
You save:  ₨11,140
฿3,679.53
List Price:  ฿5,151.49
You save:  ฿1,471.96
₺3,232.18
List Price:  ₺4,525.18
You save:  ₺1,293
B$511.10
List Price:  B$715.57
You save:  B$204.46
R1,851.52
List Price:  R2,592.21
You save:  R740.68
Лв181.98
List Price:  Лв254.78
You save:  Лв72.80
₩135,881.87
List Price:  ₩190,240.05
You save:  ₩54,358.18
₪371.60
List Price:  ₪520.25
You save:  ₪148.65
₱5,713.97
List Price:  ₱7,999.79
You save:  ₱2,285.82
¥15,308.41
List Price:  ¥21,432.39
You save:  ¥6,123.98
MX$1,693.57
List Price:  MX$2,371.07
You save:  MX$677.49
QR364.01
List Price:  QR509.63
You save:  QR145.62
P1,365.33
List Price:  P1,911.52
You save:  P546.18
KSh13,468.65
List Price:  KSh18,856.65
You save:  KSh5,388
E£4,794.02
List Price:  E£6,711.82
You save:  E£1,917.80
ብር5,699.43
List Price:  ብር7,979.43
You save:  ብር2,280
Kz83,741.62
List Price:  Kz117,241.62
You save:  Kz33,500
CLP$94,755.52
List Price:  CLP$132,661.52
You save:  CLP$37,906
CN¥723.62
List Price:  CN¥1,013.10
You save:  CN¥289.48
RD$5,785.38
List Price:  RD$8,099.76
You save:  RD$2,314.38
DA13,457.99
List Price:  DA18,841.73
You save:  DA5,383.73
FJ$225.30
List Price:  FJ$315.43
You save:  FJ$90.13
Q775.21
List Price:  Q1,085.33
You save:  Q310.11
GY$20,876.73
List Price:  GY$29,228.26
You save:  GY$8,351.52
ISK kr13,989.60
List Price:  ISK kr19,586
You save:  ISK kr5,596.40
DH1,008.69
List Price:  DH1,412.20
You save:  DH403.51
L1,771.31
List Price:  L2,479.90
You save:  L708.59
ден5,730.13
List Price:  ден8,022.42
You save:  ден2,292.28
MOP$803.11
List Price:  MOP$1,124.38
You save:  MOP$321.27
N$1,860.85
List Price:  N$2,605.27
You save:  N$744.41
C$3,673.63
List Price:  C$5,143.23
You save:  C$1,469.60
रु13,311.40
List Price:  रु18,636.50
You save:  रु5,325.09
S/375.46
List Price:  S/525.66
You save:  S/150.20
K383.63
List Price:  K537.10
You save:  K153.47
SAR375.03
List Price:  SAR525.05
You save:  SAR150.02
ZK2,685.42
List Price:  ZK3,759.69
You save:  ZK1,074.27
L463.14
List Price:  L648.42
You save:  L185.27
Kč2,328.17
List Price:  Kč3,259.54
You save:  Kč931.36
Ft36,248.95
List Price:  Ft50,749.98
You save:  Ft14,501.03
SEK kr1,083.98
List Price:  SEK kr1,517.62
You save:  SEK kr433.63
ARS$87,816.53
List Price:  ARS$122,946.66
You save:  ARS$35,130.12
Bs689.12
List Price:  Bs964.79
You save:  Bs275.67
COP$389,940.87
List Price:  COP$545,932.82
You save:  COP$155,991.94
₡50,893.45
List Price:  ₡71,252.86
You save:  ₡20,359.41
L2,475.75
List Price:  L3,466.15
You save:  L990.40
₲747,391.81
List Price:  ₲1,046,378.43
You save:  ₲298,986.62
$U3,833.15
List Price:  $U5,366.56
You save:  $U1,533.41
zł402.67
List Price:  zł563.75
You save:  zł161.08
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.