Runtime Variable System - Pro

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone it's Fury here this is video tutorial for rtime variable system version Pro um this tutorial will only talk about uh the pro features that are not in the light version so if you need very basic tutorial about the plug-in what it can do and how you how to work with various things please watch the light version because it covers all of that and here we are only going to talk about the pro features and I'll assume that you already watched the previous video uh for the plugin so cool um let's get started um in the previous video for the light we already created some interaction system with the plug-in um some UI responses for the health and stuff like that um and in this tutorial I'm just going to talk about a little bit about uh the features for the pro so this is the variable list that we created in the previous video as you can see the pr version has the replication tab here or the replication column here so that's the one difference that uh pro has compared to light it has a full multiplayer support so you can uh just highlight which variables you want to replicate and they will get replicated um they their replication system works exactly the same as regular variables so they will basically uh clients can can set their values no problem but whenever server sets the value and it gets replicated it will overwrite what client knows about this variable or what client has written to it so server is always Authority for the variables now what's different um compared to regular variables is that um with the regular variables you always have the replication uh feature here on the right where you can set whether whether you want the variable to be just replicated or replicated with some event rep notify event so with the runtime variables you don't have that uh you kind of have the the rep notify event by default so if I type Health you will see that I have the unchanged just like in previous tutorial so this this will react all of those events will be code accordingly to what server tells you so if server tells you uh that the variable is added uh and it gets replicated to the client it will get those those will just get called on the client site exactly the same way as they did on the server site so um whenever the value changes and server has this checked um the client will receive the change and and the change will be called through the event so uh it's pretty cool um because you kind of get the rep notify by default with the with the runtime variables one thing to notice is that when if server sets this to to true so sends the notification it gets it is respected by the replication system so when server sets sets for example the health without this the client will get replicated variable but it will not get this event so so it will follow the same Ruth as if it was a local um so another new feature in the Pro is the node um notice that um in the previous tutorial there was only four nodes um in the pro version you all also have this note here and on it's called on any object so let's compare it against the regular Chang uh so this one receives um event about variable being added changed or removed on any object that you pass in here and then you can act accordingly whereas this one in the pro version um it allows you to and just to clarify they are both available in the pro version so this is just additional um so in pro version you have this note that doesn't take object input which means that it will trigger whenever the value changes or gets added changed or removed on any object in the world at all completely any object so um this way you like you don't need to have a pointer to a particular character or or anything it will just get called whenever anything changes and then you can it it provides you what object this variable changed on so you can then cast check what object it it was and maybe act uh do some filtering according to this so um for example in the previous tutorial you'll notice that I had um UI element here that um that gets has an input has um is listening to the player Pawn when its Health changes gets added or changed it updates the progress bar here on the left down corner right so when I ENT enter the game you see that the the the health bar is is red and when I get damaged you see that it's just you know updated according to that so um it works well but there's one caveat to this and for example if your Pawn changes um for example if you are walking like let's take a GTA scenario so you are walking around with the character and then you you enter a vehicle a car or something like this or a plane then you possess the new pawn this is the your your car or something so this is only listening to this object that you passed here which at this point in time was your character so you would need to create a logic an event when whenever um the pawn changes you repossess Pawn to something else and then update this this event to listen to a new pawn like the car and stuff and you need to keep track of this so what's what's cool about this note is that you can basically um not care what object Health has changed right um and for example an in will be called and here what is going what is going to happen this will trigger on any object in the world that has changed added changed or removed uh it will be probably our character or a car when you hit something or something like that so maybe we could do cast to pawn right so maybe we are only interested in the pawns being being modified so and if it's local uh locally controlled paone so it's our character our car whatever we are currently controlling only then we will update uh um not like that only then we will update the the health based on that right so in this case we don't need to be like it this solves the entire situation of repossessing Pawns and and CH changing pawns or anything like this so in this case I'm still getting the event as you can see it still works um everything all the interactions will still work and everything but but yeah but uh we are getting well the interaction didn't work because I was damaged that's what we did in previous tutorial when I get damaged I disable interactions anyways so this is this is cool uh for that reason you don't need to be worried about what is being changed just a kind of like Global event Global kind of uh listening service um so that's the know that is only available in pro version I found that very useful in my project when I use some use it for some Global events um extremely useful in fact and um and yeah uh you will find one other cool thing that you can do in the system and that applies both to to light and pro but with this Pro node it's even more pronounced like for example you you could have uh I don't know you want to have some Global variables well you can do Global variables with the system easily uh let's say that I create category Global variables right and I create some Global variable and let's say that I'm going to do a global variable to say game score for example it's not assigned to any player because maybe you're building single player game or something very simple and it's just a game score so um and or maybe there is a lot of players in the game but you only want to calculate it for all of the players at once so um so for example you could use game state for that and again that's also another Advantage you normally you would have to cast the game state or some use some interfaces or something like that here you don't care you just have a game State and you can do set score set game score on the game State and say the game score is is zero by default um and then yeah uh basically you have some some sort of logic maybe after 5 Seconds let's say I'm going to add um add some score four to to the game like so after 5 seconds I'm adding like 20 points in the game um and that's it we're good and now maybe in the UI you want to be like hey actually actually I need to I need to listen to to the game score but uh I yeah I don't really mind using um games core on any object and we can just go because by default we will be using gamees score only in game state for example so we are okay for it to to basically you know um to not we don't have to cast or do any of that work so we can add some text at the top z0 game score and then the game score gets updated whenever the game score changes right and we don't need any object or anything like this it's just the game score so set text uh yeah and 's integer there that or changed and there you go zero after 5 Seconds it should turn to 20 yeah so this this note is also extremely useful if you want to have if you want to create global Event Systems for example so you can um you can I don't know create some sort of uh maybe uh another category Global events and let's add a variable to this that is going to be called um I don't know Global events um on player changed right so this would be our yeah our Pawn for example and when whenever our character is possessed for example and it could be on any character any any car or anything like this we can basically just go get game State maybe or or any object really because this this system as I said before it works on any object even if it's not a blueprint uh I'm just using Game state or game instance for that matter you can do uh Set uh uh player changed oops uh set on player changed and the latest value is like this so if it's local or is locally controlled yeah so if if our player is repossessed to something else we just get this and generally we'll get get an event whenever we repossess from or to this this character so uh we can do another one here uh player changed on any object and just just uh listen to player changes right so I don't know we can have a added or print print print the player that which that has changed whatever I'm not sure if this will trigger now because if this this is called before you buy into the uh event it obviously won't be called so it might not be but anyways you get the idea it's basically very useful for Global events Global variables um attributes for particular um entities or or interaction systems really anything you you you can imagine um if you have any issues with the plug-in this one or or the light version let me know and you'll try to sort it out and yeah that's it thanks and see you in the next one
Info
Channel: Furious Production
Views: 139
Rating: undefined out of 5
Keywords:
Id: Xm0HFekgCVU
Channel Id: undefined
Length: 15min 31sec (931 seconds)
Published: Wed Jul 03 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.