Construction Script Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay we are going to quickly be looking at construction script so um construction script is a very handy um kind of alternative bluepin area that we haven't really looked at yet and can be really helpful for us um especially with uh constructing uh complex levels that we want to look realistic and unique um so what i'm going to start with is i'm just going to make a blueprint class and then an actor and i'm going to call this pillar because i'm going to base this off of your um your pillars that you've been working on so if i open up my pillow blueprint once that loads so we'll be used to work we've been used to working in two places we've got the viewport for all the 3d elements and the event graph for all the functional elements but today we're just going to have a very quick setup in the viewport and then we're going to go to construction script and we're just going to check everything's working how we want so for our pillar what we want is our pillar is made of three static meshes what we have is the central pillar and then a top and bottom um to the to the column um so i'm also just going to throw a box collider on there and i'm just going to reorganize this i know i talk about this a lot but a lot of people uh just ignore it so collision should be the very first thing in the list we want it to be the route so drag it up make new route and then we want everything to be childed to this so you see how if i collapse that everything goes away but right now this is actually charted to the other mesh so if i just drag that and put it over the pillar and attach then i'll all be perfectly in line because they're now all equally charted so then what i want to do is i just want to set some basic static meshes um not box it they are called cubes uh so if i just put on a one meter cube i don't want to put on a cube when there are actually cylinders so i'm counting this as my pillar body so if i just uh i want that unlocked if i set the scale to like three maybe um and then i've got two other meshes that are going to act as my top and bottom so i will use the cube for these so if i have q1 and q2 what you'll need to do that something that i can't really do properly with mine is make sure your meshes are properly placed um so with my pillow and cube there's kind of no way to really tell other than that's too high um whether they're in the right position or not um but if i just drag that down and i'll say this is acceptable for um for what i've got uh but you make sure that your tops and bottoms are properly sorted um and then what we can do with this we've just got this would just be our pillar fully assembled now um in a blueprint uh but what we can do there's there's kind of a few things we can look at um so with our construction script what we could do is we could take any of these so if i start with i believe that's the column itself if i start with this um i can make it so i can have i can be able to set the different parts of this pillar from the the blueprint itself so this is like my completed pillar and i could have a little menu here that lets me swap stuff out without having to realign everything every time if these are separate parts so how i do that is i've got the static mesh which i dragged over here which is just our pillar and what i can do is if i make a new variable and i call it column maybe pillars more accurate i call it pillar and i want the type to be a static mesh it's a regular static mess make an object reference and i want it to be uh editable i want it to be editable so now when i um when i look at here i can now see pillar and static mesh it's currently none um because uh well obviously we've not finished setting it up yet but now i've got a little menu if i go ahead and do um i've got the names of the tops and the bottoms of the columns are called but you'll know so you put in the right name i'm just going to call mine top column and bottom column [Music] and we just want to do the same thing we want to make these instance editable so now i have all three and now we're gonna make it so adjusting those menus will adjust what is set as part of our pillar so um i'm just gonna rename these so they match so all right sm pillar so i'm going to score the top column i should check that's actually the top one nope that is not the top one the bottom and last one top column okay so now i won't get confused between the different ones when i drag them in so it'll be easy to connect everything up properly so what we want is our construction script we want it to set these to be whatever the variables are because when we mess with this menu we are setting the variable right but they appear obviously blanks we haven't set a default one so when we set these when we set them here in this menu it will set it here we'll set this one so if i have tell my construction script to take whatever this variable is and i want to take the actual pillar from our viewport and i want to set the static mesh and i want the new mesh to be whatever our variable is whatever's been chosen from the list so if i just put those like that makes these look a bit near so now you'll see our pillar has disappeared um that's because the default for that variable is none so it has set it to none if i go back in here and i go on my pillar and i look for a cylinder you'll see it now defaults to the right kind and that's that and if i uh what changed it to this is going to break it because i don't have my shapes aren't really meant for this obviously mine's not going to look right when i change stuff but you will have ones that have been made for the right purpose see now that's way too big obviously but all your stuff should fit together because you made it to fit together um this is the basic point if i set both of these to their right uh what they get they just want me a cube so if i make both of these the ah just hit my arm uh both of the one meter cube so both of those and then i just want to get two of these just copy up these and just connect everything up so if i connect the bottom column to that one and the top column to this one and then get my variables in so get the one for bottom column and the one for top column and and now when i change any of these i can now just swap out any parts for any other parts so i can top out anything so obviously with yours this means with any uh changes in the the column part or the pillow part or the top or the bottom things that go on the top and the bottom um if you make any new ones if you make even slight adjustments um you can just eat quick very quickly swap out to a different ones and you can have your columns look unique so say you you've already made the pillar section in the middle the the tall part um and that's fine but obviously see if you use that one everywhere it's going to look a bit samsy if you then go into substance and play with some of the details if you go back into the uh 3d software and maybe you put some more scratches in maybe you put a big crack in this one you can come back in here with your new model put in and where you've got a bunch of pillows already say you just say you've got like you know like a lot of these you say well i want to make this one and this one uh look more unique so i'm just going to go on there and i'm going to put on the new one i just made so now i've swapped out for the new one and i didn't have to bother replacing the meshes in the right place it's already done um so that's how we can use a construction script to do some really powerful stuff with like configuring our meshes um that's one really good one that's that's a really good one and that's your basic blueprint right there just make sure you set up the variables make them editable and there it is the other thing we can do with construction script it's really cool for placing little things which i'm going to quickly do in a different blueprint so we don't ruin that stuff we've already got i'm just going to call this um rant random underscore items so random items if i just give this a very quick mesh and say if i just put the cube on it so when you've got little uh items that are going to be kind of um a scenery placement you know if you make like braziers or or little chairs or anything that's going to be just dotted around as just to make things look a bit more interesting to break up the scene to have little objects that bring more life to the scene um if you're placing these and you're you're placing them and you're putting around these everywhere they're all going to look exactly the same they're all going to be at the exact same rotation the default just zero degrees rotation so what we can do is we can use construction script to randomly rotate them for us so everything looks a little unique so if i jump into construction script for this all i need to do is i grab that and grab that mesh and i want to set its rotation we set it to world rotation and we i only want to spin it on its axis so top down because for most objects you have to place spinning them like this will look fine but this is probably going to look pretty wonky um so it's going to focus on the z so what i want to do is i just want to affect the z so if i right click this rotation i can split it and that means i've now got separate ones for the different rotations so i'm only interested in the z and what do i want to do with the z i want a random float so this will just give us a random float that's not exactly what i want because that one's only given us not to one so if i get in range was what i wanted so if i connect that random float minimum zero maximum because it's angle 360 degrees so now what this will do is when it's constructed it will take that one mesh and it will give it a random rotation so you see they've all suddenly kind of jumped and if i move them again it will re-rotate them and it will just apply that every time and any object i add now will come in with a random rotation so they'll all look just kind of a little bit more unique i've kind of got them all on the same similar-ish angle with that one but it's it's harder to tell the uniqueness with squares um so that gives us a random object with a bit of a random rotation and the same way we did the column if we want to use this for every little meaningless kind of item every little scenery detail bit the same way we did with the column i can have it so i can choose it from the menu so if i just say this is our stack mesh don't let names already taken so if i say variable sm and i make it into a static mesh like mesh make it editable and then what i'm going to quickly do here is what i did with the other one i want to take the static mesh that is the object i want to set it static mesh no not like that i don't i want to set its stack mesh you want this one you want the one that's the f i want to set it static mesh and i want to set it to the variable which obviously has no defaults i'm going to quickly throw the default back on so now as well as having these randomly rotate uh which they will still do if i decide um well i'm done placing all my braces i want to put down uh i don't know made some like little rocks or something uh say okay so i'm going to switch to my uh little rocks which is say to this one now i've got new object it's a bit hard to tell the rotation with this but you can see the texture surface changing and now i've got a different object still rotating and i can just use this for all my random items and remember you can just copy these out with holding down alt so yep and i've got another one this one will keep rotating on its own and put it over there i want another one next to it put it over there a lot of time in the grand scheme of producing things uh so that's it uh for now um we are later gonna look at some uh splines for placing walls uh i don't have time right now to pre-record something for that um keep an eye out for that video i will post it sometime on wednesday uh as that will be the next day i've been able to go home and record and come back to campus with the video to upload um so wednesday we should have some spline stuff for placing down walls uh really easy and uh and quick and adaptable uh but that's it for this construction script hopefully you got on uh as always ask questions let me know how you get on if any part of the video was confusing i was a bit rushed to make sure we got out so that's that
Info
Channel: AoifeTutorials
Views: 291
Rating: undefined out of 5
Keywords:
Id: nFeaBJ3P5kg
Channel Id: undefined
Length: 14min 47sec (887 seconds)
Published: Mon Feb 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.