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
€96.03
List Price:  €134.44
You save:  €38.41
£78.97
List Price:  £110.57
You save:  £31.59
CA$143.92
List Price:  CA$201.50
You save:  CA$57.57
A$160.15
List Price:  A$224.22
You save:  A$64.06
S$135.90
List Price:  S$190.26
You save:  S$54.36
HK$776.95
List Price:  HK$1,087.76
You save:  HK$310.81
CHF 89.61
List Price:  CHF 125.46
You save:  CHF 35.85
NOK kr1,132.24
List Price:  NOK kr1,585.18
You save:  NOK kr452.94
DKK kr716.48
List Price:  DKK kr1,003.10
You save:  DKK kr286.62
NZ$176.72
List Price:  NZ$247.41
You save:  NZ$70.69
د.إ367.25
List Price:  د.إ514.17
You save:  د.إ146.91
৳11,949.45
List Price:  ৳16,729.71
You save:  ৳4,780.25
₹8,504.71
List Price:  ₹11,906.93
You save:  ₹3,402.22
RM450.50
List Price:  RM630.72
You save:  RM180.22
₦155,597.43
List Price:  ₦217,842.63
You save:  ₦62,245.20
₨27,817.89
List Price:  ₨38,946.16
You save:  ₨11,128.27
฿3,454.30
List Price:  ฿4,836.16
You save:  ฿1,381.86
₺3,507.24
List Price:  ₺4,910.28
You save:  ₺1,403.03
B$630.94
List Price:  B$883.35
You save:  B$252.40
R1,822.81
List Price:  R2,552.01
You save:  R729.20
Лв187.70
List Price:  Лв262.78
You save:  Лв75.08
₩144,917.66
List Price:  ₩202,890.52
You save:  ₩57,972.86
₪361.94
List Price:  ₪506.74
You save:  ₪144.79
₱5,900.06
List Price:  ₱8,260.32
You save:  ₱2,360.26
¥15,702.92
List Price:  ¥21,984.72
You save:  ¥6,281.80
MX$2,038.30
List Price:  MX$2,853.70
You save:  MX$815.40
QR368.69
List Price:  QR516.19
You save:  QR147.49
P1,365.11
List Price:  P1,911.21
You save:  P546.09
KSh12,923.70
List Price:  KSh18,093.70
You save:  KSh5,170
E£5,089.47
List Price:  E£7,125.47
You save:  E£2,035.99
ብር12,635.69
List Price:  ብር17,690.47
You save:  ብር5,054.78
Kz91,513.08
List Price:  Kz128,121.98
You save:  Kz36,608.89
CLP$99,000
List Price:  CLP$138,603.96
You save:  CLP$39,603.96
CN¥729.57
List Price:  CN¥1,021.43
You save:  CN¥291.86
RD$6,083.32
List Price:  RD$8,516.89
You save:  RD$2,433.57
DA13,417.46
List Price:  DA18,784.98
You save:  DA5,367.52
FJ$231.78
List Price:  FJ$324.51
You save:  FJ$92.72
Q770.27
List Price:  Q1,078.41
You save:  Q308.14
GY$20,904.88
List Price:  GY$29,267.67
You save:  GY$8,362.78
ISK kr13,874.61
List Price:  ISK kr19,425.01
You save:  ISK kr5,550.40
DH998.53
List Price:  DH1,397.99
You save:  DH399.45
L1,842.29
List Price:  L2,579.28
You save:  L736.99
ден5,908.76
List Price:  ден8,272.50
You save:  ден2,363.74
MOP$800.37
List Price:  MOP$1,120.56
You save:  MOP$320.18
N$1,804.90
List Price:  N$2,526.94
You save:  N$722.03
C$3,679.90
List Price:  C$5,152.01
You save:  C$1,472.10
रु13,596.02
List Price:  रु19,034.98
You save:  रु5,438.95
S/373.62
List Price:  S/523.08
You save:  S/149.46
K405.04
List Price:  K567.08
You save:  K162.03
SAR375.67
List Price:  SAR525.96
You save:  SAR150.28
ZK2,767.31
List Price:  ZK3,874.34
You save:  ZK1,107.03
L477.70
List Price:  L668.80
You save:  L191.10
Kč2,412.77
List Price:  Kč3,377.98
You save:  Kč965.20
Ft39,808.32
List Price:  Ft55,733.24
You save:  Ft15,924.92
SEK kr1,103.71
List Price:  SEK kr1,545.23
You save:  SEK kr441.52
ARS$102,213.30
List Price:  ARS$143,102.71
You save:  ARS$40,889.41
Bs690.92
List Price:  Bs967.31
You save:  Bs276.39
COP$438,077.06
List Price:  COP$613,325.41
You save:  COP$175,248.35
₡50,326.04
List Price:  ₡70,458.47
You save:  ₡20,132.42
L2,538.30
List Price:  L3,553.73
You save:  L1,015.42
₲780,569.17
List Price:  ₲1,092,828.06
You save:  ₲312,258.89
$U4,458.42
List Price:  $U6,241.97
You save:  $U1,783.54
zł409.45
List Price:  zł573.24
You save:  zł163.79
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.