Download

Macro libraries: pasted, local and persistent variables

Context: I copied blueprint content into a macro and since it was hooked up to variables it also brought in the variables used in the source BP, without complaint (this seems a little scary btw).
I’m assuming I have to change these all out with the weird local/persistent variables?

On another note relating to local vars - I noticed in the Do Once macro they were named via comments and I guess this is the only way to keep track of which is which? I didn’t see a renaming option.

Finally, how does a persistent variable work in, for example, a macro that acts as a countdown timer? Is it persistent independantly in each instance of that macro used in BPs? What would cause a persistent variable to lose its data/be reset?

bumping to see if there’s an answer

Short answer for first question is when you paste, it automatically creates those variables for you. It is weird but I think that’s intended. Also, sometimes(I don’t know if this is fixed) when you deleted all the get/set nodes of a variable it automatically delete that variable from BP.

Also, you can not rename nodes that not created by you, ie you can’t rename a forloop/branch or a getController function, but you can rename your own macro/event/functon.
(even if you can, you shouldn’t)

for local var, you can name them upon creation. I don’t know if there are some special speed difference if you just keep the default name.

ie. if you used any of the following, DoOnce, DoN, Gate, MultiGate, they are all macro with independent persistent variable(with in owned BP), there could be more.

I have to apologize, I could have been more clear. I was actually referring to macro library functions/macros. Not macros created inside of an arbitrary class (I’m getting confused typing this) . If you’re ever in vancouver I’ll buy you a beer :wink:

ohh, i happen to be in Vancouver. :slight_smile:
now where/when do i claim my beer?
lol

btw, i think it should be the same for micro library except you can’t get access to class vars and level objects, etc.