Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: LordHorusNL on November 29, 2018, 05:27:57 PM

Title: Array Delete At not updating array?[SOLVED]
Post by: LordHorusNL on November 29, 2018, 05:27:57 PM
I'm having a problem with the official "Array Delete At" action,  the array and the index are correct and the index is not out of range. Yet the item at the specified index is not deleted.

*Edit*

Can the official action be update with the following line to make it function please?      
array.SaveChanges();

Will submit bug report.
Title: Re: Array Delete At not updating array?[SOLVED]
Post by: LordHorusNL on November 30, 2018, 02:49:20 PM
Problem solved, turns out the action is working properly without the added code, however there is currently a display bug in Unity that doesn't show the update of the Array in the variables tab.

Thanks again Alex.
Title: Re: Array Delete At not updating array?[SOLVED]
Post by: fish on December 19, 2018, 03:37:11 PM
What bug is this? I need to know if it's been addressed in 2018.3. This is too annoying to just deal with.
Title: Re: Array Delete At not updating array?[SOLVED]
Post by: jeanfabre on December 20, 2018, 01:41:42 AM
Hi,

 Use the ArraySaveChanges action available in the Ecosystem and us it right after your action, SaveChanges is affecting performances so it's better to save changes when you need to.

Bye,

 Jean
Title: Re: Array Delete At not updating array?[SOLVED]
Post by: fish on December 20, 2018, 02:51:36 PM
Oh neat, I attempted to put this in a sub FSM so I could disable it globally when I didn't need it but with no luck. Fortunately, I did discover using the array delete action with an sub FSM gains the same results. Using this version of sub FSM https://hutonggames.com/playmakerforum/index.php?topic=18762.0 (https://hutonggames.com/playmakerforum/index.php?topic=18762.0) I was able to copy back the updated array thus giving me the visual change I wanted.

I'm not sure if the performance is better than using ArraySaveChanges, if not, then I'll just set up a global bool every time I call array delete at so I can disable it once I no longer need to check it.

Edit: Okay, I took things a step further and added a bool into the ArraySaveChange action. This bool simply by passes the save change when set to false. If you attach a global bool to this, you can control all of the actions in your project at once. Since "array delete at" works fine on the backend, you can enable this action when you need it and disable it on deployment to save performance. Or I believe that's how it'll work out. Don't quote me on this, I'm no programmer. :P
Title: Re: Array Delete At not updating array?[SOLVED]
Post by: miguelfanclub on June 27, 2019, 03:42:40 AM
Quote
Problem solved, turns out the action is working properly without the added code, however there is currently a display bug in Unity that doesn't show the update of the Array in the variables tab.

Thanks again Alex.

Problem solved how? The action is not working for me. Is not deleting the array when I iterate through all of it.
Title: Re: Array Delete At not updating array?[SOLVED]
Post by: LordHorusNL on June 27, 2019, 08:19:04 AM

Problem solved how? The action is not working for me. Is not deleting the array when I iterate through all of it.

Well the action was functioning properly last year when i was dealing with this issue.

Are you sure the action isn't working properly in gameplay and you're just not seeing the result reflected in the inspector?

Delete At works fine on my end when in playmode.