So, I never really got this question answered (this is kind of a reiteration of an old topic), but I want to know how to create something like blueprints in Unreal Engine. Blueprints look like this:
I want the player to be able to access this, and this is not a plugin so it can’t just create a script. This is where I am getting confused, as I don’t really know how the script would function.
If you are able, please make your answer as detailed as possible, thank you all so so much
This is basically making your own programming language. It will be helpful to look into how programming languages work. Specifically interpretated languages.
To sum up though, you need to create a set of functions that can do everything your language supports. Then you need some form of data structure that your interpretor can understand. This cam be something like an AST or something like running off custom bytecode. You then need a way to take that graph and convert it from its graph form to the structure form your interpreter can read. The interpreter then just takes that structure and runs all the functions as it gets to it.
This can get rather complex and be a very large project. Super cool though and will be very satisfying imo if you do make it.
this could be a over simplification but each node/module just seems like a function with maybe a few inputs and outputs. the difficult part would be linked these functions together
These are actually based on an architecture that you can possibly recreate. Just requires a bit of software architectural know-how. The node view is just representative.
What you actually see is also known as a composition-over-inheritance principle here.
Yes. But blueprints, unlike like blockcode (linear based), are “script” or object oriented based. The block code in Scratch is like a recipe or todo list.
Blueprint image shows events connecting to same functions, operations, etc.
In the end, blueprints and scratch are quite similar, except that blueprints allow more code to be reused and is more flexible.
So, in theory, if I had some skill, would I be able to start with a scratch-like system and then as it gets more advanced move to something like blueprints?
Edit: Don’t know why I asked this, I already have a functioning proof of concept for the blueprints knock off lol.
I advise you to look into loadstring as this might be helpful to you in the progress.
I advice you create a table in this following format
local execution = {
request = aRequestedFunction,
arguments = {
{
request = declareValue
arguments = {3}
} -- This is a value nodeblock that will return 3
}
}
This way, you can unpack the arguments and players can run the functions later. This can be useful you don’t really want it to take actions now and be able to store it raw.
You might be able to label parameters inside arguments, but I’m doing number-based on this case.
To make a language…
Take inspiration from Lua and C
Lua is lexical (aka easy words and less on symbols) and C has a structure that is easy to identified.