Lens - Script #3

Unreal Engine 4: Character Skill System White Magic - Lens of Truth
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
€92.72
List Price:  €129.81
You save:  €37.09
£79.26
List Price:  £110.97
You save:  £31.71
CA$135.49
List Price:  CA$189.69
You save:  CA$54.20
A$153.49
List Price:  A$214.89
You save:  A$61.40
S$134.92
List Price:  S$188.90
You save:  S$53.97
HK$782.50
List Price:  HK$1,095.53
You save:  HK$313.03
CHF 90.16
List Price:  CHF 126.23
You save:  CHF 36.07
NOK kr1,085.06
List Price:  NOK kr1,519.13
You save:  NOK kr434.06
DKK kr691.90
List Price:  DKK kr968.69
You save:  DKK kr276.78
NZ$167.41
List Price:  NZ$234.39
You save:  NZ$66.97
د.إ367.19
List Price:  د.إ514.08
You save:  د.إ146.89
৳10,980.73
List Price:  ৳15,373.46
You save:  ৳4,392.73
₹8,335.04
List Price:  ₹11,669.39
You save:  ₹3,334.35
RM472.40
List Price:  RM661.38
You save:  RM188.98
₦139,532.04
List Price:  ₦195,350.44
You save:  ₦55,818.40
₨27,813.53
List Price:  ₨38,940.06
You save:  ₨11,126.52
฿3,638.31
List Price:  ฿5,093.78
You save:  ฿1,455.47
₺3,237.16
List Price:  ₺4,532.16
You save:  ₺1,294.99
B$501.53
List Price:  B$702.17
You save:  B$200.63
R1,888.66
List Price:  R2,644.21
You save:  R755.54
Лв180.76
List Price:  Лв253.07
You save:  Лв72.31
₩134,741.70
List Price:  ₩188,643.77
You save:  ₩53,902.07
₪367.71
List Price:  ₪514.81
You save:  ₪147.10
₱5,617.33
List Price:  ₱7,864.49
You save:  ₱2,247.16
¥15,132.45
List Price:  ¥21,186.03
You save:  ¥6,053.58
MX$1,658.17
List Price:  MX$2,321.51
You save:  MX$663.33
QR364.88
List Price:  QR510.84
You save:  QR145.96
P1,378.06
List Price:  P1,929.34
You save:  P551.28
KSh13,256.67
List Price:  KSh18,559.87
You save:  KSh5,303.20
E£4,744.14
List Price:  E£6,641.99
You save:  E£1,897.84
ብር5,687.29
List Price:  ብር7,962.44
You save:  ብር2,275.14
Kz83,433.85
List Price:  Kz116,810.73
You save:  Kz33,376.88
CLP$98,290.17
List Price:  CLP$137,610.17
You save:  CLP$39,320
CN¥722.08
List Price:  CN¥1,010.95
You save:  CN¥288.86
RD$5,924.54
List Price:  RD$8,294.60
You save:  RD$2,370.05
DA13,479.97
List Price:  DA18,872.49
You save:  DA5,392.52
FJ$225.66
List Price:  FJ$315.94
You save:  FJ$90.27
Q780.13
List Price:  Q1,092.22
You save:  Q312.08
GY$20,949.30
List Price:  GY$29,329.86
You save:  GY$8,380.56
ISK kr13,941.60
List Price:  ISK kr19,518.80
You save:  ISK kr5,577.20
DH1,013.74
List Price:  DH1,419.27
You save:  DH405.53
L1,764.37
List Price:  L2,470.19
You save:  L705.82
ден5,702.11
List Price:  ден7,983.18
You save:  ден2,281.07
MOP$806.29
List Price:  MOP$1,128.85
You save:  MOP$322.55
N$1,909.24
List Price:  N$2,673.01
You save:  N$763.77
C$3,682.20
List Price:  C$5,155.22
You save:  C$1,473.02
रु13,347.49
List Price:  रु18,687.02
You save:  रु5,339.53
S/372.08
List Price:  S/520.93
You save:  S/148.85
K382.87
List Price:  K536.04
You save:  K153.16
SAR375.15
List Price:  SAR525.22
You save:  SAR150.07
ZK2,481.24
List Price:  ZK3,473.83
You save:  ZK992.59
L460.94
List Price:  L645.33
You save:  L184.39
Kč2,346.52
List Price:  Kč3,285.22
You save:  Kč938.70
Ft36,532.34
List Price:  Ft51,146.74
You save:  Ft14,614.40
SEK kr1,069.05
List Price:  SEK kr1,496.71
You save:  SEK kr427.66
ARS$85,802.56
List Price:  ARS$120,127.02
You save:  ARS$34,324.45
Bs691.35
List Price:  Bs967.92
You save:  Bs276.56
COP$386,901.39
List Price:  COP$541,677.43
You save:  COP$154,776.03
₡50,320.66
List Price:  ₡70,450.94
You save:  ₡20,130.27
L2,469.73
List Price:  L3,457.73
You save:  L987.99
₲739,686.52
List Price:  ₲1,035,590.72
You save:  ₲295,904.20
$U3,756.16
List Price:  $U5,258.77
You save:  $U1,502.61
zł399
List Price:  zł558.62
You save:  zł159.61
Already have an account? Log In

Transcript

Welcome back everyone. In this video we're going to continue on creating some more scripts for our Lens of Truth skill. In this video, specifically, we're going to be creating a camera effects to play once our Lens of Truth magic has been turned on. So we did a little effect, you may remember a few videos back where when we turned our Lens of Truth on and off, the camera sort of zoomed in zoomed out. It was a real subtle effect, but it looked kind of nice. Let us know the user know that something has taken place something different has taken place.

All these subtle effects really add up. Let's get right to it. We're going to work in our BP player for this one. Here is the pathway how to get there, double click on your BP player. And we're going to continue working on in our white magic tab over here. And if you don't see that, remember, you've got your Graph tab over here you can double click on white magic To open that tab in, here's where we were building out our Lens of Truth skill.

We have this sequence node right up here where we built off this Lens of Truth on section, right to the right of this is where we are going to be building a timeline that is going to be used to control our camera effect. We're going to right click in some empty space, and type in a time line and we're going to add a timeline. Let me zoom on up here a little bit. We'll call this lens camera FX. And this is a special note that allows us to double click on it and when we do, we open up our timeline editor here, let's add a float track and name it alpha. And this is going to be a really short track.

So I'm going to change the length here to be point one, five seconds and you can see that white portion of our graph is now shrunk to reflect that the length of our timeline here is really short. I'm just going to right click to center it up here, hold CTRL and mouse wheel and just to zoom on up a little bit. Okay, so I'm going to add two keys to this, I can hold down shift and left click, that'll add a key. And I can also right click to add a key two different ways to add keys here. Long story short, you want to have two keys out here. Let's select our first key.

And with the first key selected, I'm going to set the time to be zero and the value to be zero. And for our second key, select that so that it's yellow. Let's set the time to be point one five in the value to be one. So we're going from and if I click this zoom to fit vertical, you can now see both these keys in view. So we are going from a value of zero to a value of one over point one, five seconds, that is going to be very useful for us. As we make our way out of this timeline, let's click back in our white magic tab.

So now we got this timeline with an alpha output. How can we use this output? Well, we want to drag out of our alpha here. And we want to search for a alert node. We're looking for float loop. And the tooltip even tells you what this does it linearly interpolates between A and B based on an alpha 100% of a when alpha is zero and 100% of B when alpha is one.

So what that is saying and it plugged it into the wrong input for us, so I'm going to hold down alt and left click, we want to plug this into our alpha value here. So what this is saying is when, when a when a, we are at 100% of a when alpha is zero, so our timeline, remember, starts at a value of zero, our alpha is zero, meaning that our return value will be 100% of what we plug into a. and the value we're going to want here is 90. And you'll see what we're going to do with these values here in just a little bit. And then when we are when alpha is one, we are going to be at our value of be 100. So we're going between a value of a at zero seconds to value of b. at point one five seconds, that value is going to change from 90 to 100.

Let me show you exactly how this works. We're going to bring in our side view camera. Drag this in and off of our side view camera. We're going to drag off in this and we are going to set field of view. So fo V or field of view is essentially going to give us a sort of zoom in or zoom out effect, depending on what kind of number that you plug into it. Now how did I know that I could even modify this about my side view camera?

Well, if you select your side view camera over in the components panel, over in the Details panel, you have a field of view property that you can change and you can see that it defaults to 90, so it's no mistake that I'm starting at an A value here of 90. Okay, so I'm going to take the return value here and plug it into our new field of view here. And as we update our timeline here, we're going to plug this into our set field of view and out of our sequence node, then one is doing all this bit of script or the Then zeros doing this bit of script, then one we're going to play from start this timeline so very rapidly over the course of point one to five seconds, it's going to go from an F o v, a camera fo V of 90 to a camera field of view of 100.

Okay. That's not all we want to do. I also want to drag off of this one more time and bring in another loop node, I'm looking for a float loop. And again, it's going to have it plugged into the wrong one by default. I'm going to hold down the Alt key left click to break that. Let's plug this into our alpha right here.

And for this, I'm gonna have my a value bs zero and my B value is going to be point zero or not point 08 point eight. We're going to use this alpha for something else. My sideview camera I'm going to drag off of this one more time. And I'm going to type in post process settings. So what I'm looking for is a setting of post process settings. That guy right here.

Now post process is basically a visual effect that you can add to your camera, you can do all kinds of post process effects on a camera, things like just simply coloring your camera a certain tint, you can give it sort of that grainy television sort of filter, all kinds of things that are way beyond the scope of this video. But we are going to change one thing about this one of our post process settings if I drag backwards off of this, I want to make a post process setting. That's gonna give me this note in effect. If I click this drop down, you can see that there's nothing here. Because we need to specify over in the details, what post process setting we want to add to this make post process setting node, there are so many things that we could change. This is sort of a special note where we have to tell it, what do you want to change?

Well, there's one called vignette intensity. And I'm just gonna search for it up in the Details panel to make my life easier then yet intensity. There it is right there. If I click this, you'll now see it added to my make post process setting node. And I want to plug in the return value to my vignette intensity setting. What vignette intensity does is it sort of creates this shadowing effect around the borders of your screen, kind of like you're dreaming.

That's the kind of effect I'm going for here. And once we get this all fired up and working, I'll point that out to you. So let's plug this execution wire. into our set right here. And that is looking pretty good. Let's drag out a marquee selection around this bit of script, tap the C key, and I'll call this lens active camera.

Okay, so this is a sort of special camera effect that I want to do when we activate this camera, we're going to change our cameras Field of View from 90 to 100. And we're also going to do this sort of vignette intensity as a sort of the sort of black shadowing around the perimeter of the screen. But when I deactivate our Lens of Truth ability, I want to undo this effect. So how am I going to do that? Well, right in front of our timeline here, I'm going to right click and I'm going to add a custom event and I'm going to call this Custom Event lens D activated. And I'm going to plug this into the reverse input of my timeline.

So this is essentially going to play the timeline backwards to undo all of these settings. So our FLV, which changes from 90 to 100, will now go from 100 back to 90. And our vignette intensity will go from zero to 80 when it's first played, and then when this gets called, it'll go from point eight back to zero. Okay, so this is a custom event. Now something has to Call this Custom Event for actually to fire off. And one of the ways that we are going to deactivate our Lens of Truth is by basically using the Lens of Truth again.

So we have this thing where we can actually activate it, but we can also manually deactivated so when we do eventually activate it This is going to be set to true ease using the lens is going to be set to true. Now if it is true that we are using the lens when we press the appropriate button to eventually call this event, I'm going to drag off of this and type in lens D activated when we call it lens deactivated. There we go, spelt it wrong. So again, when we eventually fire this off, we're going to be checking are we using the Lens of Truth if we are not already using it, it'll evaluate to false and we're going to check to see if we have enough magic and eventually fire this all off. Now once it is activated, we're then going to be checking are we using it again, if we try to use it again, and if we are using it, we're going to deactivate it.

So essentially we're going to be able to toggle this one on and off manually. If we want you again this is just going to be one of the ways that our lens can be deactivated. alright with that, let's go ahead and Compile and Save guys that should just about do it for this one. We've got a comment box around all this. Still plenty more work to be done but we're making strides. See you all in the next video

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.