playMaker

Author Topic: Strange error on Array List Get  (Read 1601 times)

HanTheMan

  • Playmaker Newbie
  • *
  • Posts: 7
Strange error on Array List Get
« on: July 02, 2020, 10:30:37 AM »
Dear all,

Once again your help is much appreciated.
I am trying to put a number of characters from se[rate variables into an array, shuffle them and get each of them back into new variables.

I have done the same thing with Ints, without a problem.

Now I keep getting an error:
The fsmVar value <System.String> doesn't match the value <System.Int32>

Can anyone help, please?
I am totally stuck.

Thank you in advance.

Han
« Last Edit: July 02, 2020, 03:14:13 PM by HanTheMan »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Strange error on Array List Get
« Reply #1 on: July 02, 2020, 03:15:26 PM »
Hi.
What actions are you using?

it looks like you are trying to place a string value into a int array

HanTheMan

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Strange error on Array List Get
« Reply #2 on: July 03, 2020, 02:26:47 AM »
Hi Djaydino,

Thanks for getting back to me again.
What I am using is:
Array List Create;
Array List Add Range (and fill it with the necessary strings)
Array List Shuffle
Array List Get with a new variable.
So far so good...
UI Text Set Text (with the new variable) and then the error crops up. Which is strange because I have used this combination before and it worked beautifully.

The strangest part of it is that I use the approach for 8 objects and every time I run the game a varying number of objects show the string as they should. The number repeats for the error message also changes every time.

2nd approach:
Also tried using variables to get the character strings straight from the original CSV file.
Using a variable for the record, which I used before and it worked
Created a second variable to identify the column within the record (also works)

Then use Get CSV Field By Index
with the 2 variables to address the CSV file directly (which worked before with 1 variable)
Now I don't  get an error but the CSV field is simply not returned.

Completely baffling to a newbie and very frustrating when working against a deadline. Sorry for the long post, though...
Any thoughts would be really appreciated.

Have a nice day,

Han
« Last Edit: July 03, 2020, 02:54:19 AM by HanTheMan »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Strange error on Array List Get
« Reply #3 on: July 03, 2020, 07:29:27 AM »
Hi.
so you tested with placing some breakpoints,
And UI Text is giving the error?

Are the strings numbers?

or is one of the variables that you are adding with 'add range' a int value?

As Array List can have multiple types (int/float/string/etc) in 1 array List.
So it is possible that one or more of the variables that you place in the add range is a int variable.

HanTheMan

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Strange error on Array List Get
« Reply #4 on: July 04, 2020, 05:45:08 AM »
Hi Djaydino,

Thanks for your help.
Double-checked all the strings and they are strings. What I have worked out, I think is that the issue is with array. Playmaker reacts differently to an array that is made in the Variables tab and one that is generated by means of an Action. Not sure where the difference come from and what the consequences are...
Very confusing.

Hopefully you, or anybody else, can shed some light.

Kind regards,

Han

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Strange error on Array List Get
« Reply #5 on: July 04, 2020, 10:04:04 AM »
Hi.
If you mean the standard arrays and array lists, they are 2 different things.

I have been creating array lists / hash tables @runtime many time but did not have this issue yet,
Can you show some images of your setup or a video