playMaker

Author Topic: Array Changed Action!  (Read 498 times)

fish

  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
Array Changed Action!
« on: November 01, 2018, 05:09:23 PM »
I believe it would be very beneficial to have an array changed action, especially if it can monitor the array based on the change of a specific index or the whole array. Just like the other changed action, it will call an event if the array is changed and store the results. Maybe add a call event if the specified index doesn't exist?

Is this something possible?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4428
    • View Profile
    • jinxtergames
Re: Array Changed Action!
« Reply #1 on: November 02, 2018, 02:03:56 PM »
Hi.
That would not be very performance efficient to do every frame i think.

It think it would be better to send an event when you change something in the array.

Then have 2 copies from the array (old / new) and compare using get next and the index value (to get the old value on the same index)

If a value has changed copy the new array to the old array and then do what you need to do when something has changed.
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions

fish

  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
Re: Array Changed Action!
« Reply #2 on: November 02, 2018, 03:31:11 PM »
I originally though of doing it the way you mentioned but I noticed assets that allow you to bind variables to gui and thought that would be a lot less work and headache. Then I noticed the changed actions and thought having this with arrays would be perfect.

Is using the changed actions too inefficient for managing the display of gui data?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4428
    • View Profile
    • jinxtergames
Re: Array Changed Action!
« Reply #3 on: November 04, 2018, 02:20:53 PM »
Hi.
On single variables its fine,
But if you would do this on large arrays and doing it every frame it would not be good for performance.
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions