Тёмный

WTF Is? Blueprint Macro in Unreal Engine 4 

Mathew Wadstein Tutorials
Подписаться 66 тыс.
Просмотров 14 тыс.
50% 1

What are Blueprint Macros in Unreal Engine 4?
Source Files: github.com/MWa...

Опубликовано:

 

11 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 20   
@screamingfox5666
@screamingfox5666 8 лет назад
I was beginning to think your channel was called "Video-Four"... XD...
@JKordero
@JKordero 3 года назад
Old but gold. Thanks mate, helped me a lot with a problem with Death, Game Over and continue stuffs and this solved a lot of problems for me.
@PixelsLaboratory
@PixelsLaboratory Год назад
03:55 actually it's a Macro, as the rest of the video, since a Function is exactly what you have one option bellow where it says "Collapse To Function" instead of "Collapse To Macro". When to use each is tricky, but in short, a Macro is kinda like a grouping wrapper which is inlined every time you place it, whereas a Function is actually called every time you invoke it, rather than being copy + pasted. The same as in C/C++ for example, where you have Macros with #define vs. a standard f() function.
@jeffbitnias4282
@jeffbitnias4282 5 лет назад
Hello! I hope you still see this, I know this video is old, but couldn't you just use a function instead of a macro in most situations? Is there an advantage to using a macro vs using a function? Is there really much of a difference?
@madmodder
@madmodder 4 года назад
The differences I see is that you can use latent nodes like delays, and you can have multiple executions in and out so you can kind of branch your logic and get a different exec out based on what happens inside the macro. Unfortunately from playing around with them, I don't see a way to make local variables within the macro, the way you can do with functions, which would be a really useful feature. For example, I'm trying to make a macro to print character subtitles that would take an array of text for each line of dialogue, and go to the next line when the player hits the interact key again, and release the player once its done. This requires counting and setting variables for total number of lines and current line, easy enough to do in an event graph but falls apart in macros. And functions seem to "reset" each time they're called so it doesn't work there either.
@rib_rob_personal
@rib_rob_personal 3 года назад
@@madmodder Functions don't necessarily reset, although that is what it seems to do. Functions can instantiate variables, but after the code is done executing the function any variable in it falls out of scope and is destroyed. So if you need a variable to be persistent then you need to have it at the highest scope possible as a global variable in the event graph.
@madmodder
@madmodder 3 года назад
@@rib_rob_personal That's why I like to use macros if i have a variable that needs to be persistent and it's vital to whatever its doing in a way that's purely internal. like a counter int for a loop or something like that. I just don't like creating those kinds of variables in the event graph each time.
@kombosabinho
@kombosabinho 7 лет назад
OH MY FUCKING GOD. THIS IS BRILLIANT! I TOTALLY GOT IT. THANK YOU SO MUCH IM HYPED NOW LOL
@ethanwasme4307
@ethanwasme4307 8 лет назад
Is it a matter of performance when considering macros over funtions? Since funtions cant contain its own variables I use it when I have a bunch of external variables I can feed it and macros when I can have variables created within it i.e health drain rates, but it makes me wknder why funtions exist in the first place when macros seem to have more funtionality. Also, what is a wild card? Not really documented
@MathewWadsteinTutorials
@MathewWadsteinTutorials 8 лет назад
+Ethan Dodge You can have variables inside of Macros they are just much harder to use compared to a Local Variable in a Function so most of the time if you want to do some heavy lifting you would tend to use the Function as it just makes it easier. One benefit of a Macro compared to a function is a function has to have an execute in wire when it is normally set up A Macro can be used to just return something without being wired in to execute. I could have a Macro to do something like Get Player Controller -> Get Health -> Return Health Value and this wouldn't need to be wired in to use as a Macro. Also the Macro can have more than 1 return node so you could have a Macro with 5 wires out all going to other nodes based on what you did inside of it. In terms of performance for the most part they are the same. The way they work is different. When the code gets compiled down to usable form for your game a Function is basically pointing to something else when it gets to that spot and telling it to go look at that code when it need to run it. The Macro basically copy/pastes the entire code into that spot right into your graph for every time it is used. This means the Macro might be a bit more performant as it doesn't need to go in and out of places to run the code but in the overall scheme of things it really doesn't matter. As for a wild card it is usually an input node that has no "type" until you plug something into it. You could have a node with a wildcard input that multiplies the input by 2. It could be designed so that rather than having a "Multiply Int by 2" and a "Multiply float by 2" it would just be a "Multiply by 2" and would take a Wildcard that would change the input and output to either float or int depending on what you plugged into it. Wildcards allow the nodes to adapt to what you plug into it so Nodes can be flexible.
@ethanwasme4307
@ethanwasme4307 8 лет назад
Mathew Wadstein oh man, feel terribly guilty when you give such detailed responses, but that cleared up any misconceptions I had about the two actions. As for wild cards I think I may have some sections in my current project that could benefit from such a actions, so thanks a lot, appreciate it :)
@sorooshseyedein
@sorooshseyedein 3 года назад
You're the coolest guy on earth
@vrinnovationacademy7306
@vrinnovationacademy7306 5 лет назад
How is this different to functions
@reginaldstubtoe4185
@reginaldstubtoe4185 4 года назад
functions can't have anything time related in them like Timers, Delays, Async Load
@Zeriel00
@Zeriel00 2 года назад
@@reginaldstubtoe4185 Why not?
@noname2031-w5r
@noname2031-w5r 9 месяцев назад
china@@Zeriel00
@sahandsoltanieh5186
@sahandsoltanieh5186 5 лет назад
thumbs up
@cunnydesu
@cunnydesu 6 лет назад
My question my be a little bit late as video was made 2 years ago, but what's the difference between simply collapsed nodes and macro? Kind of hard for me to understand documentation, cause I'm still learning english and it's not that easy sometimes...
@ArmadaWixxi
@ArmadaWixxi 6 лет назад
But isn't it better to use a function library for usage in multiple different blueprints?
Далее
WTF Is? Blueprint Function in Unreal Engine 4 ( UE4 )
25:43
Women vs Men Bicycle Kicks 😮‍💨
00:20
Просмотров 893 тыс.
HTF do I? Event Dispatchers in Unreal Engine 4
11:00
Просмотров 112 тыс.
Need to Know Nodes in Unreal 5 Blueprints
48:59
Просмотров 85 тыс.
WTF Is? Volume - Cull Distance in Unreal Engine 4
7:08
Women vs Men Bicycle Kicks 😮‍💨
00:20
Просмотров 893 тыс.