Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: elusiven on November 14, 2016, 09:08:36 AM

Title: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on November 14, 2016, 09:08:36 AM
Hi all,

Title says it all... It just keeps "None" and that's it, I press on the variable that I want to use which has the XML proxy, and it just keeps going "None" anyway... Any ideas? Thanks
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on November 14, 2016, 11:15:27 PM
Hi,

 What version of DataMaker do you have? I thought the latest version I put on the Ecosystem fixed this.


 Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on November 15, 2016, 03:31:08 AM
I just upgraded to the newest, and error still persists...

I do now get an error though in the log..

ArgumentException: Object type HutongGames.PlayMaker.FsmGameObject cannot be converted to target type: HutongGames.PlayMaker.FsmEvent
Parameter name: val
System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoField.cs:148)
System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/FieldInfo.cs:150)
HutongGames.PlayMakerEditor.ActionEditor.DoVariableSelection (System.Object userdata) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionEditor.cs:2893)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/GenericMenuBindings.gen.cs:122)
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on November 16, 2016, 01:48:08 AM
Hi,

 Ok, you'll need to go through your actions, one of them has lost it's setup.

did you updated from Unity 4 to Unity 5 without first updating PlayMaker to 1.8 by any chance?

Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on November 16, 2016, 02:52:22 AM
I was upgrading from unity 5.3 to 5.4, but that was after this anyway... I had unity 5 from the beginning of the project. Don't have any action or state errors, what shall i do exactly??
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on November 17, 2016, 12:10:17 AM
Hi,

 You need to go through your Select Single Node Actions and verify their setup, you'll likely find that one of the variable type is wrong now.

Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on November 30, 2016, 03:08:17 AM
They're all fine, my single nodes actions are all working correctly when I manually point it at the proxy gameobject. But the variable goes to None and spits out the error when I try to set it to read from variable for example. It doesn't let me set a variable.

I've been stuck on this for days now, is there any way to fix this?

ArgumentException: Object type HutongGames.PlayMaker.FsmString cannot be converted to target type: HutongGames.PlayMaker.FsmEvent
Parameter name: val
System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoField.cs:148)
System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/FieldInfo.cs:150)
HutongGames.PlayMakerEditor.ActionEditor.DoVariableSelection (System.Object userdata) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionEditor.cs:2893)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/GenericMenuBindings.gen.cs:122)


Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: 600 on November 30, 2016, 03:24:50 AM
Looks like the same error I have when using variable, posted on XML actions post:
http://hutonggames.com/playmakerforum/index.php?topic=2583.60
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on December 01, 2016, 12:24:50 AM
Hi,

yes, that one is a know issue, I can't find a work around unfortunately. Will ping Alex, maybe he can't provide the old api method back.

Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on December 01, 2016, 02:44:10 AM
Jean,

Is there a way I can modify the data maker proxy to take in string of XML content from anywhere, like the persistence datapath instead of a text asset?

If not then I will have to wait for a fix
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on December 02, 2016, 01:12:39 AM
Hi,

 yes, using the xml proxy is definitly recommended here.

Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on December 02, 2016, 09:11:39 AM
In the XML proxy, there is only a way to get data from text asset which is not really ideal and won't work with what I want to do.. I download an xml file to persistence data path, and then save xml content to a string that later playmaker fsm can use... Unfortunately I cannot set a variable in the xml select single node due to this bug and it's causing a lot of problems. Also some of my prefabs use this action and also lose reference to the proxy because I can't set the variable.... Do you have any ETA on this fix? Thanks
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on December 05, 2016, 06:50:52 AM
Hi,

 Can you make a screenshot of where exactly you can't set the variable? I know they are several places and from your description, I am pretty sure I did an update to fix this, but want to make sure of where you are exactly.

 Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on December 05, 2016, 07:48:46 AM
Even better.. A video :P


Unity: 5.4.2f2

Playmaker: 1.8.3.f4
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on December 08, 2016, 03:48:34 AM
Hiiii, any updates on this Jean? My deadlines are getting tight :P
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on December 09, 2016, 02:45:20 AM
Hi,

uhm. Are you sure you have downloaded the latest version, cause I did fixed this.

 What version does it mention in the changelog? you should have 1.2.1

 Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on December 12, 2016, 02:44:25 AM
Yes, I'm using 1.2.1 - Still the same error.
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on December 14, 2016, 04:39:27 AM
Jean,

Please have a look at this video


It clearly shows that I have the newest datamaker, and recent Playmaker version, and yet this still happens.. Please help, it's delaying my project :(

Also, is there a way to modify the XML Proxy, to work with string variables instead of text assets?? It doesn't work when I try to modify it, it comes up with a log that the XML is not properly formatted or something.
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on January 08, 2017, 04:57:43 PM
Any news on this? Seen my last video???
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on January 09, 2017, 12:20:21 AM
Hi,

 It's unfortunate, I can't replicate this!

(http://i.imgur.com/t0nUhGF.gif)


If you are stuck with just this, simply move into a memory reference instead of a FsmString.

you don't need to modify the proxy, simply use the action "SaveInProxy", have you tried it?

Can you tell me where you xml source comes from?

Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on January 09, 2017, 03:32:12 AM
The XML comes from an amazon s3 storage, so when the app starts the file gets downloaded and then it gets loaded into a string variable so ideally what I would like to do is to then use this variable to manipulate the xml but because of that error I am unable to do so.

update: I tried using memory referance and it comes up with the same error...
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on January 10, 2017, 12:02:24 AM
Hi,

Since I can't replicate, I am really stuck on how I can help out here unfortunatly.

Can you check what's your dataversion on that fsm where you have this problem ) dataversion available in small print at the bottom of the fsm tab of the PlayMaker editor) and have you tried on a fresh project?

 The  way to go is the following however: Save it inside a proxy using "XMlSaveInProxy" action, and follow that with a "XmlRefreshStringVersion" to check in the Unity inspector what's the content.

This way, you can bypass the issue of selecting an FsmString variable for the source in your actions.

 Bye,

 Jean

Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on January 11, 2017, 08:28:35 AM
When I set the xml proxy as a gameobject, with no variable and then use xML save in proxy then yes it works fine... But will it keep the reference when I build it and try on iOS or android or it won't?? after all it's only referencing a gameobject on scene no an actual gameobject saved in variable - But that's the only way that works for me without throwing up errors.

I just tried on my mac mini, updated everything to newest version and it's still coming up with that same error...

ArgumentException: Object type HutongGames.PlayMaker.FsmGameObject cannot be converted to target type: System.Boolean
Parameter name: val
System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoField.cs:148)
System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/FieldInfo.cs:150)
HutongGames.PlayMakerEditor.ActionEditor.DoVariableSelection (System.Object userdata) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionEditor.cs:2893)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/GenericMenuBindings.gen.cs:122)
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on January 11, 2017, 11:07:08 PM
Hi,

 yes, it keeps the reference.

how did you get this error when publishing on mac mini? this error looks like coming from the Unity Editor.


 Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on January 12, 2017, 02:34:16 AM
This is the error I get when trying to select a variable for my XML proxy in the datamaker's xml node action.
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on January 12, 2017, 10:26:15 AM
Now i'm stuck again with the same problem.. I have a template which generates some of the items on ugui for me, and I wanted to display the player's progress on it.. And it happens that I MUST use a variable when using the xml proxy, so that same error pop ups and it won't let me select

It's weird though that the errors says that it can't convert like gameobject to system.boolean? Wtf?
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on January 12, 2017, 11:47:01 PM
Hi,

 what's really odd is that I can't repro this.

Can you confirm you have tried on a clean fresh project and with a simple, fsm , one state, with just that action, you still have this problem?

Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on January 13, 2017, 03:03:10 AM
Okay, we might have a breakthrough lol... I made a brand new project with one fsm and one proxy, and it worked. I don't have any errors though in playmaker, and no unity errors...So now the question is ... How can I debug my existing one to find out why it's not working?
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on January 13, 2017, 04:21:50 AM
I get these warnings and that error in my existing project.

(https://s29.postimg.org/oxbi154yd/Screenshot_at_sty_13_11_19_48.png)


I did a little test... I packaged the current project in .asset and then created brand new project.. Installed playmaker, datamaker, ES2 etc... Imported that asset package... I have shi*t loads of errors but I can add a variable for proxy lol... Does that help?
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on January 16, 2017, 01:26:25 AM
Hi,

 I am still unsure if you actually tested a fresh project with Just DataMaker yet?

 I am suspecting that the PlayMaker Utils from the dataMaKer package get overwriting by an older version from another package and so you loose the fixes.

 Make sure you reimport DataMaker, that could be just what's needed.

 Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on January 18, 2017, 02:51:45 AM
I've exported the whole project, then made a brand new one.. Installed all the plugins again including playmaker/datamaker and corrected the errors and it seems to be working now fine... I'l post if I run into anymore issues but at the moment it's all good.
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: elusiven on January 18, 2017, 04:27:05 PM
Interesting...I've used Enum Generator and it happened again...Coincident or not?
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on January 18, 2017, 11:18:54 PM
Hi,

 Uhm, I am pretty sure I updated the PlayMaker Utils on the enum generator before publishing.

so, with this, it's now a clear cut that your problem is when you install another package with a playmaker utils folder older than the one used in datamaker.

 Let me check.

 Bye,

 Jean
Title: Re: Can not set object variable in xml select single node for XML proxy
Post by: jeanfabre on January 18, 2017, 11:48:44 PM
Hi,

 I just tested and it's all good.

1: new fresh project
2: imported datamaker
3: verified it works
4: imported enum creator
5: verified it works.

I am really not sure what's going on your side

Bye,

 Jean