unreal engine console commands This is a topic that many people are looking for. bluevelvetrestaurant.com is a channel providing useful information about learning, life, digital marketing and online courses …. it will help you have an overview and solid multi-faceted knowledge . Today, bluevelvetrestaurant.com would like to introduce to you UE4 / Unreal Engine 4 / Custom Console Commands. Following along are instructions in the video below:
This playlist is home to my quickfire tutorials and general updates about this channel, Life, the Universe and Everything.
In this video, we look at how to extend the built-in console command system in unreal to create our own custom console commands to aid in debugging. This could potentially be extended to create a full in-game command/cheat system for some fun hidden extras for players to interact with.
Platformer Download: https://github.com/DevEnabled/ThirdPe…
Consider supporting the channel on Patreon: https://www.patreon.com/devenabled
My First Pluralsight Course: https://app.pluralsight.com/library/c…
My Second Pluralsight Course: https://www.pluralsight.com/courses/u…
My Third Pluralsight Course: https://app.pluralsight.com/library/c…
Check out my Website: http://devenabled.com/
Sound Effects (BFXR): http://www.bfxr.net/
Get Affinity Designer: https://affinity.serif.com/en-gb/
Get Unreal: https://www.unrealengine.com/
Get Some great free assets here: https://www.gamedevmarket.net/ Gamedev.tv Courses – Affiliate Links:
Unreal C++ Developer: https://www.gamedev.tv/p/unreal-engin…
Unreal Multiplayer: https://www.gamedev.tv/p/unrealmultip…
Unreal Blueprints: https://www.gamedev.tv/p/unreal-bluep…
Blender Characters: https://www.gamedev.tv/p/blender-char…
And welcome back this video is going to be a very quick and simple look look at adding some extension to the console command options you get with inside of unreal engine and the reason. I’m doing this is i’ve had a request in the comments asking if i’d cover something like this and i just wanted to mention first of all that there are a few shortcomings of this and that is what i’m talking about is if we press play and hit the tilde key then we get the console command option come up down here now this is similar to what someone mentioned being like the source engine. Where you can type things in here.
And you can find information about your game. So start fps will bring up the framerate counter in the corner of the screen. Now.
This is really good and this can be a really handy debugging system as well because you can extend custom events. And even functions into the console command. Which is obviously gonna be really useful for debugging and quickly getting to the bottom of things when you’re developing.
Now one problem with this and it’s not really a problem it’s a safety precaution. But that is that you are unable to use this in a shift version of the game so for debugging. This is perfect.
Even if you’re in using development builds also still going to work. But when it comes to packaging. Something if you’re going to the build configuration and you change it from development to shipping.
Which is generally the the the version you use when you are putting this on a console or on steam. Then the console commands are removed so this is really a debugging setup. Now this is something that really interests me.
So i might go into this and a little bit more depth later something that i need to look into myself to delve into this a bit further. But i’ve really been getting into into the breach at the moment and have been playing way way too much of that over the last couple of weeks. It’s a really good game.
But one of the things i like and that is that you have access to their console command. And the debugging that the developers had as well so you can use it as like a cheat system. But you can also make the game a little bit hard of yourself by spawning in things like new enemies.
Changing the placement of things it just gives you a little bit of freedom to play about with how you want to go through matches. And i’ve already finished the entire game. And i’ve got all over the mac squads and everything so it it’s just really good to have that option.
And i think it really extends games. So i’m interested in adding this type of thing into other games in the future. And that’s why if you wanted to do that in shipped versions of the game.
Then you need to look at things. Like adding this into blueprint. Widgets and creating your own system for this.
But we’re going to use the debugging approach for this so. What we need to do first of all this is a completely empty project. I’m just going to go into the blueprints folder and go and open.
The level blueprint. So this is generally the easiest way to access the console commands and the custom events. So what i want to do is come in here and create a new custom event and i’m just going to call this give health and the reason.
I’m doing. This is this is the kind of thing that you’d normally see in the console commands just things like infinite health or adding health or taking away health of a player or enemies and things and to begin with from here. I just wanted to get a simple print string.
So if we get the print string. And i’m gonna say health. Given and then a number.
Okay so we’re gonna hard code. This at the moment. This is really just to show how this is going to work and i’m gonna come back and show you how we can expose things like some inputs to the function.
So that we can actually customize this value in a moment. So if we compile this go back in and we’ll press play again now what once again is hit the button. That you have to open up the console command.
And we want to type c. E. For a custom event and we can see here we have the give health function.
So it already knows that we have something called give health in our level blueprint. Which we have access to now. Which is the custom event.
We’ve just made if we hit enter. We’re gonna get our print string at the top saying health given 10. So if we come back in i’m gonna drop this down.
And i’ll make this last. A little bit longer change the colors a bit more a bit more visible and what i want to do now is i want to show how we can override this and pass in how much health. We want to give like i said that player or that enemy so from here i’m gonna pull off and i’m gonna get an append node and from the b section.
I just want to change this to float so i want to get a two string from a float value and the reason being is that we can then just quite lazily plug this in that will automatically give us an input value in the custom event and i’m gonna rename this to health amount okay so that’s the amount of health that we want to give the player we’re going to append that to the end of the string. And i’m just going to type the same thing as we did just night. I’m going to say health.
Amount and then the colon and a space. There so that it’s going to upend the value to the end of this string. So now if we go and what we can do is we’ll see there’s a slight change so again.
We’ll bring up the console command. We’ll type c. For custom event.
And we’ll type give health and one thing to mention. There is that i think this one says down in the edit window. I didn’t notice makes what you’ve actually clicked into the window to make sure you get the correct command console.
Come up here. And now if we type c. And you can see give health is there ready you’ll also notice this time that we have the health amount.
Which is what we named the input argument and it knows. It’s a float value so what we want to do is tab up to that and this time. We’ll say we’ll give the player 50 half.
So we’ll type in give health. 50. And i will see health of mine.
50. Is added. So you can see quite simply that if you had a health system on a player character you could have your health system also influenced by this custom event and you can plug in things.
Like the input values you’d normally put into that as well so that is one way of doing it and i have noticed that in other references to this people have said you’re not able to do it in any other class apart from the level blueprint. So i just wanted to cover that as well. I’ve gone ahead.
And i’ve made myself a blueprints folder and the reason being is we’re gonna come in here. And we’ll create a new blueprint class and for this demo. I’m just going to use a game mode.
Just because the way that i kind of envision this working is going to be better for classes. Which only tend to have one instance of themselves. So things like game states game instances.
Where there’s only ever going to be one of them when it comes to things like actors importance because you can have multiple. It’s a little bit harder to target. These and you’ll see why in a moment.
So i’m going to call this bp underscore game mode and inside of this. We’re just gonna go first actually to the project settings go to maps and modes remember to always update your custom game mode. With the one you want to show in the game go back to the game mode class.
And again in the event graph make sure you stop the game as well. If you have that running. I’ll come down and create another custom event in here.
And i’m just gonna call this one the game mode event just so. It’s clear. Where this is coming from and again.
We’ll just do a simple print string. So that we can see something happening so with that done change the string that’s given here and we’ll just again could say this will print out game mode event and like i mentioned before and it’s gonna make this a bit darker tend to like orange and last a little bit longer just so that you guys we’ll see this i know that in the video can be a bit hard sometimes to keep up with things so that will last long enough that you can see us in the top left. Now we don’t need any values and everything that kind of works.
Exactly the same way. This is just to show the other way that you can get custom events from classes. Which are not the level blueprint.
Obviously the main reason for that is that the level blueprint is fine. But if you’ve got a number of levels that you’re going through you don’t want to keep pasting this into all of the different levels just so that you can get the console commands working if you can dump it in something like a game mode or a game state or even if you make an actor that you only ever have one of the like your custom events or custom commands actor and have one of those in each class. Then you can access it this way so if we go back in and press play click in bring up the console command this time what we want to do is type instead of cee.
Which was obviously a custom event. We want ke which i’ll be honest. I don’t know what that stands for if we then want the multiply sign and after this we want to get the name of the event.
We’re looking for now you’ll notice that we haven’t specified the class. Because i haven’t got this to work all the time i find that with things like poems referencing. The name of the actor.
That spawned overhead will work fine for game modes that doesn’t work. So. What we want to do instead.
Is this is going to run through any class of a type. Which is running this function and it will call it. Which is why like i mention is good to have this in classes.
Which only have one instance of themselves and i’ve timed because i’ve been talking about forgotten code. This so i’ve got the game mode event. So they know we want to do is get the name of that custom events.
So we’ll just type game. Mode event. And you’ll see here again top left hand corner game mode.
Event has been prints type. Which is the prints turing. We had inside of our game mode class.
So that’s how you would access it from specific classes as well which i think is the slightly tidier way that if you want to do this like i mentioned growing something like a class. Which is specifically made just to handle events pass things around just for debugging. It really really speeds things up and one thing that came to mind is that i mentioned at the beginning of the video that you tend not to see this in shipped games.
Because generally when you are releasing a game. You turn on the shipping build and that will just by default remove this and unless you’re gonna go into the c side of things to override some of the engine structure. This will unfortunately be removed saying that i’ve seen some games for instance survival evolved.
I was playing on a friend’s ps4 and i noticed that we could get console commands up in there and i was doing things a night just to check what the framerate how the framer. It was running and things like that and that was all running normally on a ps4. So i have seen developers run this if you wanted to keep this in in the development field.
Maybe for alpha beta testing or something. But generally like i mentioned hopefully. It’s gonna be really useful for time saving and debugging.
But maybe not something that you want to rely on if you wanted like a cheat system something in your game. Then you will need to come up with some form of custom system for that so hopefully. This is proving useful.
I will leave this video here for now as always though if you have found this interesting or useful then please do leave a like and share the video around don’t forget to hit the subscribe button to be kept up to date with all of the content coming from any of the playlists on the channel and as ever thanks watching and i will see you all next time .
Thank you for watching all the articles on the topic UE4 / Unreal Engine 4 / Custom Console Commands. All shares of bluevelvetrestaurant.com are very good. We hope you are satisfied with the article. For any questions, please leave a comment below. Hopefully you guys support our website even more.