Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: mikeaillen on November 02, 2018, 06:54:13 PM

Title: PlayFab + P-Vue (array type, object type)
Post by: mikeaillen 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]

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")]
[Tooltip("User statistics for the requested user. (Read Only)")]
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;


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



},(errorCall) => {

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

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







I'm at a dead end! Help!
The created array has type "object" object type "catalogitem"
Title: Re: PlayFab + P-Vue (array type, object type)
Post by: jeanfabre on November 16, 2018, 04:30:31 AM

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.