itch.io is community of indie game creators and players

Devlogs

Blog Entry: Console Commands: The Duality of Code and Blueprint

Deadlands Duel: Time Rift Rumble
A downloadable Game for Windows

Author: William DeMayo Date: 2/29/2024

Console Commands: The Duality of Code and Blueprint

Part 1 The Problem:

                The problem that I am currently having  is I have console commands set up in a custom c++ class and I have blueprint functions as well for certain console commands. The ones that I have set up in code I have given the UFUNCTION property of Exec meaning that it is a executable and can be called on runtime. This is where I run into my problem, the console commands the one specifically that I made in C++, I can see that the methods exist in the console window, however, when I call the method through the command console it can autofill, when you hit enter it leaves you with one phrase: command not recognized. With my blueprint functions I have three events set up for one console command; one that runs from a multicast, one that works on the server alone, and the base method to call. The base method to call will check if the person who typed the command in has authority to call the respective function.

Part 2 The Solution:

                The way that I think I could solve this problem is by creating a scene component that is attached to the scene that can access every custom console command. With Unreal there is a lot of console commands prebuilt into the engine, over 6000 to be exact. You can create your own console commands to do things that may be exclusive to your game or your systems. I think the way I could solve the ones in code not working is by recreating the methods for my console commands that don’t work in the event graph there. If it is a scene component it can help with null checking to make sure that the checks I am doing don’t reference garbage memory. The replication might be a problem with the code methods that I have right now concurrently, however, because I can’t run them through the command line there is no way to test it. Blueprints are so helpful to every day life but there are certain things you have to do in code and others that you have to visual script. It looks like for unreal specifically use blueprint methods and custom events when you are creating custom console cheats.

Download Deadlands Duel: Time Rift Rumble
Read comments (2)