Memory not stored



  • I'm currently having a weird issue with Memory.

    I am trying to store some values for my controller in Memory.structures[controller.id], but in the next tick, the value is gone again.

    example code:

    console.log(Memory.structures[controller.id].lastWatch);
    Memory.structures[controller.id].lastWatch = 1;
    console.log(Memory.structures[controller.id].lastWatch);

    Will output undefined on the first, and 1 on the second console.log... every tick.

    Then I went ahead and manually set that value to 0 in the console once to make sure that it is indeed defined. Now every single tick, it puts 0 instead of undefined on the first console.log, 1 for the second console.log. and the next tick it's 0 again.

    So it is defined, it does store a value I manually entered there, but it does not store values I set in my script. There's no other code overriding that value or the manually entered one wouldn't remain stored, right?

    What am I missing?



  • I did found a previous delete hidden, it's working properly.

    ---------------------------------------------------------------

    Hi,

    Did you found a solution ?

    I have a similar issue, the following code work properly. The test array is visible in the memory view


    if(!Memory.test)
    Memory.test = {o:'one', t:'two'};

    console.log(Memory.test.o);\s

    But after several execution, if I remove the first two lines it will not work anymore, because for some reason, the test array isn't stored in memory anymore, and didn't make any delete call. And so there is a undefined error 'Memory.test.o'