question

Greggory Addison avatar image
Greggory Addison asked

How To Call GetObjects & SetObjects from C++ in UE5

I'm struggling to find the correct api call inside of the playfab plugin to acces entity objects in unreal. The docs show how to set and get them in unity but nothing for unreal. I've created a cloudscript that gets the objects from the entity I give it but I have no idea how to break down that data that is returned so I can use it in unreal.

handlers.GetCharacterQuestData = function (args, context)
{
    var entityVar = {Id: "9A9B4",
    Type: "title"};
    var Request = {
        Entity: entityVar
    };
    var OutData = entity.GetObjects(Request)
    
    log.info(OutData);
    return OutData;
};
{
    "FunctionResult": {
        "ProfileVersion": 1,
        "Objects": {
            "Quests": {
                "ObjectName": "Quests",
                "DataObject": {
                    "Kill50Enemy_Quest": "1",
                    "FindExcalibur_Quest": "1"
                }
            }
        },
        "Entity": {
            "Id": "9A9B4",
            "Type": "title",
            "TypeString": "title"
        }
    },
    "Logs": [
        {
            "Level": "Info",
            "Message": "{\"ProfileVersion\":1,\"Objects\":{\"Quests\":{\"ObjectName\":\"Quests\",\"DataObject\":{\"Kill50Enemy_Quest\":\"1\",\"FindExcalibur_Quest\":\"1\"}}},\"Entity\":{\"Id\":\"9A9B4\",\"Type\":\"title\",\"TypeString\":\"title\"}}",
            "Data": null
        }
    ],
    "ExecutionTimeSeconds": 0.1093948,
    "MemoryConsumedBytes": 7344,
    "APIRequestsIssued": 1,
    "HttpRequestsIssued": 0,
    "Error": null
}
sdksTitle Dataentitiesunrealdata
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rick Chen avatar image Rick Chen ♦ commented ·

Currently it is hard for us to do the test. But you can refer to this tutorial Unreal Engine quickstart - PlayFab | Microsoft Docs, which shows you basically how to call API with Unreal C++.

0 Likes 0 ·
Greggory Addison avatar image Greggory Addison Rick Chen ♦ commented ·

I know how to call the api. For objects though no calls seem to exist i've searched the client api as well as multiplayer api. I didnt find anything resembling an entity api in the plugin hence why I ended up writing a cloud script. However with the cloud script I have no Idea how to break down the data that gets returned. It looks like an array of objects and the first one is called Quest then inside of that it has a DataObject so im wondering how to either call a function from the api that can return me something usable in unreal or how to properly break down the data that gets returned here.

0 Likes 0 ·

1 Answer

·
Greggory Addison avatar image
Greggory Addison answered

Okay I found it in the data api!

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rick Chen avatar image Rick Chen ♦ commented ·

I am glad to hear that you found the solution.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.