playMaker

Author Topic: [SOLVED]DataMaker something strange...  (Read 1555 times)

braincase

  • Playmaker Newbie
  • *
  • Posts: 19
[SOLVED]DataMaker something strange...
« on: January 29, 2019, 01:03:28 AM »
1. I'm using DataMaker from EcoSystem. (esp. CSV feature.)
2. "Get Csv Fields By Record" action has a problem.

If I play the game, "Get Csv Fields By Record" action makes correct array of the record.
(I'll call this "first success")

And I want to change the Record and get a new Array during runtime.
But after the first success, I couldn't get a new array again.
Change record number + get csv fields by record action = do nothing.

I tested 'CsvData.HasReference()'. And it says TRUE.

And...I modified "GetCsvFieldsByRow.cs"
I found, the last line "fields.SaveChanges()"
Just for experiment, I disabled the line. -> "//fields.SaveChanges()"

then...
The string array looks changed correctly.
But If I do something with the new array, Ex. ArrayGet action,
The array's real value is not changed.
Something's wrong...

please help~

-----added later------how I solved -------
I changed "GetCsvFieldsByRow.cs" final 2 lines...
from
Code: [Select]
fields.stringValues = _data.GetRecordAt(_record); 
fields.SaveChanges();   


To this
Code: [Select]
fields.stringValues = _data.GetRecordAt(_record);
fields.Values = _data.GetRecordAt(_record);

Anyway now it works.
fields.stringValues => array for only showing
fields.Values => array for real value.  Am I right?

I think "FsmArray.SaveChanges()" caused this problem.
« Last Edit: January 31, 2019, 10:17:49 PM by braincase »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [incompletely SOLVED]DataMaker something strange...
« Reply #1 on: January 29, 2019, 04:16:08 AM »
Hi,

 uhm. I'll have to test this, but then you don't need to set the stringValues, I guess.

FsmArray is a bit tricky to get right indeed...

 Bye,

 Jean

braincase

  • Playmaker Newbie
  • *
  • Posts: 19
Re: [incompletely SOLVED]DataMaker something strange...
« Reply #2 on: January 29, 2019, 04:30:22 AM »
Hi Jean~

At first I didn't set stringValue.
without StringValue, there's nothing in Playmaker Editor variable tab.
but I could get items of the array(array get action). The array has values.

So, this is my conclusion.
fields.stringValue = value for showing on editor.
fields.Value = real value.

I don't know well. This is just my experience.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [incompletely SOLVED]DataMaker something strange...
« Reply #3 on: January 30, 2019, 02:20:46 AM »
Hi,

 and if you do:

Code: [Select]
fields.Values = _data.GetRecordAt(_record);
fields.SaveChanges();   

does that work?

 Bye,

 Jean

braincase

  • Playmaker Newbie
  • *
  • Posts: 19
Re: [incompletely SOLVED]DataMaker something strange...
« Reply #4 on: January 31, 2019, 01:06:46 PM »
Code: [Select]
fields.Values = _data.GetRecordAt(_record);
fields.SaveChanges();   

yes, this code works too!
So
what is the function "fields.saveChanges()" ?
Is it same to "fields.stringValues = data.GetRecordAt..." ?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED]DataMaker something strange...
« Reply #5 on: February 01, 2019, 04:27:17 AM »
Hi,

 savechanges make sure the FsmArray is properly setup for direct access right after it's been set, else some under the hood optimization makes it that in some cases if you set values, direct access without waiting a frame is not possible.

 Bye,

 Jean