playMaker

Author Topic: Linker Wizard package, sample, and yes, explanatory video :)  (Read 25474 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Linker Wizard package, sample, and yes, explanatory video :)
« on: September 10, 2015, 12:10:23 PM »
Hi Everyone,

 Finally got around wrapping this together.

This wizard will let you publish on devices projects where you've been using reflection via actions such as "Get Property", "Set Property" and "invoke Method",



 So, you'll find on the Ecosystem a package, and a sample. Use the sample if you want to toy around outside your project, and when you understand what it does, and why, you can then simply get the package inside your project and use it.


The video will use the sample and show you the scene failing on the device, then how to use the wizard, publish again and see the scene work properly.

This is a complex topic, so don't hesitate to post your issues or request more explanations where it's not clear.

 Bye,

 Jean
« Last Edit: February 02, 2016, 12:52:17 AM by jeanfabre »

clandestine

  • Sr. Member
  • ****
  • Posts: 255
    • ЯKD.ZONE
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #1 on: September 12, 2015, 04:02:42 AM »
Thats so awesome Jean, i'm developing a game on PC with 452 and all works well, but my mac colleague updated his unity to 467 and the high score no longer works on iOS builds (still works on Android though), i think this is exactly what we need... and it came in the perfect moment!

Thank you very much!

UPDATE:
i have lots of objects that pop up in the wizard preview window, when i update the link.xml i get this:
Code: [Select]
<linker>
  <assembly fullname="UnityEngine">
    <type fullname="UnityEngine.TextMesh" preserve="all" />
    <type fullname="UnityEngine.Light" preserve="all" />
    <type fullname="UnityEngine.GameObject" preserve="all" />
    <type fullname="UnityEngine.Material" preserve="all" />
  </assembly>
</linker>
it is enough right? it doesn't need to enumerate each instance in each scene from what i see.

Thanks again!
« Last Edit: September 12, 2015, 06:07:12 AM by clandestine »

clandestine

  • Sr. Member
  • ****
  • Posts: 255
    • ЯKD.ZONE
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #2 on: September 14, 2015, 11:53:34 AM »
The Mac guys says it WORKS!!!!!!!!

Thank you again man!!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #3 on: September 14, 2015, 12:23:24 PM »
Hi,

I am glad it does :) happy publishing, and make sure to advertize your game on our forum :)

 Bye,

 Jean

jasperPT

  • Full Member
  • ***
  • Posts: 115
  • I am a VFX Animator teaching myself to make games
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #4 on: September 14, 2015, 05:41:33 PM »
Sweet!

Will check this out, thanks so much!

braintapgames

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #5 on: September 24, 2015, 11:18:15 PM »
For some reason, my link.xml doesn't seem to work when I build it. It works fine when I test it on Unity, but once I build it to my iOS device, all of the SetProperty things do not work again. Any help?

When I have debug on also, it gives me a NullReferenceException in line 32. It works fine when I have debug off, but then it doesn't update the preview.
« Last Edit: September 24, 2015, 11:39:02 PM by braintapgames »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #6 on: September 25, 2015, 01:18:25 AM »
Hi,

 can you paste the full error and the link.xml content as well? thanks

 Bye

 Jean

braintapgames

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #7 on: September 25, 2015, 01:41:19 AM »
Hi,

 can you paste the full error and the link.xml content as well? thanks

 Bye

 Jean

Just to reiterate - after updating the link.xml, it works on Unity, but once I make a build and try on my iOS device (iPad and iPhone 6), it doesn't seem to work there. Am I missing a step between making the link.xml through the linker wizard and testing the build??

Xcode: 6.3.1
Unity: 5.0.1f1
Playmaker: Latest update


Two different occasions:

NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.Actions.SetProperty.OnEnter () (at Assets/PlayMaker/Actions/SetProperty.cs:32)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex)
HutongGames.PlayMaker.FsmState.OnEnter ()
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState)
HutongGames.PlayMaker.Fsm.UpdateStateChanges ()
HutongGames.PlayMaker.Fsm.DoTransition (HutongGames.PlayMaker.FsmTransition transition, Boolean isGlobal)
HutongGames.PlayMaker.Fsm.ProcessEvent (HutongGames.PlayMaker.FsmEvent fsmEvent, HutongGames.PlayMaker.FsmEventData eventData)
HutongGames.PlayMaker.Fsm.BroadcastEvent (HutongGames.PlayMaker.FsmEvent fsmEvent, Boolean excludeSelf)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, System.String fsmEventName)
PlayMakerUGuiComponentProxy.FirePlayMakerEvent (HutongGames.PlayMaker.FsmEventData eventData) (at Assets/PlayMaker uGui/Proxies/PlayMakerUGuiComponentProxy.cs:466)
PlayMakerUGuiComponentProxy.OnClick () (at Assets/PlayMaker uGui/Proxies/PlayMakerUGuiComponentProxy.cs:320)
UnityEngine.Events.InvokableCall.Invoke (System.Object[] args)
UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters)
UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters)
UnityEngine.Events.UnityEvent.Invoke ()
UnityEngine.UI.Button.Press () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:35)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:44)
UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:52)
UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269)

NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.Actions.SetProperty.OnEnter () (at Assets/PlayMaker/Actions/SetProperty.cs:32)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex)
HutongGames.PlayMaker.FsmState.OnEnter ()
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState)
HutongGames.PlayMaker.Fsm.UpdateStateChanges ()
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.Update ()
PlayMakerFSM.Update ()


<linker>
  <assembly fullname="UnityEngine">
    <type fullname="UnityEngine.SpriteRenderer" preserve="all" />
    <type fullname="UnityEngine.BoxCollider2D" preserve="all" />
    <type fullname="UnityEngine.Camera" preserve="all" />
    <type fullname="UnityEngine.GameObject" preserve="all" />
    <type fullname="UnityEngine.Canvas" preserve="all" />
  </assembly>
  <assembly fullname="UnityEngine.UI">
    <type fullname="UnityEngine.UI.Image" preserve="all" />
    <type fullname="UnityEngine.UI.Button" preserve="all" />
    <type fullname="UnityEngine.UI.Text" preserve="all" />
  </assembly>
</linker>

Thank you for your help!
« Last Edit: September 25, 2015, 01:44:59 AM by braintapgames »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #8 on: September 25, 2015, 07:08:26 AM »
Hi,

 Your problem is not related to the link,xml setup. your set property action is trying to access an object that is null, that's the problem here.

Quote
NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.Actions.SetProperty.OnEnter () (at Assets/PlayMaker/Actions/SetProperty.cs:32)

so in your case, something is getting deleted or badly connected when on device.

are you sure you don't repro this in editor?

to solve this, I would try on a totally empty scene BUT the object that you try to access, then publish that scene and see how it behaves.

Also, I did test on Unity 5 for UI access using Set property and it works on device, I can set the text of UI text fine. All player settings to default and iIL2cpp or course.


Bye,

 Jean


braintapgames

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #9 on: September 25, 2015, 11:42:26 AM »
So I found the issue - two set property actions were left blank. Once I removed them, I didn't get the NullReference issue anymore.

However, I'm still having the same issue - the game works fine on Unity, but once it builds to an iOS device, it doesn't work again. The things the link.xml should cover, such as boxcollider2D and UI elements do not work.
« Last Edit: September 25, 2015, 03:17:39 PM by braintapgames »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #10 on: October 08, 2015, 08:41:14 AM »
Hi,

 What is the exact property you are trying to access for the boxcollider2d and the UI element? I think I'll update the wizard to also record the property accessed so that by passing the link.xml I'll know exactly how to repro.

 Bye,

 Jean

Graham

  • Sr. Member
  • ****
  • Posts: 332
  • I Love Playmaker!
    • Portfolio
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #11 on: September 23, 2016, 10:02:38 AM »
Thanks for creating this invaluable tool Jean!

In case anyone else encounters crashing in their WebGL builds when using get and set property actions, this solution will indeed fix it.
More templates on the Unity Asset Store!

Disclosure: We are using affiliate links to our assets; we may receive a commission for purchases made through them. This helps us to continue developing and maintaining great products!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #12 on: September 26, 2016, 03:51:03 AM »
Hi,

your are welcomed :) I am glad this is useful, indeed I think Unity should provide a similar mechanism for this... lost classes that are actually used is a miss in the production flow.

Bye,

 Jean

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #13 on: December 03, 2016, 12:00:13 PM »
Once the issues are fixed, is it safe to remove the Linker Wizard and how do I do that? Thanks.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Linker Wizard package, sample, and yes, explanatory video :)
« Reply #14 on: December 05, 2016, 12:49:25 AM »
Hi,

 You simply reimport PlayMaker to remove the changes on the various actions, amd you can then remove the linker asset in your project. But make sure you keep the xml file generated by the linker wizard.

 Bye,

 Jean