playMaker

Author Topic: Arrays not being destroyed  (Read 1842 times)

cats00eye

  • Playmaker Newbie
  • *
  • Posts: 47
Arrays not being destroyed
« on: April 18, 2016, 09:50:56 AM »
I have a temporary array used for sorting objects. When the FSM is done with it, it is destroyed with a single action in a state all by itself. I have success event set to an event "Destroyed", which is the only event transitioning from that state, so in theory, if that state transitions, that should guarantee the array was successfully destroyed, right? Yet, when this FSM is called again, it finds the array not destroyed.

Obviously, no one can debug my scene for me, but I could do with any suggestions with what might be happening.

I've tried adding a test to check if the arrays were destroyed and then destroying them again, if not, but even that fails. Looking through the log, the FSM has successfully passed through the destroy state and it has not subsequently gone through any state that creates the array. This is the only FSM in which the array is referenced.
« Last Edit: April 18, 2016, 10:02:04 AM by cats00eye »

terri

  • Sr. Member
  • ****
  • Posts: 389
    • terrivellmann.tumblr.com
Re: Arrays not being destroyed
« Reply #1 on: April 18, 2016, 11:23:39 AM »
I tried to reproduce this, and it seems that if I count an Array list on a state called by the Destroy's success event, it will return as if it still exists, but if I add a NextFrameEvent and then count it, it will be gone.

Can you try something similar? I've noticed that since updating to 1.8 there are a lot of small things like this that seemed like aren't working but are fixed by calling NextFrameEvent

cats00eye

  • Playmaker Newbie
  • *
  • Posts: 47
Re: Arrays not being destroyed
« Reply #2 on: April 18, 2016, 02:18:06 PM »
That's very interesting, thanks. I added a next frame event immediately after the destroy array action (in the same state) and it's had the opposite effect. The scene now gives an error on that action, saying the array does not exist!

I should add that, both with the previous case and this one, the scene goes around fine for a few dozen times or more, occasionally less than that, and then gives the error.

EDIT: Second thoughts, I think this second error is down to me - so touch wood, your suggestion may have worked - Big relief. Thank you.
« Last Edit: April 18, 2016, 02:20:40 PM by cats00eye »