playMaker

Author Topic: Array Get Next not working?  (Read 5534 times)

SlashHabit

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Array Get Next not working?
« Reply #15 on: June 29, 2017, 05:19:20 AM »
Hi,

How do you get this list in the first place? if you share it, I'll have a look.

 Bye,

 Jean

Hi Sean! Here's a screenshot of the state which creates the array.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Array Get Next not working?
« Reply #16 on: June 29, 2017, 08:00:51 PM »
Hi,
i'm still not sure how you got " "Index is less than 0 or more than or equal to the list count."
If i set a wrong reference i get an error : ArrayList Proxy reference do not match

Is the 'log' variable on "Debug Log" connected on a different Action?
Can you try instead of using the variable, setting a text manually ('state reached' for example) and test if it displays on the console when played

on the 'create array' state, are you using the action "Array List Create" ?

What are you using on the 'check enter key' state?

Maybe you can share the scene, i can't seem to repo this.

SlashHabit

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Array Get Next not working?
« Reply #17 on: July 01, 2017, 09:25:40 AM »
Hi,
i'm still not sure how you got " "Index is less than 0 or more than or equal to the list count."
If i set a wrong reference i get an error : ArrayList Proxy reference do not match

Is the 'log' variable on "Debug Log" connected on a different Action?
Can you try instead of using the variable, setting a text manually ('state reached' for example) and test if it displays on the console when played

on the 'create array' state, are you using the action "Array List Create" ?

What are you using on the 'check enter key' state?

Maybe you can share the scene, i can't seem to repo this.

Yes I am using array list create followed by a split to text array

Check enter key is just a Get Key Down action that checks for the enter key

Log gets sent to console and my global log string

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Array Get Next not working?
« Reply #18 on: July 01, 2017, 10:12:31 AM »
Hi,
Did you try setting a text manually instead of your global log string.

"Index is less than 0 or more than or equal to the list count." seems to be coming from somewhere else.
can you make a screenshot from it?

Also did you try to set some text manually into the array and using array contains (and disable the split to array) to find something you placed into the string.

If you can't share the scene, maybe you can make a video showing the states/actions/error and also show the editor when playing

SlashHabit

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Array Get Next not working?
« Reply #19 on: July 01, 2017, 11:43:51 AM »
Hi,
Did you try setting a text manually instead of your global log string.

"Index is less than 0 or more than or equal to the list count." seems to be coming from somewhere else.
can you make a screenshot from it?

Also did you try to set some text manually into the array and using array contains (and disable the split to array) to find something you placed into the string.

If you can't share the scene, maybe you can make a video showing the states/actions/error and also show the editor when playing

Alright I'll make a video, maybe not right now but later and share it with you. Thank you dude for being such a great sport.

Ofonna

  • Full Member
  • ***
  • Posts: 230
Re: Array Get Next not working?
« Reply #20 on: July 01, 2017, 10:48:02 PM »
hi, you don't have to use the arraymaker, i've never had to use it because the current array variable is capable of everything,

SOLUTION:
All you have to do is use the loop event option available in the "array get next" action, send an event to another state and compare the string with the result, if it's equal, do what you want, but if it isn't equal go back to the "array get next" state, it will loop through until it finds the string, and then you can use the finished event to indicate that you're done looping.

hope this is clear :)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Array Get Next not working?
« Reply #21 on: July 01, 2017, 11:32:52 PM »
Hi,
@Carmichael Actually that is not true.
Array maker can save variables from runtime for example :)

The basic array actions are still incomplete.
But you can find many custom actions on the Ecosystem

Also you should not use 'array get next' to see if it contains a value 'array contains' works faster and you only need a single action.

@SlashHabit

No problem, i am happy to help.
If you want you can pm a link to your project so i can check it out for you.

Ofonna

  • Full Member
  • ***
  • Posts: 230
Re: Array Get Next not working?
« Reply #22 on: July 02, 2017, 01:23:05 PM »
Hi,
@Carmichael Actually that is not true.
Array maker can save variables from runtime for example :)

The basic array actions are still incomplete.
But you can find many custom actions on the Ecosystem

Also you should not use 'array get next' to see if it contains a value 'array contains' works faster and you only need a single action.

@SlashHabit

No problem, i am happy to help.
If you want you can pm a link to your project so i can check it out for you.

thanks for the correction, I've never had to use arraymaker and what he is asking for was easily done by me using the current array variable. but i'd definitely look at the arraymaker and see whats advantageous

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Array Get Next not working?
« Reply #23 on: July 03, 2017, 02:39:51 AM »
Hi,

 ArrayMaker brings a lot of very important features still missing in the current PlayMaker implementation of arrays:

- hashtables: being able to bind a key with a value is critical for many cases, in PlayMaker you would need two arrays, one for the keys and one for the values, and it's not very convenient this way

- total freedom of value type at runtime: you can mix types in arrays and hashtables.

- total control at edit time within the inspector ( right now you can't change the number of items on an FsmArray inside the inspector, which makes it not yet ideal for complex prefabs setup)

- csv, json and xml bridges with DataMaker.


Bye,

 Jean