playMaker

Author Topic: Arraylist Get next Bug  (Read 1256 times)

nightcorelv

  • Playmaker Newbie
  • *
  • Posts: 27
    • View Profile
Arraylist Get next Bug
« on: June 08, 2019, 10:01:15 AM »
Arraylist Get Next index value seems broken at 2019.1.5, any fix?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15494
  • Official Playmaker Support
    • View Profile
Re: Arraylist Get next Bug
« Reply #1 on: June 12, 2019, 07:23:06 AM »
Hi,

 what is the error or wrong behaviour you get?

Bye,

 Jean

nightcorelv

  • Playmaker Newbie
  • *
  • Posts: 27
    • View Profile
Re: Arraylist Get next Bug
« Reply #2 on: June 12, 2019, 12:01:50 PM »
Hi,

 what is the error or wrong behaviour you get?

Bye,

 Jean

here is my setup


i loop through a list, get the index, then store the index into a variable, but it seems not works at all

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6386
    • View Profile
    • jinxtergames
Re: Arraylist Get next Bug
« Reply #3 on: June 13, 2019, 09:25:23 AM »
Hi.
Maybe add a variable ;)

On type add type and in result add a variable to receive whats in the array :)

if you don't need a variable, only a index to loop.
Then you should use Iterate action (on Ecosystem) instead
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15494
  • Official Playmaker Support
    • View Profile
Re: Arraylist Get next Bug
« Reply #4 on: June 17, 2019, 04:09:18 AM »
Hi,

- can you show me the gameobject 'BlendManager" and its arrayList component?

- you are not implementing the failure event, this should always be set, so that when something goes wrong, you know about it.

- if you are using this action more than once in your fsm lifetime, you need to use the Reset property, which accepts a boolean variable that you set to true before entering the state for the first time, it reset the internal counters.

 Bye,

 Jean

nightcorelv

  • Playmaker Newbie
  • *
  • Posts: 27
    • View Profile
Re: Arraylist Get next Bug
« Reply #5 on: June 18, 2019, 05:15:39 AM »
Hi,

- can you show me the gameobject 'BlendManager" and its arrayList component?

- you are not implementing the failure event, this should always be set, so that when something goes wrong, you know about it.

- if you are using this action more than once in your fsm lifetime, you need to use the Reset property, which accepts a boolean variable that you set to true before entering the state for the first time, it reset the internal counters.

 Bye,

 Jean

The problem has been solved, thanks djaydino.
it works fine when i add a variable to store the value
but if i remove it and let it null, the action will skip looping through and jump to finnished event
in my opinion, this is more like a bug
it’s not always necessary need to get value from list, sometimes people just want to
 loop through and get index from list
« Last Edit: June 18, 2019, 05:50:25 AM by nightcorelv »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6386
    • View Profile
    • jinxtergames
Re: Arraylist Get next Bug
« Reply #6 on: June 18, 2019, 11:26:20 AM »
Hi.
If you do not need data from an array its might be better to use Iterate action instead.

if it needs to be the same length as array, you can get array length and use that value on the iterate.
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!