주 콘텐츠로 건너뛰기

검색

Instance variables

  • OgTheEnigma

    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

  • spyralab

    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.

  • TAPgiles

    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.

  • spyralab

    '@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.

  • TAPgiles

    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).

댓글을 남기려면 로그인하세요.