Box Container Pointing at Get Array Value @ Index # Updates?

  • If a Box Container's storage is the output of a Get Array Value at Index Behaviour, and somewhere else, on an object somewhere else, the value stored at that index in that array is changed, does the Box Container update itself with this new value?

  • Admin

    In programming terms, the box container will point at the get array value. The get array needs to be triggered again to update the box container.

  • @Hamed Got it. Thank you!

    So the Get Array Value at Index Behaviour is creating a locally stored variable/pointer of whatever its lookup (get) from the array returns, for the use of local Box Containers, Value Behaviours and any other localised behaviours wanting to use it. I think.

    For anyone coming along in the future, this seems to be what's happening, in pseudo code (please correct me if I'm wrong, @Hamed), wherein * indicates a pointer.

    *myLookUplocalStorage = myArray[atIndex]
    myBoxContainer = *myLookUPlocalStorage
    myArray[atIndex] += 1
    // myArray[atIndex] is now 1 bigger , but neither localStorage nor myBoxContainer know anything about this update

    myBoxContainer stores a pointer to the localised lookup (get), so whatever changes at that address is instantly reflected in myBoxContainer

Log in to reply