playMaker

Author Topic: Saving gameobject/script data using Playmaker and EasySave3 ?  (Read 729 times)

svansetten

  • Playmaker Newbie
  • *
  • Posts: 8
Hi,

I use VRIF (VR interaction framework) in my game and everything is made with Playmaker (and without coding). For saving data, I use EasySave3, which has Playmaker actions integrated.

I can use Playmaker to store global variables for for example health and checkpoints. My health and checkpoint systems are completely made and managed by Playmaker FSM's.

But I can't figure out how to store my inventory so I can save/load it with a ES3/Playmaker action. The inventory is in a C# script and I don't know how to access it. In the inspector is a field called "Starting / Held Item". If I could grab this data and save it (and load on next scene), that would make my day. I tried GetComponent but none of the available fields seem to work (or I'm doing something wrong here).

If anyone could help... would be highly appreciated :)

Attached are some screenshots.

Thanks a lot in advance.

Sander
The Netherlands

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6484
    • jinxtergames
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #1 on: March 03, 2021, 06:17:11 AM »
Hi.
you could use Get/Set Property to get/set the value

But you might need to use Linker Wizard then

you can also make custom actions to get / set the value.

have a look to this tutorial :

http://hutonggames.com/playmakerforum/index.php?topic=11126.0
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

svansetten

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #2 on: March 03, 2021, 06:52:40 AM »
Hi,

what do you mean, I don't understand?

When I use GetProperty, it gives me some dropdownbars with options (like Active, ActiveSelf, Transform etc), but none of them refer to the script with "Starting / Held Item"... How can I refer to this script/item?

svansetten

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #3 on: March 04, 2021, 05:45:15 AM »
Any info .. ?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6484
    • jinxtergames
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #4 on: March 04, 2021, 06:45:59 AM »
Hi.
Normally if a variable is directly on the component it should be accessible.

I had a quick look to its documentation, but there is not much info on how to access/edit the component data.
And i do not own the Asset, else i could look into making some custom actions.

It best to ask the author if he would be interested to support playmaker.
They can contact us if they need help.

You could also try on discord.
Maybe someone has used this asset and has custom actions for it.
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

svansetten

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #5 on: March 04, 2021, 08:31:30 AM »
Hi,

thank you for looking into it. I was wondering.. if I send you the C# script that is attached to the GameObject, would that be of any help? In the script you can see how it handles the "Held Item".
Maybe if you could do this... I would really appreciatie it :) If you can't help me after looking in the script, then I could contact the developer of VRIF.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6484
    • jinxtergames
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #6 on: March 04, 2021, 12:36:11 PM »
Hi.
The script is only a part of their whole system, i don't think that will work. but you can try making a pastebin of the script.
but it would still be un testable as it would need other things from the asset to work
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

svansetten

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #7 on: March 04, 2021, 01:11:17 PM »
Hi,

attached is the "SnapZone.cs" script, which you see in the "Inspector.jpg" and which refers to the "Starting / Held Item".

If I use the AutoSave option of EasySave3, and I select "Held Item" in the config of "SnapZone" (see attachments), then my inventory is saved and loaded when I quit and restart the game. So it can work... altough I don't know how EasySave3 saves the information in the background. But anyway EasySave3 lists the "Held Item" as saveable option. I only need to know how to access it with Playmaker and export it to a variable.

All basics for my game are working except the inventory save. I hope you can help me with this... if this is working I can build the rest of my game.

Kind regards,

Sander.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6484
    • jinxtergames
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #8 on: March 04, 2021, 05:15:33 PM »
Is there a HolsterLeft script somewhere in the scene?
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6484
    • jinxtergames
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #9 on: March 04, 2021, 05:44:54 PM »
held item seems to be public so i think it should be able to find it wit Get Properties.
(drag and drop the component in the state window)

Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

svansetten

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #10 on: March 05, 2021, 06:50:12 AM »
Hi,

yes as I wrote before, I tried that already. But it looks like nothing of the options refer to the inventory. See attached screenshot.... does this look familiar to something I could use?

svansetten

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #11 on: March 05, 2021, 06:52:17 AM »
Oh and I contacted the dev on discord, and his reply is this:

HeldItem is a public variable so you should be able to access it from another script. I'm not familiar with PlayMaker, though - perhaps you need to cast it to a SnapZone instead of a GameObject?

Is this any info of which you could advise me further?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6484
    • jinxtergames
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #12 on: March 08, 2021, 05:23:35 AM »
Hi.
On you previous image i can see that you placed the gameobject, not the component.

Try it this way, but instead of audio source drag the component you wish to access :

Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

svansetten

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #13 on: March 09, 2021, 12:29:21 PM »
Hi,

you are completely right...... It works.

I should have known this..... my bad.

Thanks a lot, I can grab Held Item now!

:)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6484
    • jinxtergames
Re: Saving gameobject/script data using Playmaker and EasySave3 ?
« Reply #14 on: March 09, 2021, 12:35:45 PM »
Hi.
No problem :D
Happy to help
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!