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
€93.70
List Price:  €131.19
You save:  €37.48
£80.17
List Price:  £112.24
You save:  £32.07
CA$137.56
List Price:  CA$192.60
You save:  CA$55.03
A$155.17
List Price:  A$217.25
You save:  A$62.07
S$135.98
List Price:  S$190.37
You save:  S$54.39
HK$783.01
List Price:  HK$1,096.25
You save:  HK$313.23
CHF 90.89
List Price:  CHF 127.26
You save:  CHF 36.36
NOK kr1,101.16
List Price:  NOK kr1,541.68
You save:  NOK kr440.51
DKK kr699.21
List Price:  DKK kr978.92
You save:  DKK kr279.71
NZ$168.70
List Price:  NZ$236.19
You save:  NZ$67.48
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳10,942.52
List Price:  ৳15,319.96
You save:  ৳4,377.44
₹8,353.31
List Price:  ₹11,694.97
You save:  ₹3,341.66
RM478.30
List Price:  RM669.64
You save:  RM191.34
₦129,687.03
List Price:  ₦181,567.03
You save:  ₦51,880
₨27,754.24
List Price:  ₨38,857.05
You save:  ₨11,102.81
฿3,676.55
List Price:  ฿5,147.32
You save:  ฿1,470.77
₺3,250.48
List Price:  ₺4,550.80
You save:  ₺1,300.32
B$523.28
List Price:  B$732.62
You save:  B$209.33
R1,903.66
List Price:  R2,665.20
You save:  R761.54
Лв183.15
List Price:  Лв256.41
You save:  Лв73.26
₩137,464.20
List Price:  ₩192,455.38
You save:  ₩54,991.18
₪378.95
List Price:  ₪530.55
You save:  ₪151.59
₱5,720.89
List Price:  ₱8,009.48
You save:  ₱2,288.58
¥15,440.72
List Price:  ¥21,617.62
You save:  ¥6,176.90
MX$1,696.11
List Price:  MX$2,374.63
You save:  MX$678.51
QR363.78
List Price:  QR509.31
You save:  QR145.52
P1,378.02
List Price:  P1,929.29
You save:  P551.26
KSh13,298.67
List Price:  KSh18,618.67
You save:  KSh5,320
E£4,850.08
List Price:  E£6,790.31
You save:  E£1,940.22
ብር5,673.01
List Price:  ብር7,942.45
You save:  ብር2,269.43
Kz83,741.62
List Price:  Kz117,241.62
You save:  Kz33,500
CLP$97,883.21
List Price:  CLP$137,040.41
You save:  CLP$39,157.20
CN¥723.83
List Price:  CN¥1,013.40
You save:  CN¥289.56
RD$5,893.56
List Price:  RD$8,251.22
You save:  RD$2,357.66
DA13,447.21
List Price:  DA18,826.63
You save:  DA5,379.42
FJ$227.04
List Price:  FJ$317.87
You save:  FJ$90.82
Q775.43
List Price:  Q1,085.64
You save:  Q310.20
GY$20,874.74
List Price:  GY$29,225.48
You save:  GY$8,350.73
ISK kr14,084.59
List Price:  ISK kr19,718.99
You save:  ISK kr5,634.40
DH1,011.98
List Price:  DH1,416.82
You save:  DH404.83
L1,789.85
List Price:  L2,505.87
You save:  L716.01
ден5,767.34
List Price:  ден8,074.51
You save:  ден2,307.16
MOP$804.17
List Price:  MOP$1,125.87
You save:  MOP$321.70
N$1,897.84
List Price:  N$2,657.05
You save:  N$759.21
C$3,669.73
List Price:  C$5,137.77
You save:  C$1,468.04
रु13,346.58
List Price:  रु18,685.75
You save:  रु5,339.16
S/375.13
List Price:  S/525.19
You save:  S/150.06
K378.96
List Price:  K530.57
You save:  K151.60
SAR375.09
List Price:  SAR525.14
You save:  SAR150.05
ZK2,519.95
List Price:  ZK3,528.03
You save:  ZK1,008.08
L466.17
List Price:  L652.66
You save:  L186.48
Kč2,369.01
List Price:  Kč3,316.71
You save:  Kč947.70
Ft36,915.02
List Price:  Ft51,682.51
You save:  Ft14,767.48
SEK kr1,089.22
List Price:  SEK kr1,524.96
You save:  SEK kr435.73
ARS$86,913.85
List Price:  ARS$121,682.87
You save:  ARS$34,769.02
Bs690.45
List Price:  Bs966.66
You save:  Bs276.20
COP$391,130.80
List Price:  COP$547,598.77
You save:  COP$156,467.96
₡49,957.95
List Price:  ₡69,943.14
You save:  ₡19,985.18
L2,461.44
List Price:  L3,446.12
You save:  L984.67
₲737,867.79
List Price:  ₲1,033,044.43
You save:  ₲295,176.63
$U3,889.78
List Price:  $U5,445.86
You save:  $U1,556.07
zł405.87
List Price:  zł568.23
You save:  zł162.36
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.