Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: nightcorelv on June 08, 2019, 10:01:15 AM

Title: Arraylist Get next Bug
Post by: nightcorelv on June 08, 2019, 10:01:15 AM
Arraylist Get Next index value seems broken at 2019.1.5, any fix?
Title: Re: Arraylist Get next Bug
Post by: jeanfabre on June 12, 2019, 07:23:06 AM
Hi,

 what is the error or wrong behaviour you get?

Bye,

 Jean
Title: Re: Arraylist Get next Bug
Post by: nightcorelv on June 12, 2019, 12:01:50 PM
Hi,

 what is the error or wrong behaviour you get?

Bye,

 Jean

here is my setup
(https://i.imgur.com/u7MGoEA.png)

i loop through a list, get the index, then store the index into a variable, but it seems not works at all
Title: Re: Arraylist Get next Bug
Post by: djaydino 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 (https://hutonggames.fogbugz.com/default.asp?W1181)) instead
Title: Re: Arraylist Get next Bug
Post by: jeanfabre 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
Title: Re: Arraylist Get next Bug
Post by: nightcorelv 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
Title: Re: Arraylist Get next Bug
Post by: djaydino 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.