How can I set a variable as an instance variable of an object that gets emittedt?
I have an object with a chip, on there a variable A and I change the variable with logic.
This object I emit x amount of times. Now I would like the variable to be an instance variable and not a global variable.
How can I go about this?
Basically what I want is different values on the objects.
Right now, when I set the variable on one object then ALL emitted objects get the same value.
A setting like the multiplayer setting would be nice but I can't seem to find it.
I understood your original question, but it was answered. So I thought I'd try to help with the "variable all the things" problem some fall into. Sounds like you're getting on okay though.
If you want to freeze a value for later use, you can use a signal manipulator and turn on "freeze" while it has a value (you may have to wait a frame to receive it).
@TapGiles I think you misunderstood what I was asking. I don't want to use variables for everything just for storing certain things that I want set and not changed often, like when initializing an instance (emitting an object) and read the value on different events in different parts of the logic.
The variable modifier gadget has some neat functions.And on top of that it does not require wires wherever I need to access the variable.I am ok with how it is in dreams. Was just hoping variables could be set to instance variables instead of global only.
I do understand node based system and node based programming and the "live" aspect is actually what makes want me to make use of variables even more to not having to manage (force to zero or turn off) the original feed.
But if it's not available then feedback loops are the way to go :)
Appreciate you chiming in. Time to make my minesweeper level better now.
Let's chat if you want to collab and contribute art again.
I know what you mean about wanting to use variables for everything. I was a programmer for years.
But I really recommend not trying to use variables for anything, to save your sanity and actually make your life a whole lot easier.
In Dreams, everything is "live", parallel and happening at the same time (theoretically). Which means if you have a calculator which adds one thing to another thing... no need to store it at all. It'll always send that result no matter what. So just wire that straight into whatever you need the value for.
Variables are very rarely needed. If you need a value to persist between scenes or between plays, fair enough. But the cases when non-persistent variables are needed are very few and far between.
Yes it works and there are ways, it's just with programming background I am naturally drawn to the variables instead of feedbacking into a gadget. :)
Thank you for the link, it had some good info for this.
You'll need to use a method of saving local data, without using Variable gadgets. This Aecert tutorial might give you an idea of how to tackle the problem: https://www.youtube.com/watch?v=ukoNk_3Gh7k