playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - drown

Pages: [1]
1
Playmaker Help / uGui Drop Down Add Option Problem (Video) [SOLVED]
« on: September 06, 2017, 08:39:36 AM »
Unity Version : Unity 2017.1.0f3 (Personal)
Playmaker version : 1.8.5

I am trying to let the user enter a new option for a drop down field. He enters his option via Inputfield, the submitted value is then passed through a Regex action, removing all letters from the number, then a string is built using the same format as my dropdown actions. After this, the string is added to the dropdown field via "uGui Add Drop Down Option" action.

Once the "Add Option" action is active, I get this error :

Code: [Select]
InvalidCastException: Cannot cast from source type to destination type.
HutongGames.PlayMaker.Actions.uGuiDropDownAddOptions.DoAddOptions () (at Assets/PlayMaker Custom Actions/uGui/uGuiDropDownAddOptions.cs:71)
HutongGames.PlayMaker.Actions.uGuiDropDownAddOptions.OnEnter () (at Assets/PlayMaker Custom Actions/uGui/uGuiDropDownAddOptions.cs:48)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:199)
HutongGames.PlayMaker.FsmState.OnEnter () (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:169)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2670)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2628)
HutongGames.PlayMaker.Fsm.UpdateStateChanges () (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2556)
HutongGames.PlayMaker.Fsm.DoTransition (HutongGames.PlayMaker.FsmTransition transition, Boolean isGlobal) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2595)
HutongGames.PlayMaker.Fsm.ProcessEvent (HutongGames.PlayMaker.FsmEvent fsmEvent, HutongGames.PlayMaker.FsmEventData eventData) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2198)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2289)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEvent fsmEvent) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2370)
HutongGames.PlayMaker.Actions.uGuiInputFieldOnSubmitEvent.DoOnEndEdit (System.String value) (at Assets/PlayMaker Custom Actions/uGui/uGuiInputFieldOnSubmitEvent.cs:69)
UnityEngine.Events.InvokableCall`1[System.String].Invoke (System.Object[] args) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:189)
UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:637)
UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:773)
UnityEngine.Events.UnityEvent`1[T0].Invoke (.T0 arg0) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_1.cs:53)
UnityEngine.UI.InputField.SendOnSubmit () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/InputField.cs:1582)
UnityEngine.UI.InputField.DeactivateInputField () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/InputField.cs:2303)
UnityEngine.UI.InputField.OnUpdateSelected (UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/InputField.cs:1254)
UnityEngine.EventSystems.ExecuteEvents.Execute (IUpdateSelectedHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:99)
UnityEngine.EventSystems.ExecuteEvents.Execute[IUpdateSelectedHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update()

The variable type is correct in the action, it doesnt work even if I enter a random text in the action itself. I might have set up the uGui proxies wrong, but since every other uGui action works I have no clue what I should change. I made a short video to demonstrate this error in a different project (nearly no third party assets, just some transitions) :

https://www.youtube.com/watch?v=jGqJk8GonVQ

Thanks in advance
Alex

2
Hey guys!

I have a quick suggestion for a Third party asset that is not yet mentioned in the Wiki: Lighting Database.

Lighting Database is a Database tool for Unity that has an amazing Playmaker integration. It auto-generates actions to access and alter your database via Playmaker, making it very powerful as a starting point to organize accessible Data (Save & Load).

One of the most amazing features though was just recently added : It allows you to spawn a GameObject from any object that is defined in your database and it will add a FSM to it that has all your predefined variables already in the FSM.

That means if you organize your objects in Lighting Database you can easily use them with Playmaker without having to manually add all the variables again. This way it is a kind of FSM catalogue, giving you great flexibility over your data.

https://www.assetstore.unity3d.com/en/#!/content/68444

The developer is also very friendly and always searches for feature requests to improve usability and Playmaker integration. This needs to be on the wiki imo!

3
Playmaker Help / Data Maker JSON to XML Error[SOLVED]
« on: January 11, 2017, 02:45:47 PM »
Hey guys!

I am currently learning how to fetch data from web APIs/Websites and turn them into Playmaker variables. I have an example where I get the current weather data from an API , convert it to variables and display it ingame. It works just fine.

However, for some JSON requests I get an error and some work just fine. If I try to turn this JSON request to a XML , it works fine :

Code: [Select]
{"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"base":"stations","main":{"temp":278.24,"pressure":1010,"humidity":69,"temp_min":277.15,"temp_max":279.15},"visibility":10000,"wind":{"speed":6.7,"deg":260},"clouds":{"all":75},"dt":1484167800,"sys":{"type":1,"id":5187,"message":0.0169,"country":"GB","sunrise":1484121702,"sunset":1484151385},"id":2643743,"name":"London","cod":200}
I can acess this just fine. If, however, I get this response from the very same API for a differen location , I get an error while using the "Convert Json String To XML Node" - Action:

Code: [Select]
{"coord":{"lon":11.19,"lat":54.44},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"base":"stations","main":{"temp":278.132,"pressure":1003.42,"humidity":94,"temp_min":278.132,"temp_max":278.132,"sea_level":1003.75,"grnd_level":1003.42},"wind":{"speed":13.81,"deg":271.502},"rain":{"3h":1.0725},"clouds":{"all":76},"dt":1484169997,"sys":{"message":0.0028,"country":"DE","sunrise":1484119847,"sunset":1484147806},"id":8051091,"name":"Fehmarn","cod":200}
The error Unity displays is the following :

Code: [Select]
JSON root object has multiple properties. The root object must have a single property in order to create a valid XML document. Consider specifing a DeserializeRootElementName.
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.Actions.ConvertJsonStringToXmlNode:ConvertFromJsonString() (at Assets/PlayMaker DataMaker/Json/Actions/ConvertJsonStringToXmlNode.cs:102)
HutongGames.PlayMaker.Actions.ConvertJsonStringToXmlNode:OnEnter() (at Assets/PlayMaker DataMaker/Json/Actions/ConvertJsonStringToXmlNode.cs:62)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (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(FsmState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2603)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (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:UpdateState(FsmState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2619)
HutongGames.PlayMaker.Fsm:Update() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1865)
PlayMakerFSM:Update() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:501)

The API offers direct XML , but I cant get it to work since it is formatted pretty weird and I cant get XPath to work there. I am gonna paste a quick example of the XML returns, if someone can tell me how to navigate to the values it would render my above question answered :

Code: [Select]
<current>
<city id="8051091" name="Fehmarn">
<coord lon="11.19" lat="54.44"/>
<country>DE</country>
<sun rise="2017-01-11T07:30:47" set="2017-01-11T15:16:47"/>
</city>
<temperature value="278.132" min="278.132" max="278.132" unit="kelvin"/>
<humidity value="94" unit="%"/>
<pressure value="1003.42" unit="hPa"/>
<wind>
<speed value="13.81" name=""/>
<gusts/>
<direction value="271.502" code="W" name="West"/>
</wind>
<clouds value="76" name="broken clouds"/>
<visibility/>
<precipitation value="1.0725" mode="rain" unit="3h"/>
<weather number="500" value="light rain" icon="10n"/>
<lastupdate value="2017-01-11T21:33:21"/>
</current>

Thanks in advance guys, I would really appreciate any kind of help!
 :)

4
Playmaker Help / [SOLVED] "Get Location Info" does not work
« on: November 17, 2016, 03:19:56 PM »
Hello Playmaker Community!

I am working on an app that is based on GPS location and uses http://geojson.io/ to determinate wether the user is in a designated area or not.

The core functionlaity of this project heavily depends on "Location Info" , therefore the action "Device/Get Location Info" is used to detect the Latitude and Longitude.

I start with an init state that starts the location service. I want it to try for 30 seconds - if it fails it pauses and restarts the initialization. This is the State that is supposed to do it :



The problem is that the State instantly triggers the "Location Services Failed" transition. I tried it with a GPS faker, ran it via Unity Remote 5 on a Lolipop Android device and built the app and gave it permission to use the Location services - to no avail.

The next step would be to save the Location info and sync it to geojson and detect if they match a certain area - but it never reaches this state :



I am desperately trying to figure out what could be causing it - I tried the updated actions i found on the forum somewhere (a 2013 post) , but I doubt that they are not updated in the Playmaker 1.8.3 I am using in my project.

Am I missing something Action-wise ? Or is it some project setting I am missing out on ?

Any kind of help would be greatly appreciated!
Best Regards
Alex

Pages: [1]