question

van avatar image
van asked

Has anyone used PUX, i'm stuck trying to execute cloud scripts.

Using Playmaker and PUX, my login/registration works perfectly but if I try to use Execute Cloud Script either Client or Server version all I get is a NullReferenceException. I did input the proper function name.

I am sure i'm missing something simple. But can anyone point me in the right direction?

My C# script invokes the cloud script perfectly fine btw.

I will post the entire error message if needed but here is the first part of it.

NullReferenceException
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.

Thank you in advance.

10 |1200

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

jrDev avatar image
jrDev answered

Hey van,

Just as I thought, the issue is with the 'Function Parameter' section, it doesn't work with a null value and you are not using that section so it will be null. What you can do is comment out the "FunctionParameter = functionParameter.Value," line until the new version 0.2.1 is released on the Asset Store.

If you need an early copy of the new version, you can contact me by email. Bare in mind to be prepared to re-add your Playmaker actions with the new version because of the official name change made to the project.

Thanks,

jrDev

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.

van avatar image van commented ·

Great thank you for the effort this worked perfectly for me until the asset update gets pushed by unity! Thanks Again

0 Likes 0 ·
brendan avatar image
brendan answered

Yes, could you please post the full error details?

@jrDev, since this is your plugin, can you let us know if you're familiar with this issue?

10 |1200

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

van avatar image
van answered

You are on top of things as always Brendan. Thanks for the reply, the asset was updated today which caused an endless stream of errors that crashed unity 999+ . And request for support on the website forums for the asset hasn't even gotten any response. I still have hope as it would be useful though the C# scripting is very very easy thanks to the samples provided. I plan to make a tutorial video once it is all working properly also playfab + unity + playmaker + photon.

PlayerSettings Validation: Requested build target group (16) doesn't exist; #define symbols for scripting won't be added.
UnityEditor.PlayerSettings:SetScriptingDefineSymbolsForGroup(BuildTargetGroup, String)
JrDevArts_Utilities:AddScriptingDefineSymbol(String) (at Assets/JrDevAssets/Utilities/JrDevArts_Utilities.cs:1752)
PUX_PlayFabManagerWindow:OnGUI() (at Assets/JrDevAssets/PUX - PlayFabUnityExtensions/Editor/PUX_PlayFabManagerWindow.cs:70)
UnityEditor.DockArea:OnGUI()

10 |1200

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

van avatar image
van answered
Sorry for the wall of text.

NullReferenceException
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
PlayFab.Json.ReflectionUtils+<GetGetMethodByReflection>c__AnonStoreyE.<>m__20D (System.Object source) (at Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs:1922)
PlayFab.Json.PocoJsonSerializerStrategy.TrySerializeUnknownTypes (System.Object input, System.Object& output) (at Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs:1573)
PlayFab.Json.PocoJsonSerializerStrategy.TrySerializeNonPrimitiveObject (System.Object input, System.Object& output) (at Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs:1374)
PlayFab.Json.PlayFabSimpleJson.SerializeValue (IJsonSerializerStrategy jsonSerializerStrategy, System.Object value, System.Text.StringBuilder builder) (at Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs:1080)
PlayFab.Json.PlayFabSimpleJson.SerializeObject (IJsonSerializerStrategy jsonSerializerStrategy, IEnumerable keys, IEnumerable values, System.Text.StringBuilder builder) (at Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs:1108)
PlayFab.Json.PlayFabSimpleJson.SerializeValue (IJsonSerializerStrategy jsonSerializerStrategy, System.Object value, System.Text.StringBuilder builder) (at Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs:1059)
PlayFab.Json.PlayFabSimpleJson.SerializeValue (IJsonSerializerStrategy jsonSerializerStrategy, System.Object value, System.Text.StringBuilder builder) (at Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs:1082)
PlayFab.Json.PlayFabSimpleJson.SerializeObject (System.Object json, IJsonSerializerStrategy jsonSerializerStrategy) (at Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs:636)
PlayFab.Json.SimpleJsonInstance.SerializeObject (System.Object json, System.Object jsonSerializerStrategy) (at Assets/PlayFabSdk/Shared/Internal/ISerializer.cs:81)
PlayFab.Json.JsonWrapper.SerializeObject (System.Object json, System.Object jsonSerializerStrategy) (at Assets/PlayFabSdk/Shared/Internal/ISerializer.cs:53)
PlayFab.Internal.PlayFabHttp.MakeApiCall[ExecuteCloudScriptResult] (System.String apiEndpoint, PlayFab.SharedModels.PlayFabRequestCommon request, AuthType authType, System.Action`1 resultCallback, System.Action`1 errorCallback, System.Object customData, Boolean allowQueueing) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs:157)
PlayFab.PlayFabClientAPI.ExecuteCloudScript (PlayFab.ClientModels.ExecuteCloudScriptRequest request, System.Action`1 resultCallback, System.Action`1 errorCallback, System.Object customData) (at Assets/PlayFabSdk/Client/PlayFabClientAPI.cs:1088)
HutongGames.PlayMaker.Actions.PUXActionsClientExecuteCloudScript.OnEnter () (at Assets/JrDevAssets/PUX - PlayFabUnityExtensions/Playmaker Actions/Client/Server Side CloudScript/PUXActionsClientExecuteCloudScript.cs:91)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:201)
HutongGames.PlayMaker.FsmState.OnEnter () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:169)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2603)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2561)
HutongGames.PlayMaker.Fsm.UpdateStateChanges () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2489)
HutongGames.PlayMaker.Fsm.LateUpdateState (HutongGames.PlayMaker.FsmState state) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2626)
HutongGames.PlayMaker.Fsm.LateUpdate () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1953)
PlayMakerFSM.LateUpdate () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:526)

10 |1200

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

jrDev avatar image
jrDev answered

Hey van,

I think I found the issue with the Playmaker Action. But can you provide your actual C# script that works for you so I can see and advise you where to proceed?

Thanks,
jrDev

10 |1200

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

van avatar image
van answered
public void CloudExecuteTest()
    {        
        
        ExecuteCloudScriptRequest request = new ExecuteCloudScriptRequest() { 
            FunctionName = "bushelOnYourFirstDay", 
        };
        
        PlayFabClientAPI.ExecuteCloudScript(request, CloudTestCallback, OnApiCallError);
    }
10 |1200

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

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.