Fireball - Player Setup

11 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
€95.85
List Price:  €134.19
You save:  €38.34
£79.54
List Price:  £111.35
You save:  £31.81
CA$143.73
List Price:  CA$201.23
You save:  CA$57.50
A$159.93
List Price:  A$223.91
You save:  A$63.97
S$135.54
List Price:  S$189.77
You save:  S$54.22
HK$777.83
List Price:  HK$1,089
You save:  HK$311.16
CHF 89.34
List Price:  CHF 125.09
You save:  CHF 35.74
NOK kr1,131.88
List Price:  NOK kr1,584.68
You save:  NOK kr452.80
DKK kr715.08
List Price:  DKK kr1,001.15
You save:  DKK kr286.06
NZ$176.75
List Price:  NZ$247.46
You save:  NZ$70.70
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳11,945.33
List Price:  ৳16,723.94
You save:  ৳4,778.61
₹8,493.77
List Price:  ₹11,891.62
You save:  ₹3,397.85
RM450.75
List Price:  RM631.07
You save:  RM180.32
₦154,938.50
List Price:  ₦216,920.10
You save:  ₦61,981.60
₨27,824.38
List Price:  ₨38,955.25
You save:  ₨11,130.86
฿3,419.79
List Price:  ฿4,787.84
You save:  ฿1,368.05
₺3,519.01
List Price:  ₺4,926.76
You save:  ₺1,407.74
B$608.53
List Price:  B$851.97
You save:  B$243.44
R1,830.80
List Price:  R2,563.19
You save:  R732.39
Лв187.32
List Price:  Лв262.25
You save:  Лв74.93
₩144,627.53
List Price:  ₩202,484.33
You save:  ₩57,856.80
₪365.39
List Price:  ₪511.57
You save:  ₪146.17
₱5,882.91
List Price:  ₱8,236.31
You save:  ₱2,353.40
¥15,643.93
List Price:  ¥21,902.13
You save:  ¥6,258.20
MX$2,007.58
List Price:  MX$2,810.70
You save:  MX$803.11
QR364.41
List Price:  QR510.19
You save:  QR145.78
P1,381.63
List Price:  P1,934.33
You save:  P552.70
KSh12,923.70
List Price:  KSh18,093.70
You save:  KSh5,170
E£5,087.81
List Price:  E£7,123.14
You save:  E£2,035.32
ብር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$98,905.10
List Price:  CLP$138,471.10
You save:  CLP$39,566
CN¥729.56
List Price:  CN¥1,021.42
You save:  CN¥291.85
RD$6,087.13
List Price:  RD$8,522.23
You save:  RD$2,435.09
DA13,485.25
List Price:  DA18,879.89
You save:  DA5,394.64
FJ$231.62
List Price:  FJ$324.28
You save:  FJ$92.66
Q770.23
List Price:  Q1,078.35
You save:  Q308.12
GY$20,913.67
List Price:  GY$29,279.97
You save:  GY$8,366.30
ISK kr13,911.60
List Price:  ISK kr19,476.80
You save:  ISK kr5,565.20
DH1,006.07
List Price:  DH1,408.53
You save:  DH402.46
L1,836.70
List Price:  L2,571.46
You save:  L734.75
ден5,900.06
List Price:  ден8,260.33
You save:  ден2,360.26
MOP$800.26
List Price:  MOP$1,120.39
You save:  MOP$320.13
N$1,840.36
List Price:  N$2,576.58
You save:  N$736.22
C$3,678.42
List Price:  C$5,149.94
You save:  C$1,471.51
रु13,597.49
List Price:  रु19,037.04
You save:  रु5,439.54
S/372.23
List Price:  S/521.13
You save:  S/148.90
K405.36
List Price:  K567.52
You save:  K162.16
SAR375.62
List Price:  SAR525.88
You save:  SAR150.26
ZK2,766.46
List Price:  ZK3,873.15
You save:  ZK1,106.69
L477.10
List Price:  L667.96
You save:  L190.86
Kč2,408.98
List Price:  Kč3,372.68
You save:  Kč963.69
Ft39,689.03
List Price:  Ft55,566.23
You save:  Ft15,877.20
SEK kr1,103.13
List Price:  SEK kr1,544.43
You save:  SEK kr441.30
ARS$102,160.40
List Price:  ARS$143,028.65
You save:  ARS$40,868.24
Bs690.76
List Price:  Bs967.10
You save:  Bs276.33
COP$435,928.80
List Price:  COP$610,317.76
You save:  COP$174,388.96
₡50,434.81
List Price:  ₡70,610.75
You save:  ₡20,175.94
L2,537.51
List Price:  L3,552.62
You save:  L1,015.10
₲779,455.88
List Price:  ₲1,091,269.42
You save:  ₲311,813.53
$U4,474.38
List Price:  $U6,264.31
You save:  $U1,789.93
zł408.66
List Price:  zł572.14
You save:  zł163.48
Already have an account? Log In

Transcript

Welcome back everyone. In the last video we went about creating our BP fireball. In this one Our goal is to set up our player with the appropriate components, variables, functions, etc. In order to lay the groundwork for our player actually shooting out a fireball. So the first thing I would like to do here is to import a sound effect. I've got a fireball shooting kind of sound effect that I want to import.

You should find this attached to this particular video in the course outline. I have mine in my file explorer here. So I'm going to come to my Metroidvania audio folder, where we have been dumping our various sound effects. And with Windows Explorer open here, I'm just going to drag and drop my SF x fireball. Left click drag it down into this folder. You should be able to Find this file after you have downloaded it likely in your downloads folder, although you may have it downloading elsewhere, that will be up to you to find.

Okay, so with that imported, we can then go inside of our BP player and start working in there. So come under blueprints, characters, there's our BP player, open it up. And I've got some existing tabs open from the previous videos, I am just going to close out quickly only concerned with the BP player for now. I'm going to click on the viewport tab. So we get to see our character few things I want to add in here. The first I'm going to add is a fireball spawn point component.

That's the point that we're going to designate where we want our fireball to shoot out from. And this is going to be from an arrow component. So in my list of components, I'm going to click Add Component and I'm going to do a search. For an arrow component, there's utility arrow. There it is, and I will name it fire ball spawn points. Okay, it's this giant red arrow sticking out from our character's pelvis.

At the moment, select that. And with that selected over in the Details panel, let's change the x location of this to be 70. It's going to put it out in front a little bit, and I'm going to change the Z location to be 20. Now why this exact location? Well, because when we have our character playing a sort of casting animation, or hand is going to end up at right about this position. So that's about the spot where I want the fireball to spawn from, we can leave the rotation and the scale as is.

Okay, so with that in place, we're gonna go on to creating some variables down in our My Blueprint panel, and we're going to be working inside of our magic black fireball section of Variables right here. So when we add some variables we're going to add them to this grouping this category. Okay, so the first variable we're going to add by clicking plus variable is going to be called renaming it here. Be Used fireball course question mark this will be a Boolean again I'm going to put it in my magic black fireball a category now this use fireball the primary use of this one is going to be to drive our animation we're going to have a you know fireball casting animation. So that is a variable that's going to be passed to our animation blueprints by defaults if I compile this, I do want this to be false.

Okay, creating a another variable here coming under variables plus variable. I'm going to create one called be fire ball. Ready, question mark. This will also be in our magic black fireball category. compile this is well, and of course it changed my variable name here. I must have screwed up there.

So be fireball ready? was what I wanted to call this question mark, compile that and I do want this to be true by default. Okay, um, this one is going to sorry let me flip my page notes here. So this is gonna set true again after a delay here, this fireball ready. It's going to act in concert with our next variable that we're going to be creating here. So create a new variable.

This one is going to be a fireball cooldown. We will make this a float variable Put this in our category of magic black fireball compile and the default time I want to set for this is going to be 1.13 seconds why that weird value? Well because that is about the length of time that our casting animation is when it plays and I basically want to make it so that we can cast a fireball again once that fireball casting animation has finished up so you can't spam it over and over and over again. Okay, I'm just gonna be doing some reorganization of my variables here because I'm a DD like that so I've got B has B magic fireball on top the next one I'm going to put is be use firebomb left clicking and dragging over here. Then be fireball ready. Then our fireball cooldown left clicking and dragging that right up there.

Then we got data in attributes that is all looking splendid. Okay, earlier in the course We made a function called update man on, we need to jump in here and update it because we now have some mana cost values that we want to take into consideration. So you can double click on this Update Manager right here. And if you remember right, this is where we left off and on this node right here, I even left a note that said that this is temporary. Okay, what I need to do here is select our update Amana input node. I'm going to click right here to add a new parameter and I'm going to call this magic attributes.

And our variable type here is going to be our struct str magic attributes. Okay. Now, I am also Going to add another output here, click this plus new parameter. And this one is going to be called Sorry, I do not want to add one there, that is my bad. I don't want to add one there, scratch that I'm looking ahead my page notes. That's not the one I want to add out of our update man here.

So now we've got this magic attributes input node right here. I'm gonna drag out of this in type in a break the magic attributes. Because if you remember in this struct, if I expand this down is got a mana cost associated with it. And I'm going to plug this into this subtraction node right here. So when we cast a fireball spell, we're going to be calling this function and we're going to be taking our current manna amount and we're going to be studying tracking the appropriate manner cost based on whatever it is we're trying to cast. In this case it would be a fireball, which I believe was five manna, I don't really recall off the top of my head, I can right click on this node and get rid of this temporary node comment for now.

Okay, so this function is looking pretty good I do need need to create another function inside of our BP player here. So if I come over here into my my blueprints, panel functions, we're going to create another function. This one is going to be called check, if, check if enough manna to use magic. And I think that function name pretty much describes what we're looking to do here. So here I'm going to select my entry tunnel note. I'm going to add that input.

This one is also going to be called Magic attributes. Let me capitalize that magic attributes. It's got that str magic attribute struct already listed in there, which is what I want that I'm going to right click in some empty space here in our graph, and I'm going to add a return node. And with that selected, I want to add an output to this by clicking this plus parameter button. And I must have clicked rather fast. It already added one on there, I am going to change this to be enough mana question mark.

This is going to be a boolean variable. So we're going to do an evaluation here to see if we have enough mana to actually cast the spell, in this case, the fireball. So the way we're going to do this is we're going to drag out of our magic attributes. We're going to break that structure we are going to drag out of our manner costs in the input in a less than or equal to sign. And the thing we want to evaluate is if our cost is less than or equal to our manna current. And where did I put that in player attributes, there it is man a current, left click and drag that on top right here.

And right up above here, we're going to bring in a branch node, hold down B and left click, that is going to be the condition we're going to check against in this function. Hook this in. And if this is true, sorry, we actually don't even need that. We don't even need this branch My bad. We can plug this directly into our enough manner return node. So this is our function right here.

Alright, let me check my page notes to see if we have missed anything. No, that looks to be it for this video let's Compile and Save quickly. still more work here to be done. We still need to create the use fireball script that is upcoming. We will see you guys 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.