Basic GET tutorial for VaREST plugin and Unreal Engine 4

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi folks bob the chemist here i'm interested in trying to record some experiences i've had with the va rest plug-in which is a plug-in that allows us to connect to uh online api or rest servers there's uh there are a bunch of our of tutorials well a couple tutorials already on the internet but looks like some of the recent updates to the plug-in have made some of these videos obsolete so this video is one part documentation for me to remember what i've actually done first to show off we've got the va rest plugin that's been installed from the epic unreal engine marketplace and we're using version 30 of the uh of the plug-in with the 4.25 unreal engine and what i'm interested in doing is uh just seeing if i can use a um uh the rest api to change the text in this in the default third-person map right right here there's a nice website open weather map that has a free api available and you can go and log in and sign up for an account here if you would like but they actually also have a couple sample apis that i'm going to use in this so you don't even need to sign up for anything you just need to hop on over to to this website grab the the link that's in one of these sample api calls and that's going to work just fine for our purposes so let's go ahead and start up click on the third person text render there and we're going to create a a blueprint [Music] and in this blueprint we're not going to need the event tick and one of the first things that we need to need to do is uh reference the va rest subsystem which apparently is something that is new um that isn't hasn't made its rounds into other tutorials yet without that uh it makes things very very difficult for uh for us to follow some of the older tutorials now we can start by constructing a a json object notice context sensitive is not necessarily your friend at this point so i'm going to just create an object here and grab that and now from here we can call our url so this is where we would put our in our information about the uh about the uh about the api notice that the subsystem object reference is required for the called url and once that's in there and we've got this connected to the json we're in good shape now all we need is the is the url and we'll take this one right here we'll come back to seeing what that looks like in just a second okay once we've got everything there set we do need to create a new custom event and we'll call this rest callback and here's one of the other changes some of the functions that you'll see in older tutorials are regular functions whereas that have now been converted into pure functions which has caused some problems so get response object is one of those once we've got the response object so this is going to be the reference to the to the json if we take a look at the one that i'm looking at here i'm actually interested in printing this text right here light intensity drizzle so that is first in the weather field the weather field as indicated by the brackets is an array so i'm going to need to get an array first it turns out that the array only has one element so i'll just get that first element and then i'll need to get a text string called called description so that's my my approach here so the first thing i'm going to do is get an array field call that description and we will get now contact sensitive is helpful see where array is and now we need to convert that to an object again we need to get rid of context sensitive so that we can actually see it down here in json connect those two next thing we're going to need to do is we've got this this object which is the description and in the um i'm sorry let's go back and take a look here the original field is called the weather and it's the weather that's the array that has description in it now we want to get description and this is a string field and the last thing that i want to do is set this set the text contact sensitive is going to be useful here set the text of the text renderer to be that value okay so there we are our blueprint let's see if that compiles properly it does let's see now if third person changes to the text that i want and it looks like there's a light intensity drizzle in in our third person default map so there you have it a short uh short tutorial i will post a high-res image of this of this map so that you go or this blueprint so that you could try to follow along with it and i hope that you find this somewhat useful
Info
Channel: BoB LeSuer
Views: 23,987
Rating: undefined out of 5
Keywords:
Id: B90jnsEJ6E0
Channel Id: undefined
Length: 7min 27sec (447 seconds)
Published: Tue Aug 11 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.