White Magic Menu - Script #1

18 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
€96.21
List Price:  €134.70
You save:  €38.49
£79.93
List Price:  £111.90
You save:  £31.97
CA$143.79
List Price:  CA$201.32
You save:  CA$57.52
A$160.48
List Price:  A$224.69
You save:  A$64.20
S$135.83
List Price:  S$190.17
You save:  S$54.33
HK$777.07
List Price:  HK$1,087.93
You save:  HK$310.86
CHF 89.45
List Price:  CHF 125.24
You save:  CHF 35.78
NOK kr1,141.95
List Price:  NOK kr1,598.78
You save:  NOK kr456.82
DKK kr717.64
List Price:  DKK kr1,004.72
You save:  DKK kr287.08
NZ$177.52
List Price:  NZ$248.53
You save:  NZ$71.01
د.إ367.25
List Price:  د.إ514.17
You save:  د.إ146.91
৳11,994.74
List Price:  ৳16,793.12
You save:  ৳4,798.37
₹8,496.63
List Price:  ₹11,895.62
You save:  ₹3,398.99
RM450.75
List Price:  RM631.07
You save:  RM180.32
₦155,628.43
List Price:  ₦217,886.03
You save:  ₦62,257.60
₨27,934.96
List Price:  ₨39,110.06
You save:  ₨11,175.10
฿3,444.45
List Price:  ฿4,822.37
You save:  ฿1,377.92
₺3,518.54
List Price:  ₺4,926.10
You save:  ₺1,407.55
B$617.53
List Price:  B$864.57
You save:  B$247.04
R1,837.80
List Price:  R2,572.99
You save:  R735.19
Лв188.31
List Price:  Лв263.64
You save:  Лв75.33
₩144,872.25
List Price:  ₩202,826.95
You save:  ₩57,954.69
₪364.89
List Price:  ₪510.86
You save:  ₪145.97
₱5,883.01
List Price:  ₱8,236.45
You save:  ₱2,353.44
¥15,672.80
List Price:  ¥21,942.55
You save:  ¥6,269.75
MX$2,028.91
List Price:  MX$2,840.56
You save:  MX$811.64
QR366.34
List Price:  QR512.89
You save:  QR146.55
P1,382.59
List Price:  P1,935.69
You save:  P553.09
KSh12,923.70
List Price:  KSh18,093.70
You save:  KSh5,170
E£5,091.27
List Price:  E£7,127.98
You save:  E£2,036.71
ብር12,764.56
List Price:  ብር17,870.89
You save:  ብር5,106.33
Kz91,790.82
List Price:  Kz128,510.82
You save:  Kz36,720
CLP$99,155.08
List Price:  CLP$138,821.08
You save:  CLP$39,666
CN¥729.81
List Price:  CN¥1,021.77
You save:  CN¥291.95
RD$6,104.52
List Price:  RD$8,546.58
You save:  RD$2,442.05
DA13,454.60
List Price:  DA18,836.98
You save:  DA5,382.37
FJ$232.11
List Price:  FJ$324.96
You save:  FJ$92.85
Q773.21
List Price:  Q1,082.52
You save:  Q309.31
GY$21,000.46
List Price:  GY$29,401.48
You save:  GY$8,401.02
ISK kr13,903.60
List Price:  ISK kr19,465.60
You save:  ISK kr5,562
DH1,007.40
List Price:  DH1,410.40
You save:  DH403
L1,841.78
List Price:  L2,578.57
You save:  L736.78
ден5,922.50
List Price:  ден8,291.74
You save:  ден2,369.23
MOP$803.42
List Price:  MOP$1,124.82
You save:  MOP$321.40
N$1,834.70
List Price:  N$2,568.66
You save:  N$733.95
C$3,694.32
List Price:  C$5,172.20
You save:  C$1,477.87
रु13,665.58
List Price:  रु19,132.35
You save:  रु5,466.77
S/374.71
List Price:  S/524.60
You save:  S/149.89
K406.86
List Price:  K569.63
You save:  K162.76
SAR375.72
List Price:  SAR526.02
You save:  SAR150.30
ZK2,777.96
List Price:  ZK3,889.25
You save:  ZK1,111.29
L478.81
List Price:  L670.35
You save:  L191.54
Kč2,418.25
List Price:  Kč3,385.65
You save:  Kč967.40
Ft39,800.47
List Price:  Ft55,722.25
You save:  Ft15,921.78
SEK kr1,103.66
List Price:  SEK kr1,545.17
You save:  SEK kr441.50
ARS$102,190.76
List Price:  ARS$143,071.15
You save:  ARS$40,880.39
Bs693.61
List Price:  Bs971.08
You save:  Bs277.47
COP$437,799.12
List Price:  COP$612,936.28
You save:  COP$175,137.16
₡50,480.33
List Price:  ₡70,674.48
You save:  ₡20,194.15
L2,548.03
List Price:  L3,567.35
You save:  L1,019.31
₲784,126.06
List Price:  ₲1,097,807.85
You save:  ₲313,681.79
$U4,460.41
List Price:  $U6,244.75
You save:  $U1,784.34
zł409.96
List Price:  zł573.96
You save:  zł164
Already have an account? Log In

Transcript

Welcome everyone in this video Our goal is to create some script inside of our Player Controller to make our white magic menu come on and off the screen at will. We're going to be starting off in our project settings here. So in your toolbar area, find your settings button, and in your settings drop down, click on project settings, and you may have remembered this step for bringing on and off our black magic menu. But over here on the left hand side, find your input category. And just as we did with creating a black magic menu, event action mapping, we are going to create a white magic menu action mapping here so click this plus button again note that this is going to be an action mapping, not an access mapping. Click this plus button.

We will name this new mapping white magic menu I'm going to bind this to I'm going to go with the right control key on the keyboard. And the reason I'm going with the right control key is because I have one of those longer keyboards here. So I've got my up down left right arrows kind of on the right hand side of my keyboard, and the right mouse control key is directly adjacent to that. So that's gonna kind of serve as my left shoulder button, which is the other key I want to bind to this. I'm going to click right here, this plus button to add an action mapping for this group. And I also want to bind this to the left shoulder button on a gamepad controller.

With that done, we can just close out of our project settings there's no Save button or anything here. And Next I am going to jump into our Player Controller Metroidvania asset that is in this directory right here content Metroidvania blueprints friends. Work. Let's double click on this guy to open it up. And we're going to be doing some work over here in the Event Graph. Find wherever you have Event Begin Play.

Currently, we are doing Event Begin Play, and then we're creating a reference to our Blackmagic menu. We want to do the same with our white magic menus. So a way we can do this and keep this nice and neat and organized is off of Event Begin Play. Let's hold down the S key and left click to bring in a sequence node. I'm going to wind our event through here. And now off of one event, Begin Play I can do this and then also do this off of the event one output, I'm going to create another widget.

And the widget that I'm going to create down here is going to be our w BP white magic menu right there. And then I'm gonna Right click on our return value here, right click, and we're going to promote this to a variable. And I will call this w BP underscore, W magic menu. And just to keep things nice and organized, I'm going to drag this up in my list of variables and drop it right about there. And then I'm going to left click and drag around these two nodes, tap that C key, and type W, magic menu, reference. So now we are storing our white magic menu inside of a variable and we're going to need that for some steps upcoming here.

Okay, so that is out of the way. Let's come under where we are showing and hiding our black magic menu. You may remember this monster script. It's actually not that bad that we created earlier. Well, we're going to do something very similar for creating rather I should say, showing our own white magic menu. So the good news here is we can copy a whole lot of nodes.

There is some stuff over here for showing the Starburst upon selection, we're not gonna worry about that just yet. I'm talking about this main block of nodes right here. Try to frame it up. There we go. So let's left click and drag around all these nodes. Note that I am skipping that event node at the very beginning.

So select all of these from our getting of our HUD all the way over to our setting the input modes. So all those are selected, I'm going to hit Ctrl C to copy and I'm going to come down in my Event Graph a little bit, find some space right in here, and I'm going to hit Ctrl V. And I am going to extend out this comment box right here because we're going to need a little bit more space inside here. And then I'm going to drag these on over to the rights like so. Okay, so next, I'm going to change the name of our comment box here from show hide black magic menu to white magic menu. And we need an event. To kick this all off.

Well, we just created one in our project settings. So let's right click here and type in white magic menu there is our action event. And the reason I created this bit of space between our event node here and the rest of our script, is we need to do a special check at the very front of this. But before we do that, and before I forget, I wanted to make note here that with this input action white magic menu note in here, you need to select this node. And over in the Details panel. We've got this execute one pause that is currently unchecked, we need to make sure that this is checked.

And the reason again is because when we press this button while the game is running, we are going to be pausing the game. And the only way that we can have this release event fire off and be detected is if we have this set to be executing when the pause so very important step there. Okay, so with all this in here, what is the thing that we need to do a check for? Well, I need to firstly right click and bring in a Get Player Character node. off of this let's drag out and see if our BP player let's do our cast to our BP player. So often pressing we're going to cast to our BP player like so.

And the reason we're casting to our BP player is because inside of our BP player, if I drag off here, we can find a variable called w magic ready? We're going to get b w magic ready, that's Boolean w magic ready. And then we're going to drag off of here and plug this into a branch node. Make sure we got our execution wires hooked up like so. So why are we doing this? Why are we doing a check for this before we can then even do the rest of this script over here.

The reason being is because unlike our black magic skills, our white magic skills are gonna have some cooldown associated with them. So we're going to make it so that the only time that you can bring on your white magic menu is if we aren't already using some white magic. It is basically being unused and we can swap out to a different white magic. So once we are finished turning into mist, for example, in our midst has expired returned back into human form. This is Then going to be set back to Yes, you can use white magic again. And that is the only time we want to be able to show or hide this white magic menu.

Okay, so if this is true that our white magic menu is ready to be brought on, meaning we're not transformed into mist or so forth. If that's true, we're going to bring in another sequence node. And off of this then zero pin. We're going to then hook this into the rest of our script. Now currently, it's meant to Add to Viewport RB magic menu, but we're gonna swap some of these variables out in just a little bit. What are we going to do off of this then one pin?

Well, that remains to be seen. We'll get to that in just a moment. But before we get any further with this off of this false branch, if our white magic is not ready, I'm going to drag off here and type in play sound 2d. I kind of want to have a sound play, if that turns to be false, so the sound I want to slot in here is going to be VR underscore negative. This one right here VR negative Q. And again, note that this is in our engine content.

And I've showed you multiple times how to get there. If you go to View Options and show engine content, you too can make use of this sound. So I'm going to plug that into there. And then I'm going to right click on this pin promote this to a variable and I will call this s FX underscore action dis allowed action disallow that sounds rather heavy handed. I am going to bring on some of the other options here by clicking this little drop down. I'm going to set the volume multiplier here to the point two, three, a little bit quieter than that.

Defaults in that is good to go. There. Okay, so I could probably bring these a little bit closer now the rest of these nodes. Before we go on to what happens when we release our white magic menu button, let's swap out some of our variables here in this chain. Because remember, we copy these all from our black magic menu, or from our black magic script right up above. So here we're saying we want to hide our w BP HUD and show our w BP black magic menu.

Well, that's not really the case anymore. We want to bring on our w BP w magic menu. So we're gonna get that and now simply kind of swapping out our wires here. So I want to add that the viewport we can mix that while holding down ALT and left clicking will actually just let me do it. Z here to bring those all back on, because it deleted them all I kind of want you to see where all these wires are going to end from. So I'm going to plug this into our play animation.

And then I'm going to drag out of my w magic menu and instead of the Big Magic menu intro, I'm going to drag out of here and look for W magic intro there is my w magic intro animation. Let's plug that into the in animation here. And lastly, we need to make sure that we take our w magic menu and plug this into the Remove from Parent all the script down here is going to be when we release the button it's gonna eventually plug into here and continue forth. Okay, and we don't need this be magic menu intro animation so we can delete that guy out Caleb's script, scroll over to the right a little bit and Here we've got our w BP BP magic menu. Let's bring in w BP w a magic menu, get that. And let's make sure that we make that our widget to focus on right there instead of our be magic menu.

Okay, so that is looking pretty good. Now let's kind of zoom out here scroll wheel all the way on back. And we need to work off of the release button of our input action white magic menu. So what I want to do is I'm going to hold down the G key, and left click and I'm going to bring in a gate node. Now explain how this works. You haven't used one of these in a little bit.

When we release our button here. We're going to plug this into our gates. A gate is kind of self explanatory, like you know what a gate is. a gate is a barrier of sorts. You walk up to a gates, it could be locked. It could be open, can you proceed?

Well, how do we know if it is open or closed? Well, we can plug things in here to determine if this thing is open or closed. By default, we're saying that this gate, this bit of script beyond this barrier right here is going to be closed, meaning that even if we release this key right now, it would be considered close and this would not fire off in thusly execute the script beyond. What do we want to have open this gate? Well, when I press the white magic menu button, when I press it, we're going to be doing this check to see if the white magic is met is ready. And then we got a sequence here and off of my event, one output I am going to then plug this into the opening of our gate to say yes, our gate is now open and capable of being traversed upon or beyond, I should say So that the rest of the script can fire off when we release the button.

Let me just bring in a reroute node here, kind of reposition this a little bit. Okay. So as soon as we press the button, we're going to send a signal right here from our sequence node that opens our gate. After we exit our gate, I'm going to bring in a sequence node and out of our then zero pin, I'm going to plug that into our adding of our HUD back to our viewport and we're going to continue forth like so. playing some sounds on pausing the game, etc. Now the reason I added a sequence node right here is because off of our then one pin right here, I'm going to plug this into our closing of the gait let me just bring in a couple of reroute nodes here by double clicking.

So you can sort of see that flow. And then I'll make it so that we have closed our gate once again and it can only be traversed upon again, once we press the our, our action key here and open it up once again. Okay, so I think that should just about do it here. Let's just kind of take a quick Gander, to make sure everything is right here. Let's compile Firstly, to make sure everything in our script looks good to go. Let's save.

I'm going to jump in and play here. Okay, I'm gonna hit my right control key. There is my white magic menu release. Let me try it on my control pad as well. The left shoulder button looks pretty good there is well. Now I just exited out here and I have a little error.

Let's see what the error could be. Alright, and it looks like this is an error. You probably did not encounter because I did something, quote unquote special. While I was exiting out of my game when I had my w magic menu up, I was actually pressing on the arrow keys. I had the right arrow key held down when I then escaped in this is how I got that error. I bet if I jump back to my PC Metroidvania here and I went over to where I'm doing this hiding the acquired Let me see that Message Log error exists none.

Okay, and Roof Repair, okay, if I learned skill right there, if I jump back here into my PC Metroidvania right where I'm hiding my skill Widget Blueprint and I'm doing all of this stuff. If I drag off of here and type in is valid, the question mark version. Let me just kind of move this all over to the right here. Little bit and I sneak this in up there that should fix that issue again, you probably are not seeing this issue because I did a very specific thing with my keys there or to get that issue to arise this message issue. But if you are getting this sort of an access none trying to read w BP learned skill sneak in and is valid node into this section of your script here in PC Metroidvania that should clean that up. Something else I wanted to point out here when I click play.

Okay, so I'm gonna hold down my button to bring up my white magic menu. If I use my w a s and D keys. Look at my HUD area in the upper right hand corner. It is not showing the appropriate icon. Don't worry about that for now that is a known issue that we'll get fixed up in a future video here. Anyways guys that will do it all for this video still more work to be done but we will 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.