playMaker

Author Topic: Save content from ArrayList as PreFilled data  (Read 1587 times)

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Save content from ArrayList as PreFilled data
« on: April 17, 2020, 08:17:22 AM »
I want to fill an ArrayList while running the game, and use its values to set the PreFilled values when the game is stopped.

Is this possible? Copying component and pasting values doesn't work, as I assume the PreFilled and current values are handled as different things

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Save content from ArrayList as PreFilled data
« Reply #1 on: April 17, 2020, 09:02:10 AM »
Hi,

 yes, that's a limitation, the prefill array list is completly different in terms of structure than the acutal list used at runtime, so there is no possibility as is to copy from runtime back to prefill unfortunatly.

Bye,

 Jean

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Save content from ArrayList as PreFilled data
« Reply #2 on: April 17, 2020, 09:46:09 AM »
Thanks!

There might not be the right actions for this, but would it in theory be possible to run an FSM either in playmode or not that adds those PreFilled data values?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Save content from ArrayList as PreFilled data
« Reply #3 on: April 22, 2020, 02:23:42 AM »
Hi,

 not in a proper way that would work for all cases, because an array can contain different types of values, but prefill array can not.

is it a process that you do several times during your project development? if that's the case, I would probably use xml, with xmlMaker there are all the tools to save runtime content back to a text resources that you can reload when the app starts.

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Save content from ArrayList as PreFilled data
« Reply #4 on: April 28, 2020, 02:09:33 AM »
Hi,

 Going back to you cause the feature actually exists... I forgot about it!!

- the premise that the runtime values are all fo the same type and matches the prefill type applies.

1: at runtime click on the context menu of the arraylist proxy, and click on "Copy  ArrayList Content"
2: click again on the same context menu, this time copy the component values
3: stop the game
4: click one more time on the same context menu, and now paste the component values.

Let me know if that doesn't work on your end, I just tested and it works.

Bye,

 Jean

 

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Save content from ArrayList as PreFilled data
« Reply #5 on: April 28, 2020, 11:36:46 AM »
Might be off-topic but is there a way to do something similar with vars that I may have overlooked?
I see the option Copy vars in the Variables tab, with an option to paste them as values, but the data is lost once back to the editor.
If this were added to Playmaker, it might also be useful to have a duplicate of this menu in the FSM component's Controls section too.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Save content from ArrayList as PreFilled data
« Reply #6 on: April 29, 2020, 01:26:21 AM »
Hi,

I am not too sure where you are in the interface, can you make a screenshot?

Bye,

 Jean

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Save content from ArrayList as PreFilled data
« Reply #7 on: April 29, 2020, 09:22:42 AM »
Ok. See picture please.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Save content from ArrayList as PreFilled data
« Reply #8 on: April 30, 2020, 01:24:24 AM »
Hi,

 ok, and what do you mean by "Back in Editor"? it could be that you want to copy paste between projects? that's unfortunatyl not possible, this copy doesn't use the paste board of the OS, it's a dedicated thing that only worked within the same scene.

Bye

 Jean

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Save content from ArrayList as PreFilled data
« Reply #9 on: April 30, 2020, 10:23:39 AM »
Ah sorry, what I mean is the function copy vars and then paste vars or paste vars' values (only IF the vars have the same names) works at runtime or out of runtime (editor mode), but the cached vars and their respective values cannot be conserved between runtime and editor 'time' (play OFF).
Like when you do a test and are satisfied with the values and you want to keep them.
It is a pity because it seems Playmaker is really a split hair from actually being able to do that. A sort of quick and dirty saving of vars through a simplified form of caching, a bit like a temporary PlayerPrefs only used to remember runtime values without losing them once ending runtime.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Save content from ArrayList as PreFilled data
« Reply #10 on: May 01, 2020, 08:51:30 AM »
Hi,

 yep, I agree, this would be cool indeed.

Bye,

 Jean