playMaker

Author Topic: PlayFab + P-Vue (array type, object type)  (Read 241 times)

mikeaillen

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
PlayFab + P-Vue (array type, object type)
« on: November 02, 2018, 06:54:13 PM »
I'm trying to connect the playfab through the play market
I already managed to connect and register players
Now about the bad:
I downloaded the P-Vue asset, the author says that these scripts are completely working.
But alas, when I try to get a list of items, I don’t see anything in the VARIABLES tab, and in the STATE array it is only commas.

here is the script that does the loading of directories
Code: [Select]
#if !DISABLE_PLAYFABCLIENT_API && PVUE_PLAYMAKER_ENABLED && PLAYFAB_SDK_AVAILABLE_FOR_PVUE

using System;
using System.Collections;
using UnityEngine;
using PlayFab;
using PlayFab.ClientModels;

namespace HutongGames.PlayMaker.Actions{

[ActionCategory("P-VUE (PlayFab Visual Unity Extensions) - Client")]
[Tooltip("Retrieves the specified version of the title's catalog of virtual goods, including all defined properties.")]

public class PVUEActionsClientGetCatalogItems : FsmStateAction{

[ActionSection("Request Properties")]
[Tooltip("Name of catalog being requested.")]
public FsmString catalogVersion;

[ActionSection("Response Properties")]
[UIHint(UIHint.Variable)]
[Tooltip("User statistics for the requested user. (Read Only)")]
[ArrayEditor(typeof(JrDevAssets.ClientModels.CatalogItem))]
public FsmArray catalog;

[ActionSection("Miscellaneous Properties")]
[Tooltip("Gets the error string fired.")]
public FsmString error;

[Tooltip("Turn on the provide the debug info.")]
public bool log;

[Tooltip("Fire this event when a Login error is received.")]
public FsmEvent errorEvent;

public override void OnEnter(){

GetCatalogItemsRequest request = new GetCatalogItemsRequest(){
CatalogVersion = catalogVersion.Value
};

PlayFabClientAPI.GetCatalogItems(request, (result) => {

var catalogItemWrapper = new JrDevAssets.ClientModels.CatalogItem[result.Catalog.Count];

for(int i = 0; i < result.Catalog.Count; i++){

catalogItemWrapper[i] = ScriptableObject.CreateInstance<JrDevAssets.ClientModels.CatalogItem>();
catalogItemWrapper[i].catalogItem = result.Catalog[i];

}

catalog.Values = catalogItemWrapper;

if(log){

Debug.Log("PVUELog - Getting Catalog Items was successful (Client)!");

}

Finish();

},(errorCall) => {

Debug.Log("PVUELog - There was an error Getting Catalog Items (Client)! The error is: '" + errorCall.Error + "'!");

error.Value = errorCall.Error.ToString();

Fsm.Event(errorEvent);

});

}

}

}

#endif



I'm at a dead end! Help!
The created array has type "object" object type "catalogitem"

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14342
  • Official Playmaker Support
    • View Profile
Re: PlayFab + P-Vue (array type, object type)
« Reply #1 on: November 16, 2018, 04:30:31 AM »
Hi

have you tried to call .SaveChanges() after?

else, what is the content of the array? FsmArray only accept a limited set of types, that's likely your trouble here.

you would likely need to save the data in memory using a string reference, and then access internals using actions that get to the data using this reference, like I do for xml and DataMaker.


Bye,

 Jean