playMaker

Author Topic: Need to Load a File in as a TextAsset object?  (Read 2457 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Need to Load a File in as a TextAsset object?
« on: October 01, 2018, 02:16:32 PM »
I use Playmaker Easy Save 2 and 3 actions, and i'm trying to load a sql database file (.bytes) file from a folder into the game to use with some SimpleSql commands.

I need to set a database property that needs a TextAsset.

I can get easy save to see the file in the folder, but I am not sure how to set that file to a TextAsset Object in a Playmaker FSM, so I can then set the Property of the SQL database component using it.

I can "load" the file named "file name found with Get Files"... but how do I load it INTO a TextAsset?

Joel from Easy Save said this:

"Hi there,

Easy Save has no functionality to put data into a TextAsset, but it has a Load Raw to get the data as a string, which can be saved back to a file using the Save Raw Base 64 action.

You may want to enquire on the PlayMaker forums to see if an action exists to create a TextAsset from a string.

All the best,
Joel"

Is there an action to do this?
« Last Edit: October 01, 2018, 02:18:13 PM by westingtyler »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Need to Load a File in as a TextAsset object?
« Reply #1 on: October 05, 2018, 03:07:06 AM »
Hi,

 the problem is that it would work only in Editor, you can't create a text asset at runtime.

what are you trying to achieve as a feature?

 Bye,

 Jean

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: Need to Load a File in as a TextAsset object?
« Reply #2 on: October 08, 2018, 08:49:09 PM »
i am trying to use sql database .bytes files the player can store in a folder, then at runtime it will read those files and put them into "books" prefabs the player can find in the world and read. custom books and dialogue, etc. the goal is for players to be able to change dialogue, books, street signs, etc. by simply creating their own sql databases. I am using simplesql.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Need to Load a File in as a TextAsset object?
« Reply #3 on: October 10, 2018, 06:32:13 AM »
Hi,

 then you need to either save the db in persistent data folder of your app, or in user preferences.

 I would also contact simpleSql authot, he might have built in features to save and load data at runtime locally.

 Bye,

 Jean